-
-
-
-
-**Positioning tooltips and popovers is difficult. Popper is here to help!**
-
-Given an element, such as a button, and a tooltip element describing it, Popper
-will automatically put the tooltip in the right place near the button.
-
-It will position _any_ UI element that "pops out" from the flow of your document
-and floats near a target element. The most common example is a tooltip, but it
-also includes popovers, drop-downs, and more. All of these can be generically
-described as a "popper" element.
-
-## Demo
-
-[](https://popper.js.org)
-
-## Docs
-
-- [v2.x (latest)](https://popper.js.org/docs/v2/)
-- [v1.x](https://popper.js.org/docs/v1/)
-
-We've created a
-[Migration Guide](https://popper.js.org/docs/v2/migration-guide/) to help you
-migrate from Popper 1 to Popper 2.
-
-To contribute to the Popper website and documentation, please visit the
-[dedicated repository](https://github.com/popperjs/website).
-
-## Why not use pure CSS?
-
-- **Clipping and overflow issues**: Pure CSS poppers will not be prevented from
- overflowing clipping boundaries, such as the viewport. It will get partially
- cut off or overflows if it's near the edge since there is no dynamic
- positioning logic. When using Popper, your popper will always be positioned in
- the right place without needing manual adjustments.
-- **No flipping**: CSS poppers will not flip to a different placement to fit
- better in view if necessary. While you can manually adjust for the main axis
- overflow, this feature cannot be achieved via CSS alone. Popper automatically
- flips the tooltip to make it fit in view as best as possible for the user.
-- **No virtual positioning**: CSS poppers cannot follow the mouse cursor or be
- used as a context menu. Popper allows you to position your tooltip relative to
- any coordinates you desire.
-- **Slower development cycle**: When pure CSS is used to position popper
- elements, the lack of dynamic positioning means they must be carefully placed
- to consider overflow on all screen sizes. In reusable component libraries,
- this means a developer can't just add the component anywhere on the page,
- because these issues need to be considered and adjusted for every time. With
- Popper, you can place your elements anywhere and they will be positioned
- correctly, without needing to consider different screen sizes, layouts, etc.
- This massively speeds up development time because this work is automatically
- offloaded to Popper.
-- **Lack of extensibility**: CSS poppers cannot be easily extended to fit any
- arbitrary use case you may need to adjust for. Popper is built with
- extensibility in mind.
-
-## Why Popper?
-
-With the CSS drawbacks out of the way, we now move on to Popper in the
-JavaScript space itself.
-
-Naive JavaScript tooltip implementations usually have the following problems:
-
-- **Scrolling containers**: They don't ensure the tooltip stays with the
- reference element while scrolling when inside any number of scrolling
- containers.
-- **DOM context**: They often require the tooltip move outside of its original
- DOM context because they don't handle `offsetParent` contexts.
-- **Compatibility**: Popper handles an incredible number of edge cases regarding
- different browsers and environments (mobile viewports, RTL, scrollbars enabled
- or disabled, etc.). Popper is a popular and well-maintained library, so you
- can be confident positioning will work for your users on any device.
-- **Configurability**: They often lack advanced configurability to suit any
- possible use case.
-- **Size**: They are usually relatively large in size, or require an ancient
- jQuery dependency.
-- **Performance**: They often have runtime performance issues and update the
- tooltip position too slowly.
-
-**Popper solves all of these key problems in an elegant, performant manner.** It
-is a lightweight ~3 kB library that aims to provide a reliable and extensible
-positioning engine you can use to ensure all your popper elements are positioned
-in the right place.
-
-When you start writing your own popper implementation, you'll quickly run into
-all of the problems mentioned above. These widgets are incredibly common in our
-UIs; we've done the hard work figuring this out so you don't need to spend hours
-fixing and handling numerous edge cases that we already ran into while building
-the library!
-
-Popper is used in popular libraries like Bootstrap, Foundation, Material UI, and
-more. It's likely you've already used popper elements on the web positioned by
-Popper at some point in the past few years.
-
-Since we write UIs using powerful abstraction libraries such as React or Angular
-nowadays, you'll also be glad to know Popper can fully integrate with them and
-be a good citizen together with your other components. Check out `react-popper`
-for the official Popper wrapper for React.
-
-## Installation
-
-### 1. Package Manager
-
-```bash
-# With npm
-npm i @popperjs/core
-
-# With Yarn
-yarn add @popperjs/core
-```
-
-### 2. CDN
-
-```html
-
-
-
-
-
-```
-
-### 3. Direct Download?
-
-Managing dependencies by "directly downloading" them and placing them into your
-source code is not recommended for a variety of reasons, including missing out
-on feat/fix updates easily. Please use a versioning management system like a CDN
-or npm/Yarn.
-
-## Usage
-
-The most straightforward way to get started is to import Popper from the `unpkg`
-CDN, which includes all of its features. You can call the `Popper.createPopper`
-constructor to create new popper instances.
-
-Here is a complete example:
-
-```html
-
-Popper example
-
-
-
-
-
I'm a tooltip
-
-
-
-```
-
-Visit the [tutorial](https://popper.js.org/docs/v2/tutorial/) for an example of
-how to build your own tooltip from scratch using Popper.
-
-### Module bundlers
-
-You can import the `createPopper` constructor from the fully-featured file:
-
-```js
-import { createPopper } from '@popperjs/core';
-
-const button = document.querySelector('#button');
-const tooltip = document.querySelector('#tooltip');
-
-// Pass the button, the tooltip, and some options, and Popper will do the
-// magic positioning for you:
-createPopper(button, tooltip, {
- placement: 'right',
-});
-```
-
-All the modifiers listed in the docs menu will be enabled and "just work", so
-you don't need to think about setting Popper up. The size of Popper including
-all of its features is about 5 kB minzipped, but it may grow a bit in the
-future.
-
-#### Popper Lite (tree-shaking)
-
-If bundle size is important, you'll want to take advantage of tree-shaking. The
-library is built in a modular way to allow to import only the parts you really
-need.
-
-```js
-import { createPopperLite as createPopper } from '@popperjs/core';
-```
-
-The Lite version includes the most necessary modifiers that will compute the
-offsets of the popper, compute and add the positioning styles, and add event
-listeners. This is close in bundle size to pure CSS tooltip libraries, and
-behaves somewhat similarly.
-
-However, this does not include the features that makes Popper truly useful.
-
-The two most useful modifiers not included in Lite are `preventOverflow` and
-`flip`:
-
-```js
-import {
- createPopperLite as createPopper,
- preventOverflow,
- flip,
-} from '@popperjs/core';
-
-const button = document.querySelector('#button');
-const tooltip = document.querySelector('#tooltip');
-
-createPopper(button, tooltip, {
- modifiers: [preventOverflow, flip],
-});
-```
-
-As you make more poppers, you may be finding yourself needing other modifiers
-provided by the library.
-
-See [tree-shaking](https://popper.js.org/docs/v2/performance/#tree-shaking) for more
-information.
-
-## Distribution targets
-
-Popper is distributed in 3 different versions, in 3 different file formats.
-
-The 3 file formats are:
-
-- `esm` (works with `import` syntax — **recommended**)
-- `umd` (works with `
-```
-
-## Documentation
-
-The full documentation can be found on the official Popper website:
-
-http://popper.js.org/react-popper
-
-
-## Running Locally
-
-#### clone repo
-
-`git clone git@github.com:popperjs/react-popper.git`
-
-#### move into folder
-
-`cd ~/react-popper`
-
-#### install dependencies
-
-`npm install` or `yarn`
-
-#### run dev mode
-
-`npm run demo:dev` or `yarn demo:dev`
-
-#### open your browser and visit:
-
-`http://localhost:1234/`
diff --git a/frontend/node_modules/react-popper/dist/index.umd.js b/frontend/node_modules/react-popper/dist/index.umd.js
deleted file mode 100644
index 9afaa46db..000000000
--- a/frontend/node_modules/react-popper/dist/index.umd.js
+++ /dev/null
@@ -1,469 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('@popperjs/core')) :
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', '@popperjs/core'], factory) :
- (global = global || self, factory(global.ReactPopper = {}, global.React, global.ReactDOM, global.Popper));
-}(this, (function (exports, React, ReactDOM, core) { 'use strict';
-
- var ManagerReferenceNodeContext = React.createContext();
- var ManagerReferenceNodeSetterContext = React.createContext();
- function Manager(_ref) {
- var children = _ref.children;
-
- var _React$useState = React.useState(null),
- referenceNode = _React$useState[0],
- setReferenceNode = _React$useState[1];
-
- var hasUnmounted = React.useRef(false);
- React.useEffect(function () {
- return function () {
- hasUnmounted.current = true;
- };
- }, []);
- var handleSetReferenceNode = React.useCallback(function (node) {
- if (!hasUnmounted.current) {
- setReferenceNode(node);
- }
- }, []);
- return /*#__PURE__*/React.createElement(ManagerReferenceNodeContext.Provider, {
- value: referenceNode
- }, /*#__PURE__*/React.createElement(ManagerReferenceNodeSetterContext.Provider, {
- value: handleSetReferenceNode
- }, children));
- }
-
- /**
- * Takes an argument and if it's an array, returns the first item in the array,
- * otherwise returns the argument. Used for Preact compatibility.
- */
- var unwrapArray = function unwrapArray(arg) {
- return Array.isArray(arg) ? arg[0] : arg;
- };
- /**
- * Takes a maybe-undefined function and arbitrary args and invokes the function
- * only if it is defined.
- */
-
- var safeInvoke = function safeInvoke(fn) {
- if (typeof fn === 'function') {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return fn.apply(void 0, args);
- }
- };
- /**
- * Sets a ref using either a ref callback or a ref object
- */
-
- var setRef = function setRef(ref, node) {
- // if its a function call it
- if (typeof ref === 'function') {
- return safeInvoke(ref, node);
- } // otherwise we should treat it as a ref object
- else if (ref != null) {
- ref.current = node;
- }
- };
- /**
- * Simple ponyfill for Object.fromEntries
- */
-
- var fromEntries = function fromEntries(entries) {
- return entries.reduce(function (acc, _ref) {
- var key = _ref[0],
- value = _ref[1];
- acc[key] = value;
- return acc;
- }, {});
- };
- /**
- * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
- */
-
- var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
-
- /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
-
- var hasElementType = typeof Element !== 'undefined';
- var hasMap = typeof Map === 'function';
- var hasSet = typeof Set === 'function';
- var hasArrayBuffer = typeof ArrayBuffer === 'function';
-
- // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
-
- function equal(a, b) {
- // START: fast-deep-equal es6/index.js 3.1.1
- if (a === b) return true;
-
- if (a && b && typeof a == 'object' && typeof b == 'object') {
- if (a.constructor !== b.constructor) return false;
-
- var length, i, keys;
- if (Array.isArray(a)) {
- length = a.length;
- if (length != b.length) return false;
- for (i = length; i-- !== 0;)
- if (!equal(a[i], b[i])) return false;
- return true;
- }
-
- // START: Modifications:
- // 1. Extra `has &&` helpers in initial condition allow es6 code
- // to co-exist with es5.
- // 2. Replace `for of` with es5 compliant iteration using `for`.
- // Basically, take:
- //
- // ```js
- // for (i of a.entries())
- // if (!b.has(i[0])) return false;
- // ```
- //
- // ... and convert to:
- //
- // ```js
- // it = a.entries();
- // while (!(i = it.next()).done)
- // if (!b.has(i.value[0])) return false;
- // ```
- //
- // **Note**: `i` access switches to `i.value`.
- var it;
- if (hasMap && (a instanceof Map) && (b instanceof Map)) {
- if (a.size !== b.size) return false;
- it = a.entries();
- while (!(i = it.next()).done)
- if (!b.has(i.value[0])) return false;
- it = a.entries();
- while (!(i = it.next()).done)
- if (!equal(i.value[1], b.get(i.value[0]))) return false;
- return true;
- }
-
- if (hasSet && (a instanceof Set) && (b instanceof Set)) {
- if (a.size !== b.size) return false;
- it = a.entries();
- while (!(i = it.next()).done)
- if (!b.has(i.value[0])) return false;
- return true;
- }
- // END: Modifications
-
- if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
- length = a.length;
- if (length != b.length) return false;
- for (i = length; i-- !== 0;)
- if (a[i] !== b[i]) return false;
- return true;
- }
-
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
-
- keys = Object.keys(a);
- length = keys.length;
- if (length !== Object.keys(b).length) return false;
-
- for (i = length; i-- !== 0;)
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
- // END: fast-deep-equal
-
- // START: react-fast-compare
- // custom handling for DOM elements
- if (hasElementType && a instanceof Element) return false;
-
- // custom handling for React
- for (i = length; i-- !== 0;) {
- if (keys[i] === '_owner' && a.$$typeof) {
- // React-specific: avoid traversing React elements' _owner.
- // _owner contains circular references
- // and is not needed when comparing the actual elements (and not their owners)
- // .$$typeof and ._store on just reasonable markers of a react element
- continue;
- }
-
- // all other properties should be traversed as usual
- if (!equal(a[keys[i]], b[keys[i]])) return false;
- }
- // END: react-fast-compare
-
- // START: fast-deep-equal
- return true;
- }
-
- return a !== a && b !== b;
- }
- // end fast-deep-equal
-
- var reactFastCompare = function isEqual(a, b) {
- try {
- return equal(a, b);
- } catch (error) {
- if (((error.message || '').match(/stack|recursion/i))) {
- // warn on circular references, don't crash
- // browsers give this different errors name and messages:
- // chrome/safari: "RangeError", "Maximum call stack size exceeded"
- // firefox: "InternalError", too much recursion"
- // edge: "Error", "Out of stack space"
- console.warn('react-fast-compare cannot handle circular refs');
- return false;
- }
- // some other error. we should definitely know about these
- throw error;
- }
- };
-
- var EMPTY_MODIFIERS = [];
- var usePopper = function usePopper(referenceElement, popperElement, options) {
- if (options === void 0) {
- options = {};
- }
-
- var prevOptions = React.useRef(null);
- var optionsWithDefaults = {
- onFirstUpdate: options.onFirstUpdate,
- placement: options.placement || 'bottom',
- strategy: options.strategy || 'absolute',
- modifiers: options.modifiers || EMPTY_MODIFIERS
- };
-
- var _React$useState = React.useState({
- styles: {
- popper: {
- position: optionsWithDefaults.strategy,
- left: '0',
- top: '0'
- },
- arrow: {
- position: 'absolute'
- }
- },
- attributes: {}
- }),
- state = _React$useState[0],
- setState = _React$useState[1];
-
- var updateStateModifier = React.useMemo(function () {
- return {
- name: 'updateState',
- enabled: true,
- phase: 'write',
- fn: function fn(_ref) {
- var state = _ref.state;
- var elements = Object.keys(state.elements);
- ReactDOM.flushSync(function () {
- setState({
- styles: fromEntries(elements.map(function (element) {
- return [element, state.styles[element] || {}];
- })),
- attributes: fromEntries(elements.map(function (element) {
- return [element, state.attributes[element]];
- }))
- });
- });
- },
- requires: ['computeStyles']
- };
- }, []);
- var popperOptions = React.useMemo(function () {
- var newOptions = {
- onFirstUpdate: optionsWithDefaults.onFirstUpdate,
- placement: optionsWithDefaults.placement,
- strategy: optionsWithDefaults.strategy,
- modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
- name: 'applyStyles',
- enabled: false
- }])
- };
-
- if (reactFastCompare(prevOptions.current, newOptions)) {
- return prevOptions.current || newOptions;
- } else {
- prevOptions.current = newOptions;
- return newOptions;
- }
- }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
- var popperInstanceRef = React.useRef();
- useIsomorphicLayoutEffect(function () {
- if (popperInstanceRef.current) {
- popperInstanceRef.current.setOptions(popperOptions);
- }
- }, [popperOptions]);
- useIsomorphicLayoutEffect(function () {
- if (referenceElement == null || popperElement == null) {
- return;
- }
-
- var createPopper = options.createPopper || core.createPopper;
- var popperInstance = createPopper(referenceElement, popperElement, popperOptions);
- popperInstanceRef.current = popperInstance;
- return function () {
- popperInstance.destroy();
- popperInstanceRef.current = null;
- };
- }, [referenceElement, popperElement, options.createPopper]);
- return {
- state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
- styles: state.styles,
- attributes: state.attributes,
- update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
- forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
- };
- };
-
- var NOOP = function NOOP() {
- return void 0;
- };
-
- var NOOP_PROMISE = function NOOP_PROMISE() {
- return Promise.resolve(null);
- };
-
- var EMPTY_MODIFIERS$1 = [];
- function Popper(_ref) {
- var _ref$placement = _ref.placement,
- placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
- _ref$strategy = _ref.strategy,
- strategy = _ref$strategy === void 0 ? 'absolute' : _ref$strategy,
- _ref$modifiers = _ref.modifiers,
- modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS$1 : _ref$modifiers,
- referenceElement = _ref.referenceElement,
- onFirstUpdate = _ref.onFirstUpdate,
- innerRef = _ref.innerRef,
- children = _ref.children;
- var referenceNode = React.useContext(ManagerReferenceNodeContext);
-
- var _React$useState = React.useState(null),
- popperElement = _React$useState[0],
- setPopperElement = _React$useState[1];
-
- var _React$useState2 = React.useState(null),
- arrowElement = _React$useState2[0],
- setArrowElement = _React$useState2[1];
-
- React.useEffect(function () {
- setRef(innerRef, popperElement);
- }, [innerRef, popperElement]);
- var options = React.useMemo(function () {
- return {
- placement: placement,
- strategy: strategy,
- onFirstUpdate: onFirstUpdate,
- modifiers: [].concat(modifiers, [{
- name: 'arrow',
- enabled: arrowElement != null,
- options: {
- element: arrowElement
- }
- }])
- };
- }, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
-
- var _usePopper = usePopper(referenceElement || referenceNode, popperElement, options),
- state = _usePopper.state,
- styles = _usePopper.styles,
- forceUpdate = _usePopper.forceUpdate,
- update = _usePopper.update;
-
- var childrenProps = React.useMemo(function () {
- return {
- ref: setPopperElement,
- style: styles.popper,
- placement: state ? state.placement : placement,
- hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
- isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
- arrowProps: {
- style: styles.arrow,
- ref: setArrowElement
- },
- forceUpdate: forceUpdate || NOOP,
- update: update || NOOP_PROMISE
- };
- }, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
- return unwrapArray(children)(childrenProps);
- }
-
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- var warning = function() {};
-
- {
- var printWarning = function printWarning(format, args) {
- var len = arguments.length;
- args = new Array(len > 1 ? len - 1 : 0);
- for (var key = 1; key < len; key++) {
- args[key - 1] = arguments[key];
- }
- var argIndex = 0;
- var message = 'Warning: ' +
- format.replace(/%s/g, function() {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- warning = function(condition, format, args) {
- var len = arguments.length;
- args = new Array(len > 2 ? len - 2 : 0);
- for (var key = 2; key < len; key++) {
- args[key - 2] = arguments[key];
- }
- if (format === undefined) {
- throw new Error(
- '`warning(condition, format, ...args)` requires a warning ' +
- 'message argument'
- );
- }
- if (!condition) {
- printWarning.apply(null, [format].concat(args));
- }
- };
- }
-
- var warning_1 = warning;
-
- function Reference(_ref) {
- var children = _ref.children,
- innerRef = _ref.innerRef;
- var setReferenceNode = React.useContext(ManagerReferenceNodeSetterContext);
- var refHandler = React.useCallback(function (node) {
- setRef(innerRef, node);
- safeInvoke(setReferenceNode, node);
- }, [innerRef, setReferenceNode]); // ran on unmount
- // eslint-disable-next-line react-hooks/exhaustive-deps
-
- React.useEffect(function () {
- return function () {
- return setRef(innerRef, null);
- };
- }, []);
- React.useEffect(function () {
- warning_1(Boolean(setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
- }, [setReferenceNode]);
- return unwrapArray(children)({
- ref: refHandler
- });
- }
-
- exports.Manager = Manager;
- exports.Popper = Popper;
- exports.Reference = Reference;
- exports.usePopper = usePopper;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
diff --git a/frontend/node_modules/react-popper/dist/index.umd.min.js b/frontend/node_modules/react-popper/dist/index.umd.min.js
deleted file mode 100644
index 61420ce00..000000000
--- a/frontend/node_modules/react-popper/dist/index.umd.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@popperjs/core")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@popperjs/core"],t):t((e=e||self).ReactPopper={},e.React,e.ReactDOM,e.Popper)}(this,(function(e,t,r,n){"use strict";var o=t.createContext(),u=t.createContext();var i=function(e){return Array.isArray(e)?e[0]:e},a=function(e){if("function"==typeof e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n = React.createContext();
-export const ManagerReferenceNodeSetterContext: React.Context<
- void | ((?Element) => void)
-> = React.createContext();
-
-export type ManagerProps = $ReadOnly<{
- children: React.Node,
-}>;
-
-export function Manager({ children }: ManagerProps): React.Node {
- const [referenceNode, setReferenceNode] = React.useState(null);
-
- const hasUnmounted = React.useRef(false);
- React.useEffect(() => {
- return () => {
- hasUnmounted.current = true;
- };
- }, []);
-
- const handleSetReferenceNode = React.useCallback((node) => {
- if (!hasUnmounted.current) {
- setReferenceNode(node);
- }
- }, []);
-
- return (
-
-
- {children}
-
-
- );
-}
diff --git a/frontend/node_modules/react-popper/lib/cjs/Popper.js b/frontend/node_modules/react-popper/lib/cjs/Popper.js
deleted file mode 100644
index a9b629032..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/Popper.js
+++ /dev/null
@@ -1,91 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Popper = Popper;
-
-var React = _interopRequireWildcard(require("react"));
-
-var _Manager = require("./Manager");
-
-var _utils = require("./utils");
-
-var _usePopper2 = require("./usePopper");
-
-function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-var NOOP = function NOOP() {
- return void 0;
-};
-
-var NOOP_PROMISE = function NOOP_PROMISE() {
- return Promise.resolve(null);
-};
-
-var EMPTY_MODIFIERS = [];
-
-function Popper(_ref) {
- var _ref$placement = _ref.placement,
- placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
- _ref$strategy = _ref.strategy,
- strategy = _ref$strategy === void 0 ? 'absolute' : _ref$strategy,
- _ref$modifiers = _ref.modifiers,
- modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers,
- referenceElement = _ref.referenceElement,
- onFirstUpdate = _ref.onFirstUpdate,
- innerRef = _ref.innerRef,
- children = _ref.children;
- var referenceNode = React.useContext(_Manager.ManagerReferenceNodeContext);
-
- var _React$useState = React.useState(null),
- popperElement = _React$useState[0],
- setPopperElement = _React$useState[1];
-
- var _React$useState2 = React.useState(null),
- arrowElement = _React$useState2[0],
- setArrowElement = _React$useState2[1];
-
- React.useEffect(function () {
- (0, _utils.setRef)(innerRef, popperElement);
- }, [innerRef, popperElement]);
- var options = React.useMemo(function () {
- return {
- placement: placement,
- strategy: strategy,
- onFirstUpdate: onFirstUpdate,
- modifiers: [].concat(modifiers, [{
- name: 'arrow',
- enabled: arrowElement != null,
- options: {
- element: arrowElement
- }
- }])
- };
- }, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
-
- var _usePopper = (0, _usePopper2.usePopper)(referenceElement || referenceNode, popperElement, options),
- state = _usePopper.state,
- styles = _usePopper.styles,
- forceUpdate = _usePopper.forceUpdate,
- update = _usePopper.update;
-
- var childrenProps = React.useMemo(function () {
- return {
- ref: setPopperElement,
- style: styles.popper,
- placement: state ? state.placement : placement,
- hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
- isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
- arrowProps: {
- style: styles.arrow,
- ref: setArrowElement
- },
- forceUpdate: forceUpdate || NOOP,
- update: update || NOOP_PROMISE
- };
- }, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
- return (0, _utils.unwrapArray)(children)(childrenProps);
-}
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/Popper.js.flow b/frontend/node_modules/react-popper/lib/cjs/Popper.js.flow
deleted file mode 100644
index c656e8389..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/Popper.js.flow
+++ /dev/null
@@ -1,124 +0,0 @@
-// @flow strict
-import * as React from 'react';
-import {
- type State,
- type Placement,
- type PositioningStrategy,
- type VirtualElement,
- type StrictModifiers,
- type Modifier,
-} from '@popperjs/core/lib';
-import { ManagerReferenceNodeContext } from './Manager';
-import type { Ref } from './RefTypes';
-import { unwrapArray, setRef } from './utils';
-import { usePopper } from './usePopper';
-
-type ReferenceElement = ?(VirtualElement | HTMLElement);
-type Modifiers = Array>>;
-
-export type PopperArrowProps = {|
- ref: Ref,
- style: CSSStyleDeclaration,
-|};
-export type PopperChildrenProps = {|
- ref: Ref,
- style: CSSStyleDeclaration,
-
- placement: Placement,
- isReferenceHidden: ?boolean,
- hasPopperEscaped: ?boolean,
-
- update: () => Promise>,
- forceUpdate: () => void,
- arrowProps: PopperArrowProps,
-|};
-export type PopperChildren = (PopperChildrenProps) => React.Node;
-
-export type PopperProps = $ReadOnly<{|
- children: PopperChildren,
- innerRef?: Ref,
- modifiers?: Modifiers,
- placement?: Placement,
- strategy?: PositioningStrategy,
- referenceElement?: ReferenceElement,
- onFirstUpdate?: ($Shape) => void,
-|}>;
-
-const NOOP = () => void 0;
-const NOOP_PROMISE = () => Promise.resolve(null);
-const EMPTY_MODIFIERS = [];
-
-export function Popper({
- placement = 'bottom',
- strategy = 'absolute',
- modifiers = EMPTY_MODIFIERS,
- referenceElement,
- onFirstUpdate,
- innerRef,
- children,
-}: PopperProps): React.Node {
- const referenceNode = React.useContext(ManagerReferenceNodeContext);
-
- const [popperElement, setPopperElement] = React.useState(null);
- const [arrowElement, setArrowElement] = React.useState(null);
-
- React.useEffect(() => {
- setRef(innerRef, popperElement)
- }, [innerRef, popperElement]);
-
- const options = React.useMemo(
- () => ({
- placement,
- strategy,
- onFirstUpdate,
- modifiers: [
- ...modifiers,
- {
- name: 'arrow',
- enabled: arrowElement != null,
- options: { element: arrowElement },
- },
- ],
- }),
- [placement, strategy, onFirstUpdate, modifiers, arrowElement]
- );
-
- const { state, styles, forceUpdate, update } = usePopper(
- referenceElement || referenceNode,
- popperElement,
- options
- );
-
- const childrenProps = React.useMemo(
- () => ({
- ref: setPopperElement,
- style: styles.popper,
- placement: state ? state.placement : placement,
- hasPopperEscaped:
- state && state.modifiersData.hide
- ? state.modifiersData.hide.hasPopperEscaped
- : null,
- isReferenceHidden:
- state && state.modifiersData.hide
- ? state.modifiersData.hide.isReferenceHidden
- : null,
- arrowProps: {
- style: styles.arrow,
- ref: setArrowElement,
- },
- forceUpdate: forceUpdate || NOOP,
- update: update || NOOP_PROMISE,
- }),
- [
- setPopperElement,
- setArrowElement,
- placement,
- state,
- styles,
- update,
- forceUpdate,
- ]
- );
-
- return unwrapArray(children)(childrenProps);
-}
diff --git a/frontend/node_modules/react-popper/lib/cjs/RefTypes.js b/frontend/node_modules/react-popper/lib/cjs/RefTypes.js
deleted file mode 100644
index 9a390c31f..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/RefTypes.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/RefTypes.js.flow b/frontend/node_modules/react-popper/lib/cjs/RefTypes.js.flow
deleted file mode 100644
index 1581a974c..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/RefTypes.js.flow
+++ /dev/null
@@ -1,5 +0,0 @@
-// @flow strict
-type RefHandler = (?HTMLElement) => void;
-type RefObject = { current?: ?HTMLElement};
-
-export type Ref = RefHandler | RefObject;
diff --git a/frontend/node_modules/react-popper/lib/cjs/Reference.js b/frontend/node_modules/react-popper/lib/cjs/Reference.js
deleted file mode 100644
index d4acb8f47..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/Reference.js
+++ /dev/null
@@ -1,43 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Reference = Reference;
-
-var React = _interopRequireWildcard(require("react"));
-
-var _warning = _interopRequireDefault(require("warning"));
-
-var _Manager = require("./Manager");
-
-var _utils = require("./utils");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
-function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-function Reference(_ref) {
- var children = _ref.children,
- innerRef = _ref.innerRef;
- var setReferenceNode = React.useContext(_Manager.ManagerReferenceNodeSetterContext);
- var refHandler = React.useCallback(function (node) {
- (0, _utils.setRef)(innerRef, node);
- (0, _utils.safeInvoke)(setReferenceNode, node);
- }, [innerRef, setReferenceNode]); // ran on unmount
- // eslint-disable-next-line react-hooks/exhaustive-deps
-
- React.useEffect(function () {
- return function () {
- return (0, _utils.setRef)(innerRef, null);
- };
- }, []);
- React.useEffect(function () {
- (0, _warning["default"])(Boolean(setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
- }, [setReferenceNode]);
- return (0, _utils.unwrapArray)(children)({
- ref: refHandler
- });
-}
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/Reference.js.flow b/frontend/node_modules/react-popper/lib/cjs/Reference.js.flow
deleted file mode 100644
index 81cd115f4..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/Reference.js.flow
+++ /dev/null
@@ -1,37 +0,0 @@
-// @flow strict
-import * as React from 'react';
-import warning from 'warning';
-import { ManagerReferenceNodeSetterContext } from './Manager';
-import { safeInvoke, unwrapArray, setRef } from './utils';
-import { type Ref } from './RefTypes';
-
-export type ReferenceChildrenProps = $ReadOnly<{ ref: Ref }>;
-export type ReferenceProps = $ReadOnly<{|
- children: (ReferenceChildrenProps) => React.Node,
- innerRef?: Ref,
-|}>;
-
-export function Reference({ children, innerRef }: ReferenceProps): React.Node {
- const setReferenceNode = React.useContext(ManagerReferenceNodeSetterContext);
-
- const refHandler = React.useCallback(
- (node: ?HTMLElement) => {
- setRef(innerRef, node);
- safeInvoke(setReferenceNode, node);
- },
- [innerRef, setReferenceNode]
- );
-
- // ran on unmount
- // eslint-disable-next-line react-hooks/exhaustive-deps
- React.useEffect(() => () => setRef(innerRef, null), []);
-
- React.useEffect(() => {
- warning(
- Boolean(setReferenceNode),
- '`Reference` should not be used outside of a `Manager` component.'
- );
- }, [setReferenceNode]);
-
- return unwrapArray(children)({ ref: refHandler });
-}
diff --git a/frontend/node_modules/react-popper/lib/cjs/__typings__/main-test.js b/frontend/node_modules/react-popper/lib/cjs/__typings__/main-test.js
deleted file mode 100644
index 58e22416f..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/__typings__/main-test.js
+++ /dev/null
@@ -1,69 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Test = void 0;
-
-var React = _interopRequireWildcard(require("react"));
-
-var _ = require("..");
-
-function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
-var Test = function Test() {
- var _React$createElement;
-
- return /*#__PURE__*/React.createElement(_.Manager, null, /*#__PURE__*/React.createElement(_.Reference, null), /*#__PURE__*/React.createElement(_.Reference, null, function (_ref) {
- var ref = _ref.ref;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref
- });
- }), /*#__PURE__*/React.createElement(_.Popper // $FlowExpectError: should be one of allowed placements
- , (_React$createElement = {
- placement: "custom"
- }, _React$createElement["placement"] = "top", _React$createElement.strategy = "custom", _React$createElement["strategy"] = "fixed", _React$createElement.modifiers = [{
- name: 'flip',
- enabled: 'bar',
- order: 'foo'
- }], _React$createElement["modifiers"] = [{
- name: 'flip',
- enabled: false
- }], _React$createElement), function (_ref2) {
- var ref = _ref2.ref,
- style = _ref2.style,
- placement = _ref2.placement,
- isReferenceHidden = _ref2.isReferenceHidden,
- hasPopperEscaped = _ref2.hasPopperEscaped,
- update = _ref2.update,
- arrowProps = _ref2.arrowProps;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref,
- style: _extends({}, style, {
- opacity: isReferenceHidden === true || hasPopperEscaped === true ? 0 : 1
- }),
- "data-placement": placement,
- onClick: function onClick() {
- return update();
- }
- }, "Popper", /*#__PURE__*/React.createElement("div", {
- ref: arrowProps.ref,
- style: arrowProps.style
- }));
- }), /*#__PURE__*/React.createElement(_.Popper, null, function (_ref3) {
- var ref = _ref3.ref,
- style = _ref3.style,
- placement = _ref3.placement;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref,
- style: style,
- "data-placement": placement
- }, "Popper");
- }));
-};
-
-exports.Test = Test;
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/index.js b/frontend/node_modules/react-popper/lib/cjs/index.js
deleted file mode 100644
index d1c09ba7a..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-Object.defineProperty(exports, "Popper", {
- enumerable: true,
- get: function get() {
- return _Popper.Popper;
- }
-});
-Object.defineProperty(exports, "Manager", {
- enumerable: true,
- get: function get() {
- return _Manager.Manager;
- }
-});
-Object.defineProperty(exports, "Reference", {
- enumerable: true,
- get: function get() {
- return _Reference.Reference;
- }
-});
-Object.defineProperty(exports, "usePopper", {
- enumerable: true,
- get: function get() {
- return _usePopper.usePopper;
- }
-});
-
-var _Popper = require("./Popper");
-
-var _Manager = require("./Manager");
-
-var _Reference = require("./Reference");
-
-var _usePopper = require("./usePopper");
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/index.js.flow b/frontend/node_modules/react-popper/lib/cjs/index.js.flow
deleted file mode 100644
index 1a51de8aa..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/index.js.flow
+++ /dev/null
@@ -1,25 +0,0 @@
-// @flow strict
-
-// Public components
-import { Popper } from './Popper';
-import { Manager } from './Manager';
-import { Reference } from './Reference';
-import { usePopper } from './usePopper';
-export { Popper, Manager, Reference, usePopper };
-
-// Public types
-import type { ManagerProps } from './Manager';
-import type { ReferenceProps, ReferenceChildrenProps } from './Reference';
-import type {
- PopperChildrenProps,
- PopperArrowProps,
- PopperProps,
-} from './Popper';
-export type {
- ManagerProps,
- ReferenceProps,
- ReferenceChildrenProps,
- PopperChildrenProps,
- PopperArrowProps,
- PopperProps,
-};
diff --git a/frontend/node_modules/react-popper/lib/cjs/usePopper.js b/frontend/node_modules/react-popper/lib/cjs/usePopper.js
deleted file mode 100644
index cf9a87d81..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/usePopper.js
+++ /dev/null
@@ -1,123 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.usePopper = void 0;
-
-var React = _interopRequireWildcard(require("react"));
-
-var ReactDOM = _interopRequireWildcard(require("react-dom"));
-
-var _core = require("@popperjs/core");
-
-var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
-
-var _utils = require("./utils");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
-function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-var EMPTY_MODIFIERS = [];
-
-var usePopper = function usePopper(referenceElement, popperElement, options) {
- if (options === void 0) {
- options = {};
- }
-
- var prevOptions = React.useRef(null);
- var optionsWithDefaults = {
- onFirstUpdate: options.onFirstUpdate,
- placement: options.placement || 'bottom',
- strategy: options.strategy || 'absolute',
- modifiers: options.modifiers || EMPTY_MODIFIERS
- };
-
- var _React$useState = React.useState({
- styles: {
- popper: {
- position: optionsWithDefaults.strategy,
- left: '0',
- top: '0'
- },
- arrow: {
- position: 'absolute'
- }
- },
- attributes: {}
- }),
- state = _React$useState[0],
- setState = _React$useState[1];
-
- var updateStateModifier = React.useMemo(function () {
- return {
- name: 'updateState',
- enabled: true,
- phase: 'write',
- fn: function fn(_ref) {
- var state = _ref.state;
- var elements = Object.keys(state.elements);
- ReactDOM.flushSync(function () {
- setState({
- styles: (0, _utils.fromEntries)(elements.map(function (element) {
- return [element, state.styles[element] || {}];
- })),
- attributes: (0, _utils.fromEntries)(elements.map(function (element) {
- return [element, state.attributes[element]];
- }))
- });
- });
- },
- requires: ['computeStyles']
- };
- }, []);
- var popperOptions = React.useMemo(function () {
- var newOptions = {
- onFirstUpdate: optionsWithDefaults.onFirstUpdate,
- placement: optionsWithDefaults.placement,
- strategy: optionsWithDefaults.strategy,
- modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
- name: 'applyStyles',
- enabled: false
- }])
- };
-
- if ((0, _reactFastCompare["default"])(prevOptions.current, newOptions)) {
- return prevOptions.current || newOptions;
- } else {
- prevOptions.current = newOptions;
- return newOptions;
- }
- }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
- var popperInstanceRef = React.useRef();
- (0, _utils.useIsomorphicLayoutEffect)(function () {
- if (popperInstanceRef.current) {
- popperInstanceRef.current.setOptions(popperOptions);
- }
- }, [popperOptions]);
- (0, _utils.useIsomorphicLayoutEffect)(function () {
- if (referenceElement == null || popperElement == null) {
- return;
- }
-
- var createPopper = options.createPopper || _core.createPopper;
- var popperInstance = createPopper(referenceElement, popperElement, popperOptions);
- popperInstanceRef.current = popperInstance;
- return function () {
- popperInstance.destroy();
- popperInstanceRef.current = null;
- };
- }, [referenceElement, popperElement, options.createPopper]);
- return {
- state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
- styles: state.styles,
- attributes: state.attributes,
- update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
- forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
- };
-};
-
-exports.usePopper = usePopper;
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/usePopper.js.flow b/frontend/node_modules/react-popper/lib/cjs/usePopper.js.flow
deleted file mode 100644
index ebc1291b6..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/usePopper.js.flow
+++ /dev/null
@@ -1,157 +0,0 @@
-// @flow strict
-import * as React from 'react';
-import * as ReactDOM from 'react-dom';
-import {
- createPopper as defaultCreatePopper,
- type Options as PopperOptions,
- type VirtualElement,
- type State as PopperState,
- type Instance as PopperInstance,
-} from '@popperjs/core';
-import isEqual from 'react-fast-compare';
-import { fromEntries, useIsomorphicLayoutEffect } from './utils';
-
-type Options = $Shape<{
- ...PopperOptions,
- createPopper: typeof defaultCreatePopper,
-}>;
-
-type Styles = {
- [key: string]: $Shape,
-};
-
-type Attributes = {
- [key: string]: { [key: string]: string },
-};
-
-type State = {
- styles: Styles,
- attributes: Attributes,
-};
-
-const EMPTY_MODIFIERS = [];
-
-type UsePopperResult = $ReadOnly<{
- state: ?PopperState,
- styles: Styles,
- attributes: Attributes,
- update: ?$PropertyType,
- forceUpdate: ?$PropertyType,
-}>;
-
-export const usePopper = (
- referenceElement: ?(Element | VirtualElement),
- popperElement: ?HTMLElement,
- options: Options = {}
-): UsePopperResult => {
- const prevOptions = React.useRef(null);
-
- const optionsWithDefaults = {
- onFirstUpdate: options.onFirstUpdate,
- placement: options.placement || 'bottom',
- strategy: options.strategy || 'absolute',
- modifiers: options.modifiers || EMPTY_MODIFIERS,
- };
-
- const [state, setState] = React.useState({
- styles: {
- popper: {
- position: optionsWithDefaults.strategy,
- left: '0',
- top: '0',
- },
- arrow: {
- position: 'absolute',
- },
- },
- attributes: {},
- });
-
- const updateStateModifier = React.useMemo(
- () => ({
- name: 'updateState',
- enabled: true,
- phase: 'write',
- fn: ({ state }) => {
- const elements = Object.keys(state.elements);
-
- ReactDOM.flushSync(() => {
- setState({
- styles: fromEntries(
- elements.map((element) => [element, state.styles[element] || {}])
- ),
- attributes: fromEntries(
- elements.map((element) => [element, state.attributes[element]])
- ),
- });
- });
- },
- requires: ['computeStyles'],
- }),
- []
- );
-
- const popperOptions = React.useMemo(() => {
- const newOptions = {
- onFirstUpdate: optionsWithDefaults.onFirstUpdate,
- placement: optionsWithDefaults.placement,
- strategy: optionsWithDefaults.strategy,
- modifiers: [
- ...optionsWithDefaults.modifiers,
- updateStateModifier,
- { name: 'applyStyles', enabled: false },
- ],
- };
-
- if (isEqual(prevOptions.current, newOptions)) {
- return prevOptions.current || newOptions;
- } else {
- prevOptions.current = newOptions;
- return newOptions;
- }
- }, [
- optionsWithDefaults.onFirstUpdate,
- optionsWithDefaults.placement,
- optionsWithDefaults.strategy,
- optionsWithDefaults.modifiers,
- updateStateModifier,
- ]);
-
- const popperInstanceRef = React.useRef();
-
- useIsomorphicLayoutEffect(() => {
- if (popperInstanceRef.current) {
- popperInstanceRef.current.setOptions(popperOptions);
- }
- }, [popperOptions]);
-
- useIsomorphicLayoutEffect(() => {
- if (referenceElement == null || popperElement == null) {
- return;
- }
-
- const createPopper = options.createPopper || defaultCreatePopper;
- const popperInstance = createPopper(
- referenceElement,
- popperElement,
- popperOptions
- );
-
- popperInstanceRef.current = popperInstance;
-
- return () => {
- popperInstance.destroy();
- popperInstanceRef.current = null;
- };
- }, [referenceElement, popperElement, options.createPopper]);
-
- return {
- state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
- styles: state.styles,
- attributes: state.attributes,
- update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
- forceUpdate: popperInstanceRef.current
- ? popperInstanceRef.current.forceUpdate
- : null,
- };
-};
diff --git a/frontend/node_modules/react-popper/lib/cjs/utils.js b/frontend/node_modules/react-popper/lib/cjs/utils.js
deleted file mode 100644
index 077e7ca45..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/utils.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.useIsomorphicLayoutEffect = exports.fromEntries = exports.setRef = exports.safeInvoke = exports.unwrapArray = void 0;
-
-var React = _interopRequireWildcard(require("react"));
-
-function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-/**
- * Takes an argument and if it's an array, returns the first item in the array,
- * otherwise returns the argument. Used for Preact compatibility.
- */
-var unwrapArray = function unwrapArray(arg) {
- return Array.isArray(arg) ? arg[0] : arg;
-};
-/**
- * Takes a maybe-undefined function and arbitrary args and invokes the function
- * only if it is defined.
- */
-
-
-exports.unwrapArray = unwrapArray;
-
-var safeInvoke = function safeInvoke(fn) {
- if (typeof fn === 'function') {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return fn.apply(void 0, args);
- }
-};
-/**
- * Sets a ref using either a ref callback or a ref object
- */
-
-
-exports.safeInvoke = safeInvoke;
-
-var setRef = function setRef(ref, node) {
- // if its a function call it
- if (typeof ref === 'function') {
- return safeInvoke(ref, node);
- } // otherwise we should treat it as a ref object
- else if (ref != null) {
- ref.current = node;
- }
-};
-/**
- * Simple ponyfill for Object.fromEntries
- */
-
-
-exports.setRef = setRef;
-
-var fromEntries = function fromEntries(entries) {
- return entries.reduce(function (acc, _ref) {
- var key = _ref[0],
- value = _ref[1];
- acc[key] = value;
- return acc;
- }, {});
-};
-/**
- * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
- */
-
-
-exports.fromEntries = fromEntries;
-var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
-exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/cjs/utils.js.flow b/frontend/node_modules/react-popper/lib/cjs/utils.js.flow
deleted file mode 100644
index d0757bbfa..000000000
--- a/frontend/node_modules/react-popper/lib/cjs/utils.js.flow
+++ /dev/null
@@ -1,59 +0,0 @@
-// @flow strict
-import * as React from 'react';
-import { type Ref } from './RefTypes';
-
-/**
- * Takes an argument and if it's an array, returns the first item in the array,
- * otherwise returns the argument. Used for Preact compatibility.
- */
-export const unwrapArray = (arg: *): * => (Array.isArray(arg) ? arg[0] : arg);
-
-/**
- * Takes a maybe-undefined function and arbitrary args and invokes the function
- * only if it is defined.
- */
-export const safeInvoke = (
- fn: ?F,
- ...args: Array
-): $Call => {
- if (typeof fn === 'function') {
- return fn(...args);
- }
-};
-
-/**
- * Sets a ref using either a ref callback or a ref object
- */
-export const setRef = (ref: ?Ref, node: ?HTMLElement): void => {
- // if its a function call it
- if (typeof ref === 'function') {
- return safeInvoke(ref, node);
- }
- // otherwise we should treat it as a ref object
- else if (ref != null) {
- ref.current = node;
- }
-};
-
-/**
- * Simple ponyfill for Object.fromEntries
- */
-export const fromEntries = (
- entries: Array<[string, any]>
-): { [key: string]: any } =>
- entries.reduce((acc, [key, value]) => {
- acc[key] = value;
- return acc;
- }, {});
-
-/**
- * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
- */
-export const useIsomorphicLayoutEffect:
- | typeof React.useEffect
- | typeof React.useLayoutEffect =
- typeof window !== 'undefined' &&
- window.document &&
- window.document.createElement
- ? React.useLayoutEffect
- : React.useEffect;
diff --git a/frontend/node_modules/react-popper/lib/esm/Manager.js b/frontend/node_modules/react-popper/lib/esm/Manager.js
deleted file mode 100644
index 5df2908ac..000000000
--- a/frontend/node_modules/react-popper/lib/esm/Manager.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as React from 'react';
-export var ManagerReferenceNodeContext = React.createContext();
-export var ManagerReferenceNodeSetterContext = React.createContext();
-export function Manager(_ref) {
- var children = _ref.children;
-
- var _React$useState = React.useState(null),
- referenceNode = _React$useState[0],
- setReferenceNode = _React$useState[1];
-
- var hasUnmounted = React.useRef(false);
- React.useEffect(function () {
- return function () {
- hasUnmounted.current = true;
- };
- }, []);
- var handleSetReferenceNode = React.useCallback(function (node) {
- if (!hasUnmounted.current) {
- setReferenceNode(node);
- }
- }, []);
- return /*#__PURE__*/React.createElement(ManagerReferenceNodeContext.Provider, {
- value: referenceNode
- }, /*#__PURE__*/React.createElement(ManagerReferenceNodeSetterContext.Provider, {
- value: handleSetReferenceNode
- }, children));
-}
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/Popper.js b/frontend/node_modules/react-popper/lib/esm/Popper.js
deleted file mode 100644
index e30fd910e..000000000
--- a/frontend/node_modules/react-popper/lib/esm/Popper.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import * as React from 'react';
-import { ManagerReferenceNodeContext } from './Manager';
-import { unwrapArray, setRef } from './utils';
-import { usePopper } from './usePopper';
-
-var NOOP = function NOOP() {
- return void 0;
-};
-
-var NOOP_PROMISE = function NOOP_PROMISE() {
- return Promise.resolve(null);
-};
-
-var EMPTY_MODIFIERS = [];
-export function Popper(_ref) {
- var _ref$placement = _ref.placement,
- placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
- _ref$strategy = _ref.strategy,
- strategy = _ref$strategy === void 0 ? 'absolute' : _ref$strategy,
- _ref$modifiers = _ref.modifiers,
- modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers,
- referenceElement = _ref.referenceElement,
- onFirstUpdate = _ref.onFirstUpdate,
- innerRef = _ref.innerRef,
- children = _ref.children;
- var referenceNode = React.useContext(ManagerReferenceNodeContext);
-
- var _React$useState = React.useState(null),
- popperElement = _React$useState[0],
- setPopperElement = _React$useState[1];
-
- var _React$useState2 = React.useState(null),
- arrowElement = _React$useState2[0],
- setArrowElement = _React$useState2[1];
-
- React.useEffect(function () {
- setRef(innerRef, popperElement);
- }, [innerRef, popperElement]);
- var options = React.useMemo(function () {
- return {
- placement: placement,
- strategy: strategy,
- onFirstUpdate: onFirstUpdate,
- modifiers: [].concat(modifiers, [{
- name: 'arrow',
- enabled: arrowElement != null,
- options: {
- element: arrowElement
- }
- }])
- };
- }, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
-
- var _usePopper = usePopper(referenceElement || referenceNode, popperElement, options),
- state = _usePopper.state,
- styles = _usePopper.styles,
- forceUpdate = _usePopper.forceUpdate,
- update = _usePopper.update;
-
- var childrenProps = React.useMemo(function () {
- return {
- ref: setPopperElement,
- style: styles.popper,
- placement: state ? state.placement : placement,
- hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
- isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
- arrowProps: {
- style: styles.arrow,
- ref: setArrowElement
- },
- forceUpdate: forceUpdate || NOOP,
- update: update || NOOP_PROMISE
- };
- }, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
- return unwrapArray(children)(childrenProps);
-}
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/RefTypes.js b/frontend/node_modules/react-popper/lib/esm/RefTypes.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/frontend/node_modules/react-popper/lib/esm/Reference.js b/frontend/node_modules/react-popper/lib/esm/Reference.js
deleted file mode 100644
index 9c5563cea..000000000
--- a/frontend/node_modules/react-popper/lib/esm/Reference.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import * as React from 'react';
-import warning from 'warning';
-import { ManagerReferenceNodeSetterContext } from './Manager';
-import { safeInvoke, unwrapArray, setRef } from './utils';
-export function Reference(_ref) {
- var children = _ref.children,
- innerRef = _ref.innerRef;
- var setReferenceNode = React.useContext(ManagerReferenceNodeSetterContext);
- var refHandler = React.useCallback(function (node) {
- setRef(innerRef, node);
- safeInvoke(setReferenceNode, node);
- }, [innerRef, setReferenceNode]); // ran on unmount
- // eslint-disable-next-line react-hooks/exhaustive-deps
-
- React.useEffect(function () {
- return function () {
- return setRef(innerRef, null);
- };
- }, []);
- React.useEffect(function () {
- warning(Boolean(setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
- }, [setReferenceNode]);
- return unwrapArray(children)({
- ref: refHandler
- });
-}
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/__typings__/main-test.js b/frontend/node_modules/react-popper/lib/esm/__typings__/main-test.js
deleted file mode 100644
index afe07ae06..000000000
--- a/frontend/node_modules/react-popper/lib/esm/__typings__/main-test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
-// Please remember to update also the TypeScript test files that can
-// be found under `/typings/tests` please. Thanks! 🤗
-import * as React from 'react';
-import { Manager, Reference, Popper } from '..';
-export var Test = function Test() {
- var _React$createElement;
-
- return /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null), /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
- var ref = _ref.ref;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref
- });
- }), /*#__PURE__*/React.createElement(Popper // $FlowExpectError: should be one of allowed placements
- , (_React$createElement = {
- placement: "custom"
- }, _React$createElement["placement"] = "top", _React$createElement.strategy = "custom", _React$createElement["strategy"] = "fixed", _React$createElement.modifiers = [{
- name: 'flip',
- enabled: 'bar',
- order: 'foo'
- }], _React$createElement["modifiers"] = [{
- name: 'flip',
- enabled: false
- }], _React$createElement), function (_ref2) {
- var ref = _ref2.ref,
- style = _ref2.style,
- placement = _ref2.placement,
- isReferenceHidden = _ref2.isReferenceHidden,
- hasPopperEscaped = _ref2.hasPopperEscaped,
- update = _ref2.update,
- arrowProps = _ref2.arrowProps;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref,
- style: _extends({}, style, {
- opacity: isReferenceHidden === true || hasPopperEscaped === true ? 0 : 1
- }),
- "data-placement": placement,
- onClick: function onClick() {
- return update();
- }
- }, "Popper", /*#__PURE__*/React.createElement("div", {
- ref: arrowProps.ref,
- style: arrowProps.style
- }));
- }), /*#__PURE__*/React.createElement(Popper, null, function (_ref3) {
- var ref = _ref3.ref,
- style = _ref3.style,
- placement = _ref3.placement;
- return /*#__PURE__*/React.createElement("div", {
- ref: ref,
- style: style,
- "data-placement": placement
- }, "Popper");
- }));
-};
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/index.js b/frontend/node_modules/react-popper/lib/esm/index.js
deleted file mode 100644
index 11b44e252..000000000
--- a/frontend/node_modules/react-popper/lib/esm/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Public components
-import { Popper } from './Popper';
-import { Manager } from './Manager';
-import { Reference } from './Reference';
-import { usePopper } from './usePopper';
-export { Popper, Manager, Reference, usePopper }; // Public types
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/usePopper.js b/frontend/node_modules/react-popper/lib/esm/usePopper.js
deleted file mode 100644
index eee24ea23..000000000
--- a/frontend/node_modules/react-popper/lib/esm/usePopper.js
+++ /dev/null
@@ -1,102 +0,0 @@
-import * as React from 'react';
-import * as ReactDOM from 'react-dom';
-import { createPopper as defaultCreatePopper } from '@popperjs/core';
-import isEqual from 'react-fast-compare';
-import { fromEntries, useIsomorphicLayoutEffect } from './utils';
-var EMPTY_MODIFIERS = [];
-export var usePopper = function usePopper(referenceElement, popperElement, options) {
- if (options === void 0) {
- options = {};
- }
-
- var prevOptions = React.useRef(null);
- var optionsWithDefaults = {
- onFirstUpdate: options.onFirstUpdate,
- placement: options.placement || 'bottom',
- strategy: options.strategy || 'absolute',
- modifiers: options.modifiers || EMPTY_MODIFIERS
- };
-
- var _React$useState = React.useState({
- styles: {
- popper: {
- position: optionsWithDefaults.strategy,
- left: '0',
- top: '0'
- },
- arrow: {
- position: 'absolute'
- }
- },
- attributes: {}
- }),
- state = _React$useState[0],
- setState = _React$useState[1];
-
- var updateStateModifier = React.useMemo(function () {
- return {
- name: 'updateState',
- enabled: true,
- phase: 'write',
- fn: function fn(_ref) {
- var state = _ref.state;
- var elements = Object.keys(state.elements);
- ReactDOM.flushSync(function () {
- setState({
- styles: fromEntries(elements.map(function (element) {
- return [element, state.styles[element] || {}];
- })),
- attributes: fromEntries(elements.map(function (element) {
- return [element, state.attributes[element]];
- }))
- });
- });
- },
- requires: ['computeStyles']
- };
- }, []);
- var popperOptions = React.useMemo(function () {
- var newOptions = {
- onFirstUpdate: optionsWithDefaults.onFirstUpdate,
- placement: optionsWithDefaults.placement,
- strategy: optionsWithDefaults.strategy,
- modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
- name: 'applyStyles',
- enabled: false
- }])
- };
-
- if (isEqual(prevOptions.current, newOptions)) {
- return prevOptions.current || newOptions;
- } else {
- prevOptions.current = newOptions;
- return newOptions;
- }
- }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
- var popperInstanceRef = React.useRef();
- useIsomorphicLayoutEffect(function () {
- if (popperInstanceRef.current) {
- popperInstanceRef.current.setOptions(popperOptions);
- }
- }, [popperOptions]);
- useIsomorphicLayoutEffect(function () {
- if (referenceElement == null || popperElement == null) {
- return;
- }
-
- var createPopper = options.createPopper || defaultCreatePopper;
- var popperInstance = createPopper(referenceElement, popperElement, popperOptions);
- popperInstanceRef.current = popperInstance;
- return function () {
- popperInstance.destroy();
- popperInstanceRef.current = null;
- };
- }, [referenceElement, popperElement, options.createPopper]);
- return {
- state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
- styles: state.styles,
- attributes: state.attributes,
- update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
- forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
- };
-};
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/lib/esm/utils.js b/frontend/node_modules/react-popper/lib/esm/utils.js
deleted file mode 100644
index e0807cb07..000000000
--- a/frontend/node_modules/react-popper/lib/esm/utils.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import * as React from 'react';
-
-/**
- * Takes an argument and if it's an array, returns the first item in the array,
- * otherwise returns the argument. Used for Preact compatibility.
- */
-export var unwrapArray = function unwrapArray(arg) {
- return Array.isArray(arg) ? arg[0] : arg;
-};
-/**
- * Takes a maybe-undefined function and arbitrary args and invokes the function
- * only if it is defined.
- */
-
-export var safeInvoke = function safeInvoke(fn) {
- if (typeof fn === 'function') {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return fn.apply(void 0, args);
- }
-};
-/**
- * Sets a ref using either a ref callback or a ref object
- */
-
-export var setRef = function setRef(ref, node) {
- // if its a function call it
- if (typeof ref === 'function') {
- return safeInvoke(ref, node);
- } // otherwise we should treat it as a ref object
- else if (ref != null) {
- ref.current = node;
- }
-};
-/**
- * Simple ponyfill for Object.fromEntries
- */
-
-export var fromEntries = function fromEntries(entries) {
- return entries.reduce(function (acc, _ref) {
- var key = _ref[0],
- value = _ref[1];
- acc[key] = value;
- return acc;
- }, {});
-};
-/**
- * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
- */
-
-export var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
\ No newline at end of file
diff --git a/frontend/node_modules/react-popper/package.json b/frontend/node_modules/react-popper/package.json
deleted file mode 100644
index 8ff062018..000000000
--- a/frontend/node_modules/react-popper/package.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "name": "react-popper",
- "version": "2.3.0",
- "description": "Official library to use Popper on React projects",
- "license": "MIT",
- "author": "Travis Arnold (http://souporserious.com)",
- "contributors": [
- "Federico Zivolo (https://fezvrasta.github.io)"
- ],
- "homepage": "https://popper.js.org/react-popper",
- "main": "lib/cjs/index.js",
- "module": "lib/esm/index.js",
- "typings": "typings/react-popper.d.ts",
- "sideEffects": false,
- "files": [
- "/dist",
- "/lib",
- "/typings/react-popper.d.ts"
- ],
- "scripts": {
- "build": "yarn build:clean && yarn build:esm && yarn build:cjs && yarn build:umd && yarn build:flow",
- "build:clean": "rimraf dist/ && rimraf lib/",
- "build:umd": "rollup -c && rimraf dist/index.esm.js",
- "build:esm": "cross-env BABEL_ENV=esm babel src --out-dir lib/esm",
- "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib/cjs",
- "build:flow": "flow-copy-source --ignore '{__typings__/*,*.test}.js' src lib/cjs",
- "demo:dev": "parcel --out-dir demo/dist demo/index.html",
- "demo:build": "parcel build --out-dir demo/dist demo/index.html --public-url=/react-popper",
- "demo:deploy": "yarn demo:build && gh-pages -d demo/dist",
- "test": "yarn test:eslint && yarn test:flow && yarn test:ts && yarn test:jest",
- "test:ts": "tsc --project ./typings/tests",
- "test:flow": "flow check",
- "test:jest": "jest",
- "test:eslint": "eslint src",
- "prepare": "yarn build",
- "precommit": "pretty-quick --staged && test",
- "prepublishOnly": "git-branch-is master"
- },
- "jest": {
- "setupFilesAfterEnv": [
- "jest.setup.js"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/popperjs/react-popper"
- },
- "bugs": {
- "url": "https://github.com/popperjs/react-popper/issues"
- },
- "keywords": [
- "react",
- "react-popper",
- "popperjs",
- "component",
- "drop",
- "tooltip",
- "popover"
- ],
- "peerDependencies": {
- "@popperjs/core": "^2.0.0",
- "react": "^16.8.0 || ^17 || ^18",
- "react-dom": "^16.8.0 || ^17 || ^18"
- },
- "dependencies": {
- "react-fast-compare": "^3.0.1",
- "warning": "^4.0.2"
- },
- "devDependencies": {
- "@atomico/rollup-plugin-sizes": "^1.1.3",
- "@babel/cli": "^7.8.4",
- "@babel/core": "^7.9.0",
- "@babel/plugin-transform-modules-commonjs": "^7.9.0",
- "@babel/polyfill": "^7.8.7",
- "@babel/preset-env": "^7.9.0",
- "@babel/preset-flow": "^7.9.0",
- "@babel/preset-react": "^7.9.4",
- "@emotion/core": "^10.0.28",
- "@emotion/styled": "^10.0.27",
- "@popperjs/core": "^2.3.3",
- "@rollup/plugin-commonjs": "^11.0.2",
- "@rollup/plugin-node-resolve": "^7.1.1",
- "@rollup/plugin-replace": "^2.3.1",
- "@testing-library/react": "^13.1.1",
- "@testing-library/react-hooks": "^8.0.0",
- "@types/react": "^16.9.29",
- "babel-eslint": "^10.1.0",
- "babel-jest": "^25.2.4",
- "cross-env": "^7.0.2",
- "eslint": "^6.8.0",
- "eslint-config-prettier": "^6.10.1",
- "eslint-plugin-flowtype": "^4.7.0",
- "eslint-plugin-jest": "^23.8.2",
- "eslint-plugin-promise": "^4.2.1",
- "eslint-plugin-react": "^7.19.0",
- "eslint-plugin-react-hooks": "^3.0.0",
- "flow-bin": "^0.176.2",
- "flow-copy-source": "^2.0.9",
- "gh-pages": "^2.2.0",
- "git-branch-is": "^3.1.0",
- "jest": "^25.2.4",
- "parcel-bundler": "^1.12.4",
- "prettier": "^2.0.2",
- "pretty-quick": "^2.0.1",
- "react": "18.0.0",
- "react-dom": "^18.0.0",
- "react-spring": "^8.0.27",
- "react-test-renderer": "^18.0.0",
- "rimraf": "^3.0.2",
- "rollup": "^2.3.1",
- "rollup-plugin-babel": "^4.4.0",
- "rollup-plugin-terser": "^5.3.0",
- "typescript": "^3.8.3"
- }
-}
diff --git a/frontend/node_modules/react-popper/typings/react-popper.d.ts b/frontend/node_modules/react-popper/typings/react-popper.d.ts
deleted file mode 100644
index 34d8f8252..000000000
--- a/frontend/node_modules/react-popper/typings/react-popper.d.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import * as PopperJS from '@popperjs/core';
-import * as React from 'react';
-
-// Utility type
-type UnionWhere = U extends M ? U : never;
-
-interface ManagerProps {
- children: React.ReactNode;
-}
-export class Manager extends React.Component {}
-
-export type RefHandler = (ref: HTMLElement | null) => void;
-
-interface ReferenceChildrenProps {
- // React refs are supposed to be contravariant (allows a more general type to be passed rather than a more specific one)
- // However, Typescript currently can't infer that fact for refs
- // See https://github.com/microsoft/TypeScript/issues/30748 for more information
- ref: React.Ref;
-}
-
-interface ReferenceProps {
- children: (props: ReferenceChildrenProps) => React.ReactNode;
- innerRef?: React.Ref;
-}
-export class Reference extends React.Component {}
-
-export interface PopperArrowProps {
- ref: React.Ref;
- style: React.CSSProperties;
-}
-
-export interface PopperChildrenProps {
- ref: React.Ref;
- style: React.CSSProperties;
-
- placement: PopperJS.Placement;
- isReferenceHidden?: boolean;
- hasPopperEscaped?: boolean;
-
- update: () => Promise>;
- forceUpdate: () => Partial;
- arrowProps: PopperArrowProps;
-}
-
-type StrictModifierNames = NonNullable;
-
-export type StrictModifier<
- Name extends StrictModifierNames = StrictModifierNames
-> = UnionWhere;
-
-export type Modifier<
- Name,
- Options extends object = object
-> = Name extends StrictModifierNames
- ? StrictModifier
- : Partial>;
-
-export interface PopperProps {
- children: (props: PopperChildrenProps) => React.ReactNode;
- innerRef?: React.Ref;
- modifiers?: ReadonlyArray>;
- placement?: PopperJS.Placement;
- strategy?: PopperJS.PositioningStrategy;
- referenceElement?: HTMLElement | PopperJS.VirtualElement;
- onFirstUpdate?: (state: Partial) => void;
-}
-export class Popper extends React.Component<
- PopperProps,
- {}
-> {}
-
-export function usePopper(
- referenceElement?: Element | PopperJS.VirtualElement | null,
- popperElement?: HTMLElement | null,
- options?: Omit, 'modifiers'> & {
- createPopper?: typeof PopperJS.createPopper;
- modifiers?: ReadonlyArray>;
- }
-): {
- styles: { [key: string]: React.CSSProperties };
- attributes: { [key: string]: { [key: string]: string } | undefined };
- state: PopperJS.State | null;
- update: PopperJS.Instance['update'] | null;
- forceUpdate: PopperJS.Instance['forceUpdate'] | null;
-};
diff --git a/frontend/node_modules/react-router-dom/README.md b/frontend/node_modules/react-router-dom/README.md
deleted file mode 100644
index f826f7d25..000000000
--- a/frontend/node_modules/react-router-dom/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# react-router-dom
-
-DOM bindings for [React Router](https://reactrouter.com).
-
-## Installation
-
-Using [npm](https://www.npmjs.com/):
-
- $ npm install --save react-router-dom
-
-Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
-
-```js
-// using ES6 modules
-import { BrowserRouter, Route, Link } from "react-router-dom";
-
-// using CommonJS modules
-const BrowserRouter = require("react-router-dom").BrowserRouter;
-const Route = require("react-router-dom").Route;
-const Link = require("react-router-dom").Link;
-```
-
-The UMD build is also available on [unpkg](https://unpkg.com):
-
-```html
-
-```
-
-You can find the library on `window.ReactRouterDOM`.
-
-## Issues
-
-If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/remix-run/react-router/issues).
-
-## Credits
-
-React Router is built and maintained by [Remix Software](https://remix.run).
diff --git a/frontend/node_modules/react-router-dom/package.json b/frontend/node_modules/react-router-dom/package.json
deleted file mode 100644
index fc068cac5..000000000
--- a/frontend/node_modules/react-router-dom/package.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "react-router-dom",
- "version": "5.3.4",
- "description": "DOM bindings for React Router",
- "homepage": "https://reactrouter.com/",
- "repository": {
- "url": "https://github.com/remix-run/react-router.git",
- "type": "git",
- "directory": "packages/react-router-dom"
- },
- "license": "MIT",
- "author": "Remix Software ",
- "files": [
- "LICENSE",
- "README.md",
- "BrowserRouter.js",
- "HashRouter.js",
- "Link.js",
- "MemoryRouter.js",
- "NavLink.js",
- "Prompt.js",
- "Redirect.js",
- "Route.js",
- "Router.js",
- "StaticRouter.js",
- "Switch.js",
- "cjs",
- "es",
- "esm",
- "index.js",
- "generatePath.js",
- "matchPath.js",
- "modules/*.js",
- "modules/utils/*.js",
- "withRouter.js",
- "warnAboutDeprecatedCJSRequire.js",
- "umd"
- ],
- "main": "index.js",
- "module": "esm/react-router-dom.js",
- "sideEffects": false,
- "scripts": {
- "build": "rollup -c",
- "lint": "eslint modules"
- },
- "peerDependencies": {
- "react": ">=15"
- },
- "dependencies": {
- "@babel/runtime": "^7.12.13",
- "history": "^4.9.0",
- "loose-envify": "^1.3.1",
- "prop-types": "^15.6.2",
- "react-router": "5.3.4",
- "tiny-invariant": "^1.0.2",
- "tiny-warning": "^1.0.0"
- },
- "browserify": {
- "transform": [
- "loose-envify"
- ]
- },
- "keywords": [
- "react",
- "router",
- "route",
- "routing",
- "history",
- "link"
- ]
-}
diff --git a/frontend/node_modules/react-router/README.md b/frontend/node_modules/react-router/README.md
deleted file mode 100644
index 22d96a5e4..000000000
--- a/frontend/node_modules/react-router/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# react-router
-
-Declarative routing for [React](https://facebook.github.io/react).
-
-## Installation
-
-Using [npm](https://www.npmjs.com/):
-
- $ npm install --save react-router
-
-**Note:** This package provides the core routing functionality for React Router, but you might not want to install it directly. If you are writing an application that will run in the browser, you should instead install `react-router-dom`. Similarly, if you are writing a React Native application, you should instead install `react-router-native`. Both of those will install `react-router` as a dependency.
-
-Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
-
-```js
-// using ES6 modules
-import { Router, Route, Switch } from "react-router";
-
-// using CommonJS modules
-var Router = require("react-router").Router;
-var Route = require("react-router").Route;
-var Switch = require("react-router").Switch;
-```
-
-The UMD build is also available on [unpkg](https://unpkg.com):
-
-```html
-
-```
-
-You can find the library on `window.ReactRouter`.
-
-## Issues
-
-If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/remix-run/react-router/issues).
-
-## Credits
-
-React Router is built and maintained by [Remix Software](https://remix.run).
diff --git a/frontend/node_modules/react-router/package.json b/frontend/node_modules/react-router/package.json
deleted file mode 100644
index 8ff35c656..000000000
--- a/frontend/node_modules/react-router/package.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "name": "react-router",
- "version": "5.3.4",
- "description": "Declarative routing for React",
- "homepage": "https://reactrouter.com/",
- "repository": {
- "url": "https://github.com/remix-run/react-router.git",
- "type": "git",
- "directory": "packages/react-router"
- },
- "license": "MIT",
- "author": "Remix Software ",
- "files": [
- "LICENSE",
- "README.md",
- "MemoryRouter.js",
- "Prompt.js",
- "Redirect.js",
- "Route.js",
- "Router.js",
- "StaticRouter.js",
- "Switch.js",
- "cjs",
- "es",
- "esm",
- "index.js",
- "generatePath.js",
- "matchPath.js",
- "modules/*.js",
- "modules/utils/*.js",
- "withRouter.js",
- "warnAboutDeprecatedCJSRequire.js",
- "umd"
- ],
- "main": "index.js",
- "module": "esm/react-router.js",
- "sideEffects": false,
- "scripts": {
- "build": "rollup -c",
- "lint": "eslint modules"
- },
- "peerDependencies": {
- "react": ">=15"
- },
- "dependencies": {
- "@babel/runtime": "^7.12.13",
- "history": "^4.9.0",
- "hoist-non-react-statics": "^3.1.0",
- "loose-envify": "^1.3.1",
- "path-to-regexp": "^1.7.0",
- "prop-types": "^15.6.2",
- "react-is": "^16.6.0",
- "tiny-invariant": "^1.0.2",
- "tiny-warning": "^1.0.0"
- },
- "browserify": {
- "transform": [
- "loose-envify"
- ]
- },
- "keywords": [
- "react",
- "router",
- "route",
- "routing",
- "history",
- "link"
- ]
-}
diff --git a/frontend/node_modules/react-select/README.md b/frontend/node_modules/react-select/README.md
deleted file mode 100644
index 8be7399af..000000000
--- a/frontend/node_modules/react-select/README.md
+++ /dev/null
@@ -1,168 +0,0 @@
-[](https://www.npmjs.com/package/react-select)
-[](https://circleci.com/gh/JedWatson/react-select/tree/master)
-[](https://coveralls.io/github/JedWatson/react-select?branch=master)
-[](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select)
-
-# React-Select
-
-The Select control for [React](https://reactjs.com). Initially built for use in [KeystoneJS](http://www.keystonejs.com).
-
-See [react-select.com](https://www.react-select.com) for live demos and comprehensive docs.
-
-React Select is funded by [Thinkmill](https://www.thinkmill.com.au) and [Atlassian](https://atlaskit.atlassian.com). It represents a whole new approach to developing powerful React.js components that _just work_ out of the box, while being extremely customisable.
-
-For the story behind this component, watch Jed's talk at React Conf 2019 - [building React Select](https://youtu.be/yS0jUnmBujE)
-
-Features include:
-
-- Flexible approach to data, with customisable functions
-- Extensible styling API with [emotion](https://emotion.sh)
-- Component Injection API for complete control over the UI behaviour
-- Controllable state props and modular architecture
-- Long-requested features like option groups, portal support, animation, and more
-
-## Using an older version?
-
-- [v3, v4, and v5 upgrade guide](https://react-select.com/upgrade)
-- [v2 upgrade guide](https://react-select.com/upgrade-to-v2)
-- React Select v1 documentation and examples are available at [v1.react-select.com](https://v1.react-select.com)
-
-# Installation and usage
-
-The easiest way to use react-select is to install it from npm and build it into your app with Webpack.
-
-```
-yarn add react-select
-```
-
-Then use it in your app:
-
-#### With React Component
-
-```js
-import React from 'react';
-import Select from 'react-select';
-
-const options = [
- { value: 'chocolate', label: 'Chocolate' },
- { value: 'strawberry', label: 'Strawberry' },
- { value: 'vanilla', label: 'Vanilla' },
-];
-
-class App extends React.Component {
- state = {
- selectedOption: null,
- };
- handleChange = (selectedOption) => {
- this.setState({ selectedOption }, () =>
- console.log(`Option selected:`, this.state.selectedOption)
- );
- };
- render() {
- const { selectedOption } = this.state;
-
- return (
-
- );
- }
-}
-```
-
-#### With React Hooks
-
-```js
-import React, { useState } from 'react';
-import Select from 'react-select';
-
-const options = [
- { value: 'chocolate', label: 'Chocolate' },
- { value: 'strawberry', label: 'Strawberry' },
- { value: 'vanilla', label: 'Vanilla' },
-];
-
-export default function App() {
- const [selectedOption, setSelectedOption] = useState(null);
-
- return (
-
-
-
- );
-}
-```
-
-## Props
-
-Common props you may want to specify include:
-
-- `autoFocus` - focus the control when it mounts
-- `className` - apply a className to the control
-- `classNamePrefix` - apply classNames to inner elements with the given prefix
-- `isDisabled` - disable the control
-- `isMulti` - allow the user to select multiple values
-- `isSearchable` - allow the user to search for matching options
-- `name` - generate an HTML input with this name, containing the current value
-- `onChange` - subscribe to change events
-- `options` - specify the options the user can select from
-- `placeholder` - change the text displayed when no option is selected
-- `noOptionsMessage` - ({ inputValue: string }) => string | null - Text to display when there are no options
-- `value` - control the current value
-
-See the [props documentation](https://www.react-select.com/props) for complete documentation on the props react-select supports.
-
-## Controllable Props
-
-You can control the following props by providing values for them. If you don't, react-select will manage them for you.
-
-- `value` / `onChange` - specify the current value of the control
-- `menuIsOpen` / `onMenuOpen` / `onMenuClose` - control whether the menu is open
-- `inputValue` / `onInputChange` - control the value of the search input (changing this will update the available options)
-
-If you don't provide these props, you can set the initial value of the state they control:
-
-- `defaultValue` - set the initial value of the control
-- `defaultMenuIsOpen` - set the initial open value of the menu
-- `defaultInputValue` - set the initial value of the search input
-
-## Methods
-
-React-select exposes two public methods:
-
-- `focus()` - focus the control programmatically
-- `blur()` - blur the control programmatically
-
-## Customisation
-
-Check the docs for more information on:
-
-- [Customising the styles](https://www.react-select.com/styles)
-- [Using custom components](https://www.react-select.com/components)
-- [Using the built-in animated components](https://www.react-select.com/home#animated-components)
-- [Creating an async select](https://www.react-select.com/async)
-- [Allowing users to create new options](https://www.react-select.com/creatable)
-- [Advanced use-cases](https://www.react-select.com/advanced)
-- [TypeScript guide](https://www.react-select.com/typescript)
-
-## TypeScript
-
-The v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at [@types](https://www.npmjs.com/package/@types/react-select). See the [TypeScript guide](https://www.react-select.com/typescript) for how to use the types starting with v5.
-
-# Thanks
-
-Thank you to everyone who has contributed to this project. It's been a wild ride.
-
-If you like React Select, you should [follow me on twitter](https://twitter.com/jedwatson)!
-
-Shout out to [Joss Mackison](https://github.com/jossmac), [Charles Lee](https://github.com/gwyneplaine), [Ben Conolly](https://github.com/Noviny), [Tom Walker](https://github.com/bladey), [Nathan Bierema](https://github.com/Methuselah96), [Eric Bonow](https://github.com/ebonow), [Mitchell Hamilton](https://github.com/mitchellhamilton), [Dave Brotherstone](https://github.com/bruderstein), [Brian Vaughn](https://github.com/bvaughn), and the [Atlassian Design System](https://atlassian.design) team who along with many other contributors have made this possible ❤️
-
-## License
-
-MIT Licensed. Copyright (c) Jed Watson 2022.
diff --git a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.d.ts b/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.d.ts
deleted file mode 100644
index c599881d3..000000000
--- a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "../../dist/declarations/src/animated/index";
-export { default } from "../../dist/declarations/src/animated/index";
diff --git a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.dev.js b/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.dev.js
deleted file mode 100644
index 672fd57c6..000000000
--- a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.dev.js
+++ /dev/null
@@ -1,325 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
-var memoizeOne = require('memoize-one');
-var index$1 = require('../../dist/index-5b950e59.cjs.dev.js');
-var React = require('react');
-var _extends = require('@babel/runtime/helpers/extends');
-var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
-var reactTransitionGroup = require('react-transition-group');
-require('@emotion/react');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-
-function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var memoizeOne__default = /*#__PURE__*/_interopDefault(memoizeOne);
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var _excluded$4 = ["in", "onExited", "appear", "enter", "exit"];
-// strip transition props off before spreading onto select component
-var AnimatedInput = function AnimatedInput(WrappedComponent) {
- return function (_ref) {
- _ref.in;
- _ref.onExited;
- _ref.appear;
- _ref.enter;
- _ref.exit;
- var props = _objectWithoutProperties(_ref, _excluded$4);
- return /*#__PURE__*/React__namespace.createElement(WrappedComponent, props);
- };
-};
-
-var _excluded$3 = ["component", "duration", "in", "onExited"];
-var Fade = function Fade(_ref) {
- var Tag = _ref.component,
- _ref$duration = _ref.duration,
- duration = _ref$duration === void 0 ? 1 : _ref$duration,
- inProp = _ref.in;
- _ref.onExited;
- var props = _objectWithoutProperties(_ref, _excluded$3);
- var nodeRef = React.useRef(null);
- var transition = {
- entering: {
- opacity: 0
- },
- entered: {
- opacity: 1,
- transition: "opacity ".concat(duration, "ms")
- },
- exiting: {
- opacity: 0
- },
- exited: {
- opacity: 0
- }
- };
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.Transition, {
- mountOnEnter: true,
- unmountOnExit: true,
- in: inProp,
- timeout: duration,
- nodeRef: nodeRef
- }, function (state) {
- var innerProps = {
- style: _objectSpread({}, transition[state]),
- ref: nodeRef
- };
- return /*#__PURE__*/React__namespace.createElement(Tag, _extends({
- innerProps: innerProps
- }, props));
- });
-};
-
-// ==============================
-// Collapse Transition
-// ==============================
-
-var collapseDuration = 260;
-// wrap each MultiValue with a collapse transition; decreases width until
-// finally removing from DOM
-var Collapse = function Collapse(_ref2) {
- var children = _ref2.children,
- _in = _ref2.in,
- _onExited = _ref2.onExited;
- var ref = React.useRef(null);
- var _useState = React.useState('auto'),
- _useState2 = _slicedToArray(_useState, 2),
- width = _useState2[0],
- setWidth = _useState2[1];
- React.useEffect(function () {
- var el = ref.current;
- if (!el) return;
-
- /*
- Here we're invoking requestAnimationFrame with a callback invoking our
- call to getBoundingClientRect and setState in order to resolve an edge case
- around portalling. Certain portalling solutions briefly remove children from the DOM
- before appending them to the target node. This is to avoid us trying to call getBoundingClientrect
- while the Select component is in this state.
- */
- // cannot use `offsetWidth` because it is rounded
- var rafId = window.requestAnimationFrame(function () {
- return setWidth(el.getBoundingClientRect().width);
- });
- return function () {
- return window.cancelAnimationFrame(rafId);
- };
- }, []);
- var getStyleFromStatus = function getStyleFromStatus(status) {
- switch (status) {
- default:
- return {
- width: width
- };
- case 'exiting':
- return {
- width: 0,
- transition: "width ".concat(collapseDuration, "ms ease-out")
- };
- case 'exited':
- return {
- width: 0
- };
- }
- };
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.Transition, {
- enter: false,
- mountOnEnter: true,
- unmountOnExit: true,
- in: _in,
- onExited: function onExited() {
- var el = ref.current;
- if (!el) return;
- _onExited === null || _onExited === void 0 ? void 0 : _onExited(el);
- },
- timeout: collapseDuration,
- nodeRef: ref
- }, function (status) {
- return /*#__PURE__*/React__namespace.createElement("div", {
- ref: ref,
- style: _objectSpread({
- overflow: 'hidden',
- whiteSpace: 'nowrap'
- }, getStyleFromStatus(status))
- }, children);
- });
-};
-
-var _excluded$2 = ["in", "onExited"];
-// strip transition props off before spreading onto actual component
-
-var AnimatedMultiValue = function AnimatedMultiValue(WrappedComponent) {
- return function (_ref) {
- var inProp = _ref.in,
- onExited = _ref.onExited,
- props = _objectWithoutProperties(_ref, _excluded$2);
- return /*#__PURE__*/React__namespace.createElement(Collapse, {
- in: inProp,
- onExited: onExited
- }, /*#__PURE__*/React__namespace.createElement(WrappedComponent, _extends({
- cropWithEllipsis: inProp
- }, props)));
- };
-};
-
-// fade in when last multi-value removed, otherwise instant
-var AnimatedPlaceholder = function AnimatedPlaceholder(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React__namespace.createElement(Fade, _extends({
- component: WrappedComponent,
- duration: props.isMulti ? collapseDuration : 1
- }, props));
- };
-};
-
-// instant fade; all transition-group children must be transitions
-
-var AnimatedSingleValue = function AnimatedSingleValue(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React__namespace.createElement(Fade, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-
-var _excluded$1 = ["component"],
- _excluded2 = ["children"];
-// make ValueContainer a transition group
-var AnimatedValueContainer = function AnimatedValueContainer(WrappedComponent) {
- return function (props) {
- return props.isMulti ? /*#__PURE__*/React__namespace.createElement(IsMultiValueContainer, _extends({
- component: WrappedComponent
- }, props)) : /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.TransitionGroup, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-var IsMultiValueContainer = function IsMultiValueContainer(_ref) {
- var component = _ref.component,
- restProps = _objectWithoutProperties(_ref, _excluded$1);
- var multiProps = useIsMultiValueContainer(restProps);
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.TransitionGroup, _extends({
- component: component
- }, multiProps));
-};
-var useIsMultiValueContainer = function useIsMultiValueContainer(_ref2) {
- var children = _ref2.children,
- props = _objectWithoutProperties(_ref2, _excluded2);
- var isMulti = props.isMulti,
- hasValue = props.hasValue,
- innerProps = props.innerProps,
- _props$selectProps = props.selectProps,
- components = _props$selectProps.components,
- controlShouldRenderValue = _props$selectProps.controlShouldRenderValue;
- var _useState = React.useState(isMulti && controlShouldRenderValue && hasValue),
- _useState2 = _slicedToArray(_useState, 2),
- cssDisplayFlex = _useState2[0],
- setCssDisplayFlex = _useState2[1];
- var _useState3 = React.useState(false),
- _useState4 = _slicedToArray(_useState3, 2),
- removingValue = _useState4[0],
- setRemovingValue = _useState4[1];
- React.useEffect(function () {
- if (hasValue && !cssDisplayFlex) {
- setCssDisplayFlex(true);
- }
- }, [hasValue, cssDisplayFlex]);
- React.useEffect(function () {
- if (removingValue && !hasValue && cssDisplayFlex) {
- setCssDisplayFlex(false);
- }
- setRemovingValue(false);
- }, [removingValue, hasValue, cssDisplayFlex]);
- var onExited = function onExited() {
- return setRemovingValue(true);
- };
- var childMapper = function childMapper(child) {
- if (isMulti && /*#__PURE__*/React__namespace.isValidElement(child)) {
- // Add onExited callback to MultiValues
- if (child.type === components.MultiValue) {
- return /*#__PURE__*/React__namespace.cloneElement(child, {
- onExited: onExited
- });
- }
- // While container flexed, Input cursor is shown after Placeholder text,
- // so remove Placeholder until display is set back to grid
- if (child.type === components.Placeholder && cssDisplayFlex) {
- return null;
- }
- }
- return child;
- };
- var newInnerProps = _objectSpread(_objectSpread({}, innerProps), {}, {
- style: _objectSpread(_objectSpread({}, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style), {}, {
- display: isMulti && hasValue || cssDisplayFlex ? 'flex' : 'grid'
- })
- });
- var newProps = _objectSpread(_objectSpread({}, props), {}, {
- innerProps: newInnerProps,
- children: React__namespace.Children.toArray(children).map(childMapper)
- });
- return newProps;
-};
-
-var _excluded = ["Input", "MultiValue", "Placeholder", "SingleValue", "ValueContainer"];
-var makeAnimated = function makeAnimated() {
- var externalComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var components = index$1.defaultComponents({
- components: externalComponents
- });
- var Input = components.Input,
- MultiValue = components.MultiValue,
- Placeholder = components.Placeholder,
- SingleValue = components.SingleValue,
- ValueContainer = components.ValueContainer,
- rest = _objectWithoutProperties(components, _excluded);
- return _objectSpread({
- Input: AnimatedInput(Input),
- MultiValue: AnimatedMultiValue(MultiValue),
- Placeholder: AnimatedPlaceholder(Placeholder),
- SingleValue: AnimatedSingleValue(SingleValue),
- ValueContainer: AnimatedValueContainer(ValueContainer)
- }, rest);
-};
-var AnimatedComponents = makeAnimated();
-var Input = AnimatedComponents.Input;
-var MultiValue = AnimatedComponents.MultiValue;
-var Placeholder = AnimatedComponents.Placeholder;
-var SingleValue = AnimatedComponents.SingleValue;
-var ValueContainer = AnimatedComponents.ValueContainer;
-var index = memoizeOne__default['default'](makeAnimated);
-
-exports.Input = Input;
-exports.MultiValue = MultiValue;
-exports.Placeholder = Placeholder;
-exports.SingleValue = SingleValue;
-exports.ValueContainer = ValueContainer;
-exports.default = index;
diff --git a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.js b/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.js
deleted file mode 100644
index 7d5db10fb..000000000
--- a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-if (process.env.NODE_ENV === "production") {
- module.exports = require("./react-select-animated.cjs.prod.js");
-} else {
- module.exports = require("./react-select-animated.cjs.dev.js");
-}
diff --git a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.prod.js b/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.prod.js
deleted file mode 100644
index 3e9b78ca9..000000000
--- a/frontend/node_modules/react-select/animated/dist/react-select-animated.cjs.prod.js
+++ /dev/null
@@ -1,325 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
-var memoizeOne = require('memoize-one');
-var index$1 = require('../../dist/index-78cf371e.cjs.prod.js');
-var React = require('react');
-var _extends = require('@babel/runtime/helpers/extends');
-var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
-var reactTransitionGroup = require('react-transition-group');
-require('@emotion/react');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-
-function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var memoizeOne__default = /*#__PURE__*/_interopDefault(memoizeOne);
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var _excluded$4 = ["in", "onExited", "appear", "enter", "exit"];
-// strip transition props off before spreading onto select component
-var AnimatedInput = function AnimatedInput(WrappedComponent) {
- return function (_ref) {
- _ref.in;
- _ref.onExited;
- _ref.appear;
- _ref.enter;
- _ref.exit;
- var props = _objectWithoutProperties(_ref, _excluded$4);
- return /*#__PURE__*/React__namespace.createElement(WrappedComponent, props);
- };
-};
-
-var _excluded$3 = ["component", "duration", "in", "onExited"];
-var Fade = function Fade(_ref) {
- var Tag = _ref.component,
- _ref$duration = _ref.duration,
- duration = _ref$duration === void 0 ? 1 : _ref$duration,
- inProp = _ref.in;
- _ref.onExited;
- var props = _objectWithoutProperties(_ref, _excluded$3);
- var nodeRef = React.useRef(null);
- var transition = {
- entering: {
- opacity: 0
- },
- entered: {
- opacity: 1,
- transition: "opacity ".concat(duration, "ms")
- },
- exiting: {
- opacity: 0
- },
- exited: {
- opacity: 0
- }
- };
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.Transition, {
- mountOnEnter: true,
- unmountOnExit: true,
- in: inProp,
- timeout: duration,
- nodeRef: nodeRef
- }, function (state) {
- var innerProps = {
- style: _objectSpread({}, transition[state]),
- ref: nodeRef
- };
- return /*#__PURE__*/React__namespace.createElement(Tag, _extends({
- innerProps: innerProps
- }, props));
- });
-};
-
-// ==============================
-// Collapse Transition
-// ==============================
-
-var collapseDuration = 260;
-// wrap each MultiValue with a collapse transition; decreases width until
-// finally removing from DOM
-var Collapse = function Collapse(_ref2) {
- var children = _ref2.children,
- _in = _ref2.in,
- _onExited = _ref2.onExited;
- var ref = React.useRef(null);
- var _useState = React.useState('auto'),
- _useState2 = _slicedToArray(_useState, 2),
- width = _useState2[0],
- setWidth = _useState2[1];
- React.useEffect(function () {
- var el = ref.current;
- if (!el) return;
-
- /*
- Here we're invoking requestAnimationFrame with a callback invoking our
- call to getBoundingClientRect and setState in order to resolve an edge case
- around portalling. Certain portalling solutions briefly remove children from the DOM
- before appending them to the target node. This is to avoid us trying to call getBoundingClientrect
- while the Select component is in this state.
- */
- // cannot use `offsetWidth` because it is rounded
- var rafId = window.requestAnimationFrame(function () {
- return setWidth(el.getBoundingClientRect().width);
- });
- return function () {
- return window.cancelAnimationFrame(rafId);
- };
- }, []);
- var getStyleFromStatus = function getStyleFromStatus(status) {
- switch (status) {
- default:
- return {
- width: width
- };
- case 'exiting':
- return {
- width: 0,
- transition: "width ".concat(collapseDuration, "ms ease-out")
- };
- case 'exited':
- return {
- width: 0
- };
- }
- };
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.Transition, {
- enter: false,
- mountOnEnter: true,
- unmountOnExit: true,
- in: _in,
- onExited: function onExited() {
- var el = ref.current;
- if (!el) return;
- _onExited === null || _onExited === void 0 ? void 0 : _onExited(el);
- },
- timeout: collapseDuration,
- nodeRef: ref
- }, function (status) {
- return /*#__PURE__*/React__namespace.createElement("div", {
- ref: ref,
- style: _objectSpread({
- overflow: 'hidden',
- whiteSpace: 'nowrap'
- }, getStyleFromStatus(status))
- }, children);
- });
-};
-
-var _excluded$2 = ["in", "onExited"];
-// strip transition props off before spreading onto actual component
-
-var AnimatedMultiValue = function AnimatedMultiValue(WrappedComponent) {
- return function (_ref) {
- var inProp = _ref.in,
- onExited = _ref.onExited,
- props = _objectWithoutProperties(_ref, _excluded$2);
- return /*#__PURE__*/React__namespace.createElement(Collapse, {
- in: inProp,
- onExited: onExited
- }, /*#__PURE__*/React__namespace.createElement(WrappedComponent, _extends({
- cropWithEllipsis: inProp
- }, props)));
- };
-};
-
-// fade in when last multi-value removed, otherwise instant
-var AnimatedPlaceholder = function AnimatedPlaceholder(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React__namespace.createElement(Fade, _extends({
- component: WrappedComponent,
- duration: props.isMulti ? collapseDuration : 1
- }, props));
- };
-};
-
-// instant fade; all transition-group children must be transitions
-
-var AnimatedSingleValue = function AnimatedSingleValue(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React__namespace.createElement(Fade, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-
-var _excluded$1 = ["component"],
- _excluded2 = ["children"];
-// make ValueContainer a transition group
-var AnimatedValueContainer = function AnimatedValueContainer(WrappedComponent) {
- return function (props) {
- return props.isMulti ? /*#__PURE__*/React__namespace.createElement(IsMultiValueContainer, _extends({
- component: WrappedComponent
- }, props)) : /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.TransitionGroup, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-var IsMultiValueContainer = function IsMultiValueContainer(_ref) {
- var component = _ref.component,
- restProps = _objectWithoutProperties(_ref, _excluded$1);
- var multiProps = useIsMultiValueContainer(restProps);
- return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.TransitionGroup, _extends({
- component: component
- }, multiProps));
-};
-var useIsMultiValueContainer = function useIsMultiValueContainer(_ref2) {
- var children = _ref2.children,
- props = _objectWithoutProperties(_ref2, _excluded2);
- var isMulti = props.isMulti,
- hasValue = props.hasValue,
- innerProps = props.innerProps,
- _props$selectProps = props.selectProps,
- components = _props$selectProps.components,
- controlShouldRenderValue = _props$selectProps.controlShouldRenderValue;
- var _useState = React.useState(isMulti && controlShouldRenderValue && hasValue),
- _useState2 = _slicedToArray(_useState, 2),
- cssDisplayFlex = _useState2[0],
- setCssDisplayFlex = _useState2[1];
- var _useState3 = React.useState(false),
- _useState4 = _slicedToArray(_useState3, 2),
- removingValue = _useState4[0],
- setRemovingValue = _useState4[1];
- React.useEffect(function () {
- if (hasValue && !cssDisplayFlex) {
- setCssDisplayFlex(true);
- }
- }, [hasValue, cssDisplayFlex]);
- React.useEffect(function () {
- if (removingValue && !hasValue && cssDisplayFlex) {
- setCssDisplayFlex(false);
- }
- setRemovingValue(false);
- }, [removingValue, hasValue, cssDisplayFlex]);
- var onExited = function onExited() {
- return setRemovingValue(true);
- };
- var childMapper = function childMapper(child) {
- if (isMulti && /*#__PURE__*/React__namespace.isValidElement(child)) {
- // Add onExited callback to MultiValues
- if (child.type === components.MultiValue) {
- return /*#__PURE__*/React__namespace.cloneElement(child, {
- onExited: onExited
- });
- }
- // While container flexed, Input cursor is shown after Placeholder text,
- // so remove Placeholder until display is set back to grid
- if (child.type === components.Placeholder && cssDisplayFlex) {
- return null;
- }
- }
- return child;
- };
- var newInnerProps = _objectSpread(_objectSpread({}, innerProps), {}, {
- style: _objectSpread(_objectSpread({}, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style), {}, {
- display: isMulti && hasValue || cssDisplayFlex ? 'flex' : 'grid'
- })
- });
- var newProps = _objectSpread(_objectSpread({}, props), {}, {
- innerProps: newInnerProps,
- children: React__namespace.Children.toArray(children).map(childMapper)
- });
- return newProps;
-};
-
-var _excluded = ["Input", "MultiValue", "Placeholder", "SingleValue", "ValueContainer"];
-var makeAnimated = function makeAnimated() {
- var externalComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var components = index$1.defaultComponents({
- components: externalComponents
- });
- var Input = components.Input,
- MultiValue = components.MultiValue,
- Placeholder = components.Placeholder,
- SingleValue = components.SingleValue,
- ValueContainer = components.ValueContainer,
- rest = _objectWithoutProperties(components, _excluded);
- return _objectSpread({
- Input: AnimatedInput(Input),
- MultiValue: AnimatedMultiValue(MultiValue),
- Placeholder: AnimatedPlaceholder(Placeholder),
- SingleValue: AnimatedSingleValue(SingleValue),
- ValueContainer: AnimatedValueContainer(ValueContainer)
- }, rest);
-};
-var AnimatedComponents = makeAnimated();
-var Input = AnimatedComponents.Input;
-var MultiValue = AnimatedComponents.MultiValue;
-var Placeholder = AnimatedComponents.Placeholder;
-var SingleValue = AnimatedComponents.SingleValue;
-var ValueContainer = AnimatedComponents.ValueContainer;
-var index = memoizeOne__default['default'](makeAnimated);
-
-exports.Input = Input;
-exports.MultiValue = MultiValue;
-exports.Placeholder = Placeholder;
-exports.SingleValue = SingleValue;
-exports.ValueContainer = ValueContainer;
-exports.default = index;
diff --git a/frontend/node_modules/react-select/animated/dist/react-select-animated.esm.js b/frontend/node_modules/react-select/animated/dist/react-select-animated.esm.js
deleted file mode 100644
index f8afd3a5f..000000000
--- a/frontend/node_modules/react-select/animated/dist/react-select-animated.esm.js
+++ /dev/null
@@ -1,293 +0,0 @@
-import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
-import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
-import memoizeOne from 'memoize-one';
-import { F as defaultComponents } from '../../dist/index-a86253bb.esm.js';
-import * as React from 'react';
-import { useRef, useState, useEffect } from 'react';
-import _extends from '@babel/runtime/helpers/esm/extends';
-import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
-import { Transition, TransitionGroup } from 'react-transition-group';
-import '@emotion/react';
-import '@babel/runtime/helpers/typeof';
-import '@babel/runtime/helpers/taggedTemplateLiteral';
-import '@babel/runtime/helpers/defineProperty';
-import 'react-dom';
-import '@floating-ui/dom';
-import 'use-isomorphic-layout-effect';
-
-var _excluded$4 = ["in", "onExited", "appear", "enter", "exit"];
-// strip transition props off before spreading onto select component
-var AnimatedInput = function AnimatedInput(WrappedComponent) {
- return function (_ref) {
- _ref.in;
- _ref.onExited;
- _ref.appear;
- _ref.enter;
- _ref.exit;
- var props = _objectWithoutProperties(_ref, _excluded$4);
- return /*#__PURE__*/React.createElement(WrappedComponent, props);
- };
-};
-
-var _excluded$3 = ["component", "duration", "in", "onExited"];
-var Fade = function Fade(_ref) {
- var Tag = _ref.component,
- _ref$duration = _ref.duration,
- duration = _ref$duration === void 0 ? 1 : _ref$duration,
- inProp = _ref.in;
- _ref.onExited;
- var props = _objectWithoutProperties(_ref, _excluded$3);
- var nodeRef = useRef(null);
- var transition = {
- entering: {
- opacity: 0
- },
- entered: {
- opacity: 1,
- transition: "opacity ".concat(duration, "ms")
- },
- exiting: {
- opacity: 0
- },
- exited: {
- opacity: 0
- }
- };
- return /*#__PURE__*/React.createElement(Transition, {
- mountOnEnter: true,
- unmountOnExit: true,
- in: inProp,
- timeout: duration,
- nodeRef: nodeRef
- }, function (state) {
- var innerProps = {
- style: _objectSpread({}, transition[state]),
- ref: nodeRef
- };
- return /*#__PURE__*/React.createElement(Tag, _extends({
- innerProps: innerProps
- }, props));
- });
-};
-
-// ==============================
-// Collapse Transition
-// ==============================
-
-var collapseDuration = 260;
-// wrap each MultiValue with a collapse transition; decreases width until
-// finally removing from DOM
-var Collapse = function Collapse(_ref2) {
- var children = _ref2.children,
- _in = _ref2.in,
- _onExited = _ref2.onExited;
- var ref = useRef(null);
- var _useState = useState('auto'),
- _useState2 = _slicedToArray(_useState, 2),
- width = _useState2[0],
- setWidth = _useState2[1];
- useEffect(function () {
- var el = ref.current;
- if (!el) return;
-
- /*
- Here we're invoking requestAnimationFrame with a callback invoking our
- call to getBoundingClientRect and setState in order to resolve an edge case
- around portalling. Certain portalling solutions briefly remove children from the DOM
- before appending them to the target node. This is to avoid us trying to call getBoundingClientrect
- while the Select component is in this state.
- */
- // cannot use `offsetWidth` because it is rounded
- var rafId = window.requestAnimationFrame(function () {
- return setWidth(el.getBoundingClientRect().width);
- });
- return function () {
- return window.cancelAnimationFrame(rafId);
- };
- }, []);
- var getStyleFromStatus = function getStyleFromStatus(status) {
- switch (status) {
- default:
- return {
- width: width
- };
- case 'exiting':
- return {
- width: 0,
- transition: "width ".concat(collapseDuration, "ms ease-out")
- };
- case 'exited':
- return {
- width: 0
- };
- }
- };
- return /*#__PURE__*/React.createElement(Transition, {
- enter: false,
- mountOnEnter: true,
- unmountOnExit: true,
- in: _in,
- onExited: function onExited() {
- var el = ref.current;
- if (!el) return;
- _onExited === null || _onExited === void 0 ? void 0 : _onExited(el);
- },
- timeout: collapseDuration,
- nodeRef: ref
- }, function (status) {
- return /*#__PURE__*/React.createElement("div", {
- ref: ref,
- style: _objectSpread({
- overflow: 'hidden',
- whiteSpace: 'nowrap'
- }, getStyleFromStatus(status))
- }, children);
- });
-};
-
-var _excluded$2 = ["in", "onExited"];
-// strip transition props off before spreading onto actual component
-
-var AnimatedMultiValue = function AnimatedMultiValue(WrappedComponent) {
- return function (_ref) {
- var inProp = _ref.in,
- onExited = _ref.onExited,
- props = _objectWithoutProperties(_ref, _excluded$2);
- return /*#__PURE__*/React.createElement(Collapse, {
- in: inProp,
- onExited: onExited
- }, /*#__PURE__*/React.createElement(WrappedComponent, _extends({
- cropWithEllipsis: inProp
- }, props)));
- };
-};
-
-// fade in when last multi-value removed, otherwise instant
-var AnimatedPlaceholder = function AnimatedPlaceholder(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React.createElement(Fade, _extends({
- component: WrappedComponent,
- duration: props.isMulti ? collapseDuration : 1
- }, props));
- };
-};
-
-// instant fade; all transition-group children must be transitions
-
-var AnimatedSingleValue = function AnimatedSingleValue(WrappedComponent) {
- return function (props) {
- return /*#__PURE__*/React.createElement(Fade, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-
-var _excluded$1 = ["component"],
- _excluded2 = ["children"];
-// make ValueContainer a transition group
-var AnimatedValueContainer = function AnimatedValueContainer(WrappedComponent) {
- return function (props) {
- return props.isMulti ? /*#__PURE__*/React.createElement(IsMultiValueContainer, _extends({
- component: WrappedComponent
- }, props)) : /*#__PURE__*/React.createElement(TransitionGroup, _extends({
- component: WrappedComponent
- }, props));
- };
-};
-var IsMultiValueContainer = function IsMultiValueContainer(_ref) {
- var component = _ref.component,
- restProps = _objectWithoutProperties(_ref, _excluded$1);
- var multiProps = useIsMultiValueContainer(restProps);
- return /*#__PURE__*/React.createElement(TransitionGroup, _extends({
- component: component
- }, multiProps));
-};
-var useIsMultiValueContainer = function useIsMultiValueContainer(_ref2) {
- var children = _ref2.children,
- props = _objectWithoutProperties(_ref2, _excluded2);
- var isMulti = props.isMulti,
- hasValue = props.hasValue,
- innerProps = props.innerProps,
- _props$selectProps = props.selectProps,
- components = _props$selectProps.components,
- controlShouldRenderValue = _props$selectProps.controlShouldRenderValue;
- var _useState = useState(isMulti && controlShouldRenderValue && hasValue),
- _useState2 = _slicedToArray(_useState, 2),
- cssDisplayFlex = _useState2[0],
- setCssDisplayFlex = _useState2[1];
- var _useState3 = useState(false),
- _useState4 = _slicedToArray(_useState3, 2),
- removingValue = _useState4[0],
- setRemovingValue = _useState4[1];
- useEffect(function () {
- if (hasValue && !cssDisplayFlex) {
- setCssDisplayFlex(true);
- }
- }, [hasValue, cssDisplayFlex]);
- useEffect(function () {
- if (removingValue && !hasValue && cssDisplayFlex) {
- setCssDisplayFlex(false);
- }
- setRemovingValue(false);
- }, [removingValue, hasValue, cssDisplayFlex]);
- var onExited = function onExited() {
- return setRemovingValue(true);
- };
- var childMapper = function childMapper(child) {
- if (isMulti && /*#__PURE__*/React.isValidElement(child)) {
- // Add onExited callback to MultiValues
- if (child.type === components.MultiValue) {
- return /*#__PURE__*/React.cloneElement(child, {
- onExited: onExited
- });
- }
- // While container flexed, Input cursor is shown after Placeholder text,
- // so remove Placeholder until display is set back to grid
- if (child.type === components.Placeholder && cssDisplayFlex) {
- return null;
- }
- }
- return child;
- };
- var newInnerProps = _objectSpread(_objectSpread({}, innerProps), {}, {
- style: _objectSpread(_objectSpread({}, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style), {}, {
- display: isMulti && hasValue || cssDisplayFlex ? 'flex' : 'grid'
- })
- });
- var newProps = _objectSpread(_objectSpread({}, props), {}, {
- innerProps: newInnerProps,
- children: React.Children.toArray(children).map(childMapper)
- });
- return newProps;
-};
-
-var _excluded = ["Input", "MultiValue", "Placeholder", "SingleValue", "ValueContainer"];
-var makeAnimated = function makeAnimated() {
- var externalComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var components = defaultComponents({
- components: externalComponents
- });
- var Input = components.Input,
- MultiValue = components.MultiValue,
- Placeholder = components.Placeholder,
- SingleValue = components.SingleValue,
- ValueContainer = components.ValueContainer,
- rest = _objectWithoutProperties(components, _excluded);
- return _objectSpread({
- Input: AnimatedInput(Input),
- MultiValue: AnimatedMultiValue(MultiValue),
- Placeholder: AnimatedPlaceholder(Placeholder),
- SingleValue: AnimatedSingleValue(SingleValue),
- ValueContainer: AnimatedValueContainer(ValueContainer)
- }, rest);
-};
-var AnimatedComponents = makeAnimated();
-var Input = AnimatedComponents.Input;
-var MultiValue = AnimatedComponents.MultiValue;
-var Placeholder = AnimatedComponents.Placeholder;
-var SingleValue = AnimatedComponents.SingleValue;
-var ValueContainer = AnimatedComponents.ValueContainer;
-var index = memoizeOne(makeAnimated);
-
-export default index;
-export { Input, MultiValue, Placeholder, SingleValue, ValueContainer };
diff --git a/frontend/node_modules/react-select/animated/package.json b/frontend/node_modules/react-select/animated/package.json
deleted file mode 100644
index 480f66dd0..000000000
--- a/frontend/node_modules/react-select/animated/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "main": "dist/react-select-animated.cjs.js",
- "module": "dist/react-select-animated.esm.js",
- "types": "dist/react-select-animated.cjs.d.ts"
-}
diff --git a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.d.ts b/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.d.ts
deleted file mode 100644
index 113edfa17..000000000
--- a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "../../dist/declarations/src/async-creatable/index";
-export { default } from "../../dist/declarations/src/async-creatable/index";
diff --git a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.dev.js b/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.dev.js
deleted file mode 100644
index f439d2c0e..000000000
--- a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.dev.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-73d77d2c.cjs.dev.js');
-var useAsync = require('../../dist/useAsync-c7333178.cjs.dev.js');
-var useStateManager = require('../../dist/useStateManager-7748b351.cjs.dev.js');
-var useCreatable = require('../../dist/useCreatable-10abcf47.cjs.dev.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-5b950e59.cjs.dev.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var AsyncCreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var stateManagerProps = useAsync.useAsync(props);
- var creatableProps = useStateManager.useStateManager(stateManagerProps);
- var selectProps = useCreatable.useCreatable(creatableProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.default = AsyncCreatableSelect;
diff --git a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.js b/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.js
deleted file mode 100644
index 9168802f9..000000000
--- a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-if (process.env.NODE_ENV === "production") {
- module.exports = require("./react-select-async-creatable.cjs.prod.js");
-} else {
- module.exports = require("./react-select-async-creatable.cjs.dev.js");
-}
diff --git a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.prod.js b/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.prod.js
deleted file mode 100644
index 0a2e93e22..000000000
--- a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.cjs.prod.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-a4b66b9e.cjs.prod.js');
-var useAsync = require('../../dist/useAsync-73d4611a.cjs.prod.js');
-var useStateManager = require('../../dist/useStateManager-ce23061c.cjs.prod.js');
-var useCreatable = require('../../dist/useCreatable-612c7d7e.cjs.prod.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-78cf371e.cjs.prod.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var AsyncCreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var stateManagerProps = useAsync.useAsync(props);
- var creatableProps = useStateManager.useStateManager(stateManagerProps);
- var selectProps = useCreatable.useCreatable(creatableProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.default = AsyncCreatableSelect;
diff --git a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.esm.js b/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.esm.js
deleted file mode 100644
index 2d0d3d810..000000000
--- a/frontend/node_modules/react-select/async-creatable/dist/react-select-async-creatable.esm.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import _extends from '@babel/runtime/helpers/esm/extends';
-import * as React from 'react';
-import { forwardRef } from 'react';
-import { S as Select } from '../../dist/Select-40119e12.esm.js';
-import { u as useAsync } from '../../dist/useAsync-fd9b28d9.esm.js';
-import { u as useStateManager } from '../../dist/useStateManager-7e1e8489.esm.js';
-import { u as useCreatable } from '../../dist/useCreatable-36230047.esm.js';
-import '@babel/runtime/helpers/objectSpread2';
-import '@babel/runtime/helpers/classCallCheck';
-import '@babel/runtime/helpers/createClass';
-import '@babel/runtime/helpers/inherits';
-import '@babel/runtime/helpers/createSuper';
-import '@babel/runtime/helpers/toConsumableArray';
-import '../../dist/index-a86253bb.esm.js';
-import '@emotion/react';
-import '@babel/runtime/helpers/slicedToArray';
-import '@babel/runtime/helpers/objectWithoutProperties';
-import '@babel/runtime/helpers/typeof';
-import '@babel/runtime/helpers/taggedTemplateLiteral';
-import '@babel/runtime/helpers/defineProperty';
-import 'react-dom';
-import '@floating-ui/dom';
-import 'use-isomorphic-layout-effect';
-import 'memoize-one';
-
-var AsyncCreatableSelect = /*#__PURE__*/forwardRef(function (props, ref) {
- var stateManagerProps = useAsync(props);
- var creatableProps = useStateManager(stateManagerProps);
- var selectProps = useCreatable(creatableProps);
- return /*#__PURE__*/React.createElement(Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-export default AsyncCreatableSelect;
diff --git a/frontend/node_modules/react-select/async-creatable/package.json b/frontend/node_modules/react-select/async-creatable/package.json
deleted file mode 100644
index 0a3bddde0..000000000
--- a/frontend/node_modules/react-select/async-creatable/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "main": "dist/react-select-async-creatable.cjs.js",
- "module": "dist/react-select-async-creatable.esm.js",
- "types": "dist/react-select-async-creatable.cjs.d.ts"
-}
diff --git a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.d.ts b/frontend/node_modules/react-select/async/dist/react-select-async.cjs.d.ts
deleted file mode 100644
index ec9574d68..000000000
--- a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "../../dist/declarations/src/async/index";
-export { default } from "../../dist/declarations/src/async/index";
diff --git a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.dev.js b/frontend/node_modules/react-select/async/dist/react-select-async.cjs.dev.js
deleted file mode 100644
index 983445875..000000000
--- a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.dev.js
+++ /dev/null
@@ -1,59 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-73d77d2c.cjs.dev.js');
-var useStateManager = require('../../dist/useStateManager-7748b351.cjs.dev.js');
-var useAsync = require('../../dist/useAsync-c7333178.cjs.dev.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-5b950e59.cjs.dev.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var AsyncSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var stateManagedProps = useAsync.useAsync(props);
- var selectProps = useStateManager.useStateManager(stateManagedProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.useAsync = useAsync.useAsync;
-exports.default = AsyncSelect;
diff --git a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.js b/frontend/node_modules/react-select/async/dist/react-select-async.cjs.js
deleted file mode 100644
index 50f42cee7..000000000
--- a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-if (process.env.NODE_ENV === "production") {
- module.exports = require("./react-select-async.cjs.prod.js");
-} else {
- module.exports = require("./react-select-async.cjs.dev.js");
-}
diff --git a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.prod.js b/frontend/node_modules/react-select/async/dist/react-select-async.cjs.prod.js
deleted file mode 100644
index 8e6f3abd9..000000000
--- a/frontend/node_modules/react-select/async/dist/react-select-async.cjs.prod.js
+++ /dev/null
@@ -1,59 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-a4b66b9e.cjs.prod.js');
-var useStateManager = require('../../dist/useStateManager-ce23061c.cjs.prod.js');
-var useAsync = require('../../dist/useAsync-73d4611a.cjs.prod.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-78cf371e.cjs.prod.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var AsyncSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var stateManagedProps = useAsync.useAsync(props);
- var selectProps = useStateManager.useStateManager(stateManagedProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.useAsync = useAsync.useAsync;
-exports.default = AsyncSelect;
diff --git a/frontend/node_modules/react-select/async/dist/react-select-async.esm.js b/frontend/node_modules/react-select/async/dist/react-select-async.esm.js
deleted file mode 100644
index 7515c8c81..000000000
--- a/frontend/node_modules/react-select/async/dist/react-select-async.esm.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import _extends from '@babel/runtime/helpers/esm/extends';
-import * as React from 'react';
-import { forwardRef } from 'react';
-import { S as Select } from '../../dist/Select-40119e12.esm.js';
-import { u as useStateManager } from '../../dist/useStateManager-7e1e8489.esm.js';
-import { u as useAsync } from '../../dist/useAsync-fd9b28d9.esm.js';
-export { u as useAsync } from '../../dist/useAsync-fd9b28d9.esm.js';
-import '@babel/runtime/helpers/objectSpread2';
-import '@babel/runtime/helpers/classCallCheck';
-import '@babel/runtime/helpers/createClass';
-import '@babel/runtime/helpers/inherits';
-import '@babel/runtime/helpers/createSuper';
-import '@babel/runtime/helpers/toConsumableArray';
-import '../../dist/index-a86253bb.esm.js';
-import '@emotion/react';
-import '@babel/runtime/helpers/slicedToArray';
-import '@babel/runtime/helpers/objectWithoutProperties';
-import '@babel/runtime/helpers/typeof';
-import '@babel/runtime/helpers/taggedTemplateLiteral';
-import '@babel/runtime/helpers/defineProperty';
-import 'react-dom';
-import '@floating-ui/dom';
-import 'use-isomorphic-layout-effect';
-import 'memoize-one';
-
-var AsyncSelect = /*#__PURE__*/forwardRef(function (props, ref) {
- var stateManagedProps = useAsync(props);
- var selectProps = useStateManager(stateManagedProps);
- return /*#__PURE__*/React.createElement(Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-export default AsyncSelect;
diff --git a/frontend/node_modules/react-select/async/package.json b/frontend/node_modules/react-select/async/package.json
deleted file mode 100644
index b58d5d1e2..000000000
--- a/frontend/node_modules/react-select/async/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "main": "dist/react-select-async.cjs.js",
- "module": "dist/react-select-async.esm.js",
- "types": "dist/react-select-async.cjs.d.ts"
-}
diff --git a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.d.ts b/frontend/node_modules/react-select/base/dist/react-select-base.cjs.d.ts
deleted file mode 100644
index bfa2cf992..000000000
--- a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "../../dist/declarations/src/base/index";
-export { default } from "../../dist/declarations/src/base/index";
diff --git a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.dev.js b/frontend/node_modules/react-select/base/dist/react-select-base.cjs.dev.js
deleted file mode 100644
index 809336dad..000000000
--- a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.dev.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var Select = require('../../dist/Select-73d77d2c.cjs.dev.js');
-require('@babel/runtime/helpers/extends');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('react');
-require('../../dist/index-5b950e59.cjs.dev.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-
-
-exports.default = Select.Select;
-exports.defaultProps = Select.defaultProps;
diff --git a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.js b/frontend/node_modules/react-select/base/dist/react-select-base.cjs.js
deleted file mode 100644
index 97c4c32d8..000000000
--- a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-if (process.env.NODE_ENV === "production") {
- module.exports = require("./react-select-base.cjs.prod.js");
-} else {
- module.exports = require("./react-select-base.cjs.dev.js");
-}
diff --git a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.prod.js b/frontend/node_modules/react-select/base/dist/react-select-base.cjs.prod.js
deleted file mode 100644
index 34e99ef6f..000000000
--- a/frontend/node_modules/react-select/base/dist/react-select-base.cjs.prod.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var Select = require('../../dist/Select-a4b66b9e.cjs.prod.js');
-require('@babel/runtime/helpers/extends');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('react');
-require('../../dist/index-78cf371e.cjs.prod.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-
-
-exports.default = Select.Select;
-exports.defaultProps = Select.defaultProps;
diff --git a/frontend/node_modules/react-select/base/dist/react-select-base.esm.js b/frontend/node_modules/react-select/base/dist/react-select-base.esm.js
deleted file mode 100644
index 53dadc27e..000000000
--- a/frontend/node_modules/react-select/base/dist/react-select-base.esm.js
+++ /dev/null
@@ -1,20 +0,0 @@
-export { S as default, a as defaultProps } from '../../dist/Select-40119e12.esm.js';
-import '@babel/runtime/helpers/extends';
-import '@babel/runtime/helpers/objectSpread2';
-import '@babel/runtime/helpers/classCallCheck';
-import '@babel/runtime/helpers/createClass';
-import '@babel/runtime/helpers/inherits';
-import '@babel/runtime/helpers/createSuper';
-import '@babel/runtime/helpers/toConsumableArray';
-import 'react';
-import '../../dist/index-a86253bb.esm.js';
-import '@emotion/react';
-import '@babel/runtime/helpers/slicedToArray';
-import '@babel/runtime/helpers/objectWithoutProperties';
-import '@babel/runtime/helpers/typeof';
-import '@babel/runtime/helpers/taggedTemplateLiteral';
-import '@babel/runtime/helpers/defineProperty';
-import 'react-dom';
-import '@floating-ui/dom';
-import 'use-isomorphic-layout-effect';
-import 'memoize-one';
diff --git a/frontend/node_modules/react-select/base/package.json b/frontend/node_modules/react-select/base/package.json
deleted file mode 100644
index 957568d89..000000000
--- a/frontend/node_modules/react-select/base/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "main": "dist/react-select-base.cjs.js",
- "module": "dist/react-select-base.esm.js",
- "types": "dist/react-select-base.cjs.d.ts"
-}
diff --git a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.d.ts b/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.d.ts
deleted file mode 100644
index 4c544de7a..000000000
--- a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "../../dist/declarations/src/creatable/index";
-export { default } from "../../dist/declarations/src/creatable/index";
diff --git a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.dev.js b/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.dev.js
deleted file mode 100644
index 20f8b0c76..000000000
--- a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.dev.js
+++ /dev/null
@@ -1,59 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-73d77d2c.cjs.dev.js');
-var useStateManager = require('../../dist/useStateManager-7748b351.cjs.dev.js');
-var useCreatable = require('../../dist/useCreatable-10abcf47.cjs.dev.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-5b950e59.cjs.dev.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var CreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var creatableProps = useStateManager.useStateManager(props);
- var selectProps = useCreatable.useCreatable(creatableProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.useCreatable = useCreatable.useCreatable;
-exports.default = CreatableSelect;
diff --git a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.js b/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.js
deleted file mode 100644
index 510a1a555..000000000
--- a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-if (process.env.NODE_ENV === "production") {
- module.exports = require("./react-select-creatable.cjs.prod.js");
-} else {
- module.exports = require("./react-select-creatable.cjs.dev.js");
-}
diff --git a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.prod.js b/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.prod.js
deleted file mode 100644
index 97395872f..000000000
--- a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.cjs.prod.js
+++ /dev/null
@@ -1,59 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _extends = require('@babel/runtime/helpers/extends');
-var React = require('react');
-var Select = require('../../dist/Select-a4b66b9e.cjs.prod.js');
-var useStateManager = require('../../dist/useStateManager-ce23061c.cjs.prod.js');
-var useCreatable = require('../../dist/useCreatable-612c7d7e.cjs.prod.js');
-require('@babel/runtime/helpers/objectSpread2');
-require('@babel/runtime/helpers/classCallCheck');
-require('@babel/runtime/helpers/createClass');
-require('@babel/runtime/helpers/inherits');
-require('@babel/runtime/helpers/createSuper');
-require('@babel/runtime/helpers/toConsumableArray');
-require('../../dist/index-78cf371e.cjs.prod.js');
-require('@emotion/react');
-require('@babel/runtime/helpers/slicedToArray');
-require('@babel/runtime/helpers/objectWithoutProperties');
-require('@babel/runtime/helpers/typeof');
-require('@babel/runtime/helpers/taggedTemplateLiteral');
-require('@babel/runtime/helpers/defineProperty');
-require('react-dom');
-require('@floating-ui/dom');
-require('use-isomorphic-layout-effect');
-require('memoize-one');
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-
-var CreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
- var creatableProps = useStateManager.useStateManager(props);
- var selectProps = useCreatable.useCreatable(creatableProps);
- return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-exports.useCreatable = useCreatable.useCreatable;
-exports.default = CreatableSelect;
diff --git a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.esm.js b/frontend/node_modules/react-select/creatable/dist/react-select-creatable.esm.js
deleted file mode 100644
index bf6d5a5e7..000000000
--- a/frontend/node_modules/react-select/creatable/dist/react-select-creatable.esm.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import _extends from '@babel/runtime/helpers/esm/extends';
-import * as React from 'react';
-import { forwardRef } from 'react';
-import { S as Select } from '../../dist/Select-40119e12.esm.js';
-import { u as useStateManager } from '../../dist/useStateManager-7e1e8489.esm.js';
-import { u as useCreatable } from '../../dist/useCreatable-36230047.esm.js';
-export { u as useCreatable } from '../../dist/useCreatable-36230047.esm.js';
-import '@babel/runtime/helpers/objectSpread2';
-import '@babel/runtime/helpers/classCallCheck';
-import '@babel/runtime/helpers/createClass';
-import '@babel/runtime/helpers/inherits';
-import '@babel/runtime/helpers/createSuper';
-import '@babel/runtime/helpers/toConsumableArray';
-import '../../dist/index-a86253bb.esm.js';
-import '@emotion/react';
-import '@babel/runtime/helpers/slicedToArray';
-import '@babel/runtime/helpers/objectWithoutProperties';
-import '@babel/runtime/helpers/typeof';
-import '@babel/runtime/helpers/taggedTemplateLiteral';
-import '@babel/runtime/helpers/defineProperty';
-import 'react-dom';
-import '@floating-ui/dom';
-import 'use-isomorphic-layout-effect';
-import 'memoize-one';
-
-var CreatableSelect = /*#__PURE__*/forwardRef(function (props, ref) {
- var creatableProps = useStateManager(props);
- var selectProps = useCreatable(creatableProps);
- return /*#__PURE__*/React.createElement(Select, _extends({
- ref: ref
- }, selectProps));
-});
-
-export default CreatableSelect;
diff --git a/frontend/node_modules/react-select/creatable/package.json b/frontend/node_modules/react-select/creatable/package.json
deleted file mode 100644
index 347a42cf5..000000000
--- a/frontend/node_modules/react-select/creatable/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "main": "dist/react-select-creatable.cjs.js",
- "module": "dist/react-select-creatable.esm.js",
- "types": "dist/react-select-creatable.cjs.d.ts"
-}
diff --git a/frontend/node_modules/react-select/dist/Select-40119e12.esm.js b/frontend/node_modules/react-select/dist/Select-40119e12.esm.js
deleted file mode 100644
index 09ec1e2b9..000000000
--- a/frontend/node_modules/react-select/dist/Select-40119e12.esm.js
+++ /dev/null
@@ -1,2571 +0,0 @@
-import _extends from '@babel/runtime/helpers/esm/extends';
-import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
-import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
-import _createClass from '@babel/runtime/helpers/esm/createClass';
-import _inherits from '@babel/runtime/helpers/esm/inherits';
-import _createSuper from '@babel/runtime/helpers/esm/createSuper';
-import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
-import * as React from 'react';
-import { useMemo, Fragment, useRef, useCallback, useEffect, Component } from 'react';
-import { r as removeProps, s as supportsPassiveEvents, a as clearIndicatorCSS, b as containerCSS, d as css$1, e as dropdownIndicatorCSS, g as groupCSS, f as groupHeadingCSS, i as indicatorsContainerCSS, h as indicatorSeparatorCSS, j as inputCSS, l as loadingIndicatorCSS, k as loadingMessageCSS, m as menuCSS, n as menuListCSS, o as menuPortalCSS, p as multiValueCSS, q as multiValueLabelCSS, t as multiValueRemoveCSS, u as noOptionsMessageCSS, v as optionCSS, w as placeholderCSS, x as css$2, y as valueContainerCSS, z as isTouchCapable, A as isMobileDevice, B as multiValueAsValue, C as singleValueAsValue, D as valueTernary, E as classNames, F as defaultComponents, G as notNullish, H as isDocumentElement, I as cleanValue, J as scrollIntoView, K as noop, M as MenuPlacer } from './index-a86253bb.esm.js';
-import { jsx, css } from '@emotion/react';
-import memoizeOne from 'memoize-one';
-import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-
-// Assistive text to describe visual elements. Hidden for sighted users.
-var _ref = process.env.NODE_ENV === "production" ? {
- name: "7pg0cj-a11yText",
- styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
-} : {
- name: "1f43avz-a11yText-A11yText",
- styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
-};
-var A11yText = function A11yText(props) {
- return jsx("span", _extends({
- css: _ref
- }, props));
-};
-
-var defaultAriaLiveMessages = {
- guidance: function guidance(props) {
- var isSearchable = props.isSearchable,
- isMulti = props.isMulti,
- isDisabled = props.isDisabled,
- tabSelectsValue = props.tabSelectsValue,
- context = props.context;
- switch (context) {
- case 'menu':
- return "Use Up and Down to choose options".concat(isDisabled ? '' : ', press Enter to select the currently focused option', ", press Escape to exit the menu").concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
- case 'input':
- return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
- case 'value':
- return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
- default:
- return '';
- }
- },
- onChange: function onChange(props) {
- var action = props.action,
- _props$label = props.label,
- label = _props$label === void 0 ? '' : _props$label,
- labels = props.labels,
- isDisabled = props.isDisabled;
- switch (action) {
- case 'deselect-option':
- case 'pop-value':
- case 'remove-value':
- return "option ".concat(label, ", deselected.");
- case 'clear':
- return 'All selected options have been cleared.';
- case 'initial-input-focus':
- return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected.");
- case 'select-option':
- return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected.");
- default:
- return '';
- }
- },
- onFocus: function onFocus(props) {
- var context = props.context,
- focused = props.focused,
- options = props.options,
- _props$label2 = props.label,
- label = _props$label2 === void 0 ? '' : _props$label2,
- selectValue = props.selectValue,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected;
- var getArrayIndex = function getArrayIndex(arr, item) {
- return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
- };
- if (context === 'value' && selectValue) {
- return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
- }
- if (context === 'menu') {
- var disabled = isDisabled ? ' disabled' : '';
- var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
- return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
- }
- return '';
- },
- onFilter: function onFilter(props) {
- var inputValue = props.inputValue,
- resultsMessage = props.resultsMessage;
- return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', ".");
- }
-};
-
-var LiveRegion = function LiveRegion(props) {
- var ariaSelection = props.ariaSelection,
- focusedOption = props.focusedOption,
- focusedValue = props.focusedValue,
- focusableOptions = props.focusableOptions,
- isFocused = props.isFocused,
- selectValue = props.selectValue,
- selectProps = props.selectProps,
- id = props.id;
- var ariaLiveMessages = selectProps.ariaLiveMessages,
- getOptionLabel = selectProps.getOptionLabel,
- inputValue = selectProps.inputValue,
- isMulti = selectProps.isMulti,
- isOptionDisabled = selectProps.isOptionDisabled,
- isSearchable = selectProps.isSearchable,
- menuIsOpen = selectProps.menuIsOpen,
- options = selectProps.options,
- screenReaderStatus = selectProps.screenReaderStatus,
- tabSelectsValue = selectProps.tabSelectsValue;
- var ariaLabel = selectProps['aria-label'];
- var ariaLive = selectProps['aria-live'];
-
- // Update aria live message configuration when prop changes
- var messages = useMemo(function () {
- return _objectSpread(_objectSpread({}, defaultAriaLiveMessages), ariaLiveMessages || {});
- }, [ariaLiveMessages]);
-
- // Update aria live selected option when prop changes
- var ariaSelected = useMemo(function () {
- var message = '';
- if (ariaSelection && messages.onChange) {
- var option = ariaSelection.option,
- selectedOptions = ariaSelection.options,
- removedValue = ariaSelection.removedValue,
- removedValues = ariaSelection.removedValues,
- value = ariaSelection.value;
- // select-option when !isMulti does not return option so we assume selected option is value
- var asOption = function asOption(val) {
- return !Array.isArray(val) ? val : null;
- };
-
- // If there is just one item from the action then get its label
- var selected = removedValue || option || asOption(value);
- var label = selected ? getOptionLabel(selected) : '';
-
- // If there are multiple items from the action then return an array of labels
- var multiSelected = selectedOptions || removedValues || undefined;
- var labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
- var onChangeProps = _objectSpread({
- // multiSelected items are usually items that have already been selected
- // or set by the user as a default value so we assume they are not disabled
- isDisabled: selected && isOptionDisabled(selected, selectValue),
- label: label,
- labels: labels
- }, ariaSelection);
- message = messages.onChange(onChangeProps);
- }
- return message;
- }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]);
- var ariaFocused = useMemo(function () {
- var focusMsg = '';
- var focused = focusedOption || focusedValue;
- var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
- if (focused && messages.onFocus) {
- var onFocusProps = {
- focused: focused,
- label: getOptionLabel(focused),
- isDisabled: isOptionDisabled(focused, selectValue),
- isSelected: isSelected,
- options: focusableOptions,
- context: focused === focusedOption ? 'menu' : 'value',
- selectValue: selectValue
- };
- focusMsg = messages.onFocus(onFocusProps);
- }
- return focusMsg;
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
- var ariaResults = useMemo(function () {
- var resultsMsg = '';
- if (menuIsOpen && options.length && messages.onFilter) {
- var resultsMessage = screenReaderStatus({
- count: focusableOptions.length
- });
- resultsMsg = messages.onFilter({
- inputValue: inputValue,
- resultsMessage: resultsMessage
- });
- }
- return resultsMsg;
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
- var ariaGuidance = useMemo(function () {
- var guidanceMsg = '';
- if (messages.guidance) {
- var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';
- guidanceMsg = messages.guidance({
- 'aria-label': ariaLabel,
- context: context,
- isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
- isMulti: isMulti,
- isSearchable: isSearchable,
- tabSelectsValue: tabSelectsValue
- });
- }
- return guidanceMsg;
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
- var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
- var ScreenReaderText = jsx(Fragment, null, jsx("span", {
- id: "aria-selection"
- }, ariaSelected), jsx("span", {
- id: "aria-context"
- }, ariaContext));
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
- return jsx(Fragment, null, jsx(A11yText, {
- id: id
- }, isInitialFocus && ScreenReaderText), jsx(A11yText, {
- "aria-live": ariaLive,
- "aria-atomic": "false",
- "aria-relevant": "additions text"
- }, isFocused && !isInitialFocus && ScreenReaderText));
-};
-
-var diacritics = [{
- base: 'A',
- letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
-}, {
- base: 'AA',
- letters: "\uA732"
-}, {
- base: 'AE',
- letters: "\xC6\u01FC\u01E2"
-}, {
- base: 'AO',
- letters: "\uA734"
-}, {
- base: 'AU',
- letters: "\uA736"
-}, {
- base: 'AV',
- letters: "\uA738\uA73A"
-}, {
- base: 'AY',
- letters: "\uA73C"
-}, {
- base: 'B',
- letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
-}, {
- base: 'C',
- letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
-}, {
- base: 'D',
- letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
-}, {
- base: 'DZ',
- letters: "\u01F1\u01C4"
-}, {
- base: 'Dz',
- letters: "\u01F2\u01C5"
-}, {
- base: 'E',
- letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
-}, {
- base: 'F',
- letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
-}, {
- base: 'G',
- letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
-}, {
- base: 'H',
- letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
-}, {
- base: 'I',
- letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
-}, {
- base: 'J',
- letters: "J\u24BF\uFF2A\u0134\u0248"
-}, {
- base: 'K',
- letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
-}, {
- base: 'L',
- letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
-}, {
- base: 'LJ',
- letters: "\u01C7"
-}, {
- base: 'Lj',
- letters: "\u01C8"
-}, {
- base: 'M',
- letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
-}, {
- base: 'N',
- letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
-}, {
- base: 'NJ',
- letters: "\u01CA"
-}, {
- base: 'Nj',
- letters: "\u01CB"
-}, {
- base: 'O',
- letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
-}, {
- base: 'OI',
- letters: "\u01A2"
-}, {
- base: 'OO',
- letters: "\uA74E"
-}, {
- base: 'OU',
- letters: "\u0222"
-}, {
- base: 'P',
- letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
-}, {
- base: 'Q',
- letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
-}, {
- base: 'R',
- letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
-}, {
- base: 'S',
- letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
-}, {
- base: 'T',
- letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
-}, {
- base: 'TZ',
- letters: "\uA728"
-}, {
- base: 'U',
- letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
-}, {
- base: 'V',
- letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
-}, {
- base: 'VY',
- letters: "\uA760"
-}, {
- base: 'W',
- letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
-}, {
- base: 'X',
- letters: "X\u24CD\uFF38\u1E8A\u1E8C"
-}, {
- base: 'Y',
- letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
-}, {
- base: 'Z',
- letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
-}, {
- base: 'a',
- letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
-}, {
- base: 'aa',
- letters: "\uA733"
-}, {
- base: 'ae',
- letters: "\xE6\u01FD\u01E3"
-}, {
- base: 'ao',
- letters: "\uA735"
-}, {
- base: 'au',
- letters: "\uA737"
-}, {
- base: 'av',
- letters: "\uA739\uA73B"
-}, {
- base: 'ay',
- letters: "\uA73D"
-}, {
- base: 'b',
- letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
-}, {
- base: 'c',
- letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
-}, {
- base: 'd',
- letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
-}, {
- base: 'dz',
- letters: "\u01F3\u01C6"
-}, {
- base: 'e',
- letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
-}, {
- base: 'f',
- letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
-}, {
- base: 'g',
- letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
-}, {
- base: 'h',
- letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
-}, {
- base: 'hv',
- letters: "\u0195"
-}, {
- base: 'i',
- letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
-}, {
- base: 'j',
- letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
-}, {
- base: 'k',
- letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
-}, {
- base: 'l',
- letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
-}, {
- base: 'lj',
- letters: "\u01C9"
-}, {
- base: 'm',
- letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
-}, {
- base: 'n',
- letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
-}, {
- base: 'nj',
- letters: "\u01CC"
-}, {
- base: 'o',
- letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
-}, {
- base: 'oi',
- letters: "\u01A3"
-}, {
- base: 'ou',
- letters: "\u0223"
-}, {
- base: 'oo',
- letters: "\uA74F"
-}, {
- base: 'p',
- letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
-}, {
- base: 'q',
- letters: "q\u24E0\uFF51\u024B\uA757\uA759"
-}, {
- base: 'r',
- letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
-}, {
- base: 's',
- letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
-}, {
- base: 't',
- letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
-}, {
- base: 'tz',
- letters: "\uA729"
-}, {
- base: 'u',
- letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
-}, {
- base: 'v',
- letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
-}, {
- base: 'vy',
- letters: "\uA761"
-}, {
- base: 'w',
- letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
-}, {
- base: 'x',
- letters: "x\u24E7\uFF58\u1E8B\u1E8D"
-}, {
- base: 'y',
- letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
-}, {
- base: 'z',
- letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
-}];
-var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
- return d.letters;
-}).join('') + ']', 'g');
-var diacriticToBase = {};
-for (var i = 0; i < diacritics.length; i++) {
- var diacritic = diacritics[i];
- for (var j = 0; j < diacritic.letters.length; j++) {
- diacriticToBase[diacritic.letters[j]] = diacritic.base;
- }
-}
-var stripDiacritics = function stripDiacritics(str) {
- return str.replace(anyDiacritic, function (match) {
- return diacriticToBase[match];
- });
-};
-
-var memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics);
-var trimString = function trimString(str) {
- return str.replace(/^\s+|\s+$/g, '');
-};
-var defaultStringify = function defaultStringify(option) {
- return "".concat(option.label, " ").concat(option.value);
-};
-var createFilter = function createFilter(config) {
- return function (option, rawInput) {
- // eslint-disable-next-line no-underscore-dangle
- if (option.data.__isNew__) return true;
- var _ignoreCase$ignoreAcc = _objectSpread({
- ignoreCase: true,
- ignoreAccents: true,
- stringify: defaultStringify,
- trim: true,
- matchFrom: 'any'
- }, config),
- ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,
- ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,
- stringify = _ignoreCase$ignoreAcc.stringify,
- trim = _ignoreCase$ignoreAcc.trim,
- matchFrom = _ignoreCase$ignoreAcc.matchFrom;
- var input = trim ? trimString(rawInput) : rawInput;
- var candidate = trim ? trimString(stringify(option)) : stringify(option);
- if (ignoreCase) {
- input = input.toLowerCase();
- candidate = candidate.toLowerCase();
- }
- if (ignoreAccents) {
- input = memoizedStripDiacriticsForInput(input);
- candidate = stripDiacritics(candidate);
- }
- return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
- };
-};
-
-var _excluded = ["innerRef"];
-function DummyInput(_ref) {
- var innerRef = _ref.innerRef,
- props = _objectWithoutProperties(_ref, _excluded);
- // Remove animation props not meant for HTML elements
- var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
- return jsx("input", _extends({
- ref: innerRef
- }, filteredProps, {
- css: /*#__PURE__*/css({
- label: 'dummyInput',
- // get rid of any default styles
- background: 0,
- border: 0,
- // important! this hides the flashing cursor
- caretColor: 'transparent',
- fontSize: 'inherit',
- gridArea: '1 / 1 / 2 / 3',
- outline: 0,
- padding: 0,
- // important! without `width` browsers won't allow focus
- width: 1,
- // remove cursor on desktop
- color: 'transparent',
- // remove cursor on mobile whilst maintaining "scroll into view" behaviour
- left: -100,
- opacity: 0,
- position: 'relative',
- transform: 'scale(.01)'
- }, process.env.NODE_ENV === "production" ? "" : ";label:DummyInput;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")
- }));
-}
-
-var cancelScroll = function cancelScroll(event) {
- event.preventDefault();
- event.stopPropagation();
-};
-function useScrollCapture(_ref) {
- var isEnabled = _ref.isEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var isBottom = useRef(false);
- var isTop = useRef(false);
- var touchStart = useRef(0);
- var scrollTarget = useRef(null);
- var handleEventDelta = useCallback(function (event, delta) {
- if (scrollTarget.current === null) return;
- var _scrollTarget$current = scrollTarget.current,
- scrollTop = _scrollTarget$current.scrollTop,
- scrollHeight = _scrollTarget$current.scrollHeight,
- clientHeight = _scrollTarget$current.clientHeight;
- var target = scrollTarget.current;
- var isDeltaPositive = delta > 0;
- var availableScroll = scrollHeight - clientHeight - scrollTop;
- var shouldCancelScroll = false;
-
- // reset bottom/top flags
- if (availableScroll > delta && isBottom.current) {
- if (onBottomLeave) onBottomLeave(event);
- isBottom.current = false;
- }
- if (isDeltaPositive && isTop.current) {
- if (onTopLeave) onTopLeave(event);
- isTop.current = false;
- }
-
- // bottom limit
- if (isDeltaPositive && delta > availableScroll) {
- if (onBottomArrive && !isBottom.current) {
- onBottomArrive(event);
- }
- target.scrollTop = scrollHeight;
- shouldCancelScroll = true;
- isBottom.current = true;
-
- // top limit
- } else if (!isDeltaPositive && -delta > scrollTop) {
- if (onTopArrive && !isTop.current) {
- onTopArrive(event);
- }
- target.scrollTop = 0;
- shouldCancelScroll = true;
- isTop.current = true;
- }
-
- // cancel scroll
- if (shouldCancelScroll) {
- cancelScroll(event);
- }
- }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
- var onWheel = useCallback(function (event) {
- handleEventDelta(event, event.deltaY);
- }, [handleEventDelta]);
- var onTouchStart = useCallback(function (event) {
- // set touch start so we can calculate touchmove delta
- touchStart.current = event.changedTouches[0].clientY;
- }, []);
- var onTouchMove = useCallback(function (event) {
- var deltaY = touchStart.current - event.changedTouches[0].clientY;
- handleEventDelta(event, deltaY);
- }, [handleEventDelta]);
- var startListening = useCallback(function (el) {
- // bail early if no element is available to attach to
- if (!el) return;
- var notPassive = supportsPassiveEvents ? {
- passive: false
- } : false;
- el.addEventListener('wheel', onWheel, notPassive);
- el.addEventListener('touchstart', onTouchStart, notPassive);
- el.addEventListener('touchmove', onTouchMove, notPassive);
- }, [onTouchMove, onTouchStart, onWheel]);
- var stopListening = useCallback(function (el) {
- // bail early if no element is available to detach from
- if (!el) return;
- el.removeEventListener('wheel', onWheel, false);
- el.removeEventListener('touchstart', onTouchStart, false);
- el.removeEventListener('touchmove', onTouchMove, false);
- }, [onTouchMove, onTouchStart, onWheel]);
- useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- startListening(element);
- return function () {
- stopListening(element);
- };
- }, [isEnabled, startListening, stopListening]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];
-var LOCK_STYLES = {
- boxSizing: 'border-box',
- // account for possible declaration `width: 100%;` on body
- overflow: 'hidden',
- position: 'relative',
- height: '100%'
-};
-function preventTouchMove(e) {
- e.preventDefault();
-}
-function allowTouchMove(e) {
- e.stopPropagation();
-}
-function preventInertiaScroll() {
- var top = this.scrollTop;
- var totalScroll = this.scrollHeight;
- var currentScroll = top + this.offsetHeight;
- if (top === 0) {
- this.scrollTop = 1;
- } else if (currentScroll === totalScroll) {
- this.scrollTop = top - 1;
- }
-}
-
-// `ontouchstart` check works on most browsers
-// `maxTouchPoints` works on IE10/11 and Surface
-function isTouchDevice() {
- return 'ontouchstart' in window || navigator.maxTouchPoints;
-}
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-var activeScrollLocks = 0;
-var listenerOptions = {
- capture: false,
- passive: false
-};
-function useScrollLock(_ref) {
- var isEnabled = _ref.isEnabled,
- _ref$accountForScroll = _ref.accountForScrollbars,
- accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
- var originalStyles = useRef({});
- var scrollTarget = useRef(null);
- var addScrollLock = useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
- if (accountForScrollbars) {
- // store any styles already applied to the body
- STYLE_KEYS.forEach(function (key) {
- var val = targetStyle && targetStyle[key];
- originalStyles.current[key] = val;
- });
- }
-
- // apply the lock styles and padding if this is the first scroll lock
- if (accountForScrollbars && activeScrollLocks < 1) {
- var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
- var clientWidth = document.body ? document.body.clientWidth : 0;
- var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
- Object.keys(LOCK_STYLES).forEach(function (key) {
- var val = LOCK_STYLES[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- if (targetStyle) {
- targetStyle.paddingRight = "".concat(adjustedPadding, "px");
- }
- }
-
- // account for touch devices
- if (target && isTouchDevice()) {
- // Mobile Safari ignores { overflow: hidden } declaration on the body.
- target.addEventListener('touchmove', preventTouchMove, listenerOptions);
-
- // Allow scroll on provided target
- if (touchScrollTarget) {
- touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
-
- // increment active scroll locks
- activeScrollLocks += 1;
- }, [accountForScrollbars]);
- var removeScrollLock = useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
-
- // safely decrement active scroll locks
- activeScrollLocks = Math.max(activeScrollLocks - 1, 0);
-
- // reapply original body styles, if any
- if (accountForScrollbars && activeScrollLocks < 1) {
- STYLE_KEYS.forEach(function (key) {
- var val = originalStyles.current[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- }
-
- // remove touch listeners
- if (target && isTouchDevice()) {
- target.removeEventListener('touchmove', preventTouchMove, listenerOptions);
- if (touchScrollTarget) {
- touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
- }, [accountForScrollbars]);
- useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- addScrollLock(element);
- return function () {
- removeScrollLock(element);
- };
- }, [isEnabled, addScrollLock, removeScrollLock]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-var blurSelectInput = function blurSelectInput() {
- return document.activeElement && document.activeElement.blur();
-};
-var _ref2$1 = process.env.NODE_ENV === "production" ? {
- name: "1kfdb0e",
- styles: "position:fixed;left:0;bottom:0;right:0;top:0"
-} : {
- name: "bp8cua-ScrollManager",
- styles: "position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStDVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2sgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9ICgpID0+XG4gIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgJiYgKGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgYXMgSFRNTEVsZW1lbnQpLmJsdXIoKTtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gU2Nyb2xsTWFuYWdlcih7XG4gIGNoaWxkcmVuLFxuICBsb2NrRW5hYmxlZCxcbiAgY2FwdHVyZUVuYWJsZWQgPSB0cnVlLFxuICBvbkJvdHRvbUFycml2ZSxcbiAgb25Cb3R0b21MZWF2ZSxcbiAgb25Ub3BBcnJpdmUsXG4gIG9uVG9wTGVhdmUsXG59OiBQcm9wcykge1xuICBjb25zdCBzZXRTY3JvbGxDYXB0dXJlVGFyZ2V0ID0gdXNlU2Nyb2xsQ2FwdHVyZSh7XG4gICAgaXNFbmFibGVkOiBjYXB0dXJlRW5hYmxlZCxcbiAgICBvbkJvdHRvbUFycml2ZSxcbiAgICBvbkJvdHRvbUxlYXZlLFxuICAgIG9uVG9wQXJyaXZlLFxuICAgIG9uVG9wTGVhdmUsXG4gIH0pO1xuICBjb25zdCBzZXRTY3JvbGxMb2NrVGFyZ2V0ID0gdXNlU2Nyb2xsTG9jayh7IGlzRW5hYmxlZDogbG9ja0VuYWJsZWQgfSk7XG5cbiAgY29uc3QgdGFyZ2V0UmVmOiBSZWZDYWxsYmFjazxIVE1MRWxlbWVudD4gPSAoZWxlbWVudCkgPT4ge1xuICAgIHNldFNjcm9sbENhcHR1cmVUYXJnZXQoZWxlbWVudCk7XG4gICAgc2V0U2Nyb2xsTG9ja1RhcmdldChlbGVtZW50KTtcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxGcmFnbWVudD5cbiAgICAgIHtsb2NrRW5hYmxlZCAmJiAoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBvbkNsaWNrPXtibHVyU2VsZWN0SW5wdXR9XG4gICAgICAgICAgY3NzPXt7IHBvc2l0aW9uOiAnZml4ZWQnLCBsZWZ0OiAwLCBib3R0b206IDAsIHJpZ2h0OiAwLCB0b3A6IDAgfX1cbiAgICAgICAgLz5cbiAgICAgICl9XG4gICAgICB7Y2hpbGRyZW4odGFyZ2V0UmVmKX1cbiAgICA8L0ZyYWdtZW50PlxuICApO1xufVxuIl19 */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
-};
-function ScrollManager(_ref) {
- var children = _ref.children,
- lockEnabled = _ref.lockEnabled,
- _ref$captureEnabled = _ref.captureEnabled,
- captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var setScrollCaptureTarget = useScrollCapture({
- isEnabled: captureEnabled,
- onBottomArrive: onBottomArrive,
- onBottomLeave: onBottomLeave,
- onTopArrive: onTopArrive,
- onTopLeave: onTopLeave
- });
- var setScrollLockTarget = useScrollLock({
- isEnabled: lockEnabled
- });
- var targetRef = function targetRef(element) {
- setScrollCaptureTarget(element);
- setScrollLockTarget(element);
- };
- return jsx(Fragment, null, lockEnabled && jsx("div", {
- onClick: blurSelectInput,
- css: _ref2$1
- }), children(targetRef));
-}
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-var _ref2 = process.env.NODE_ENV === "production" ? {
- name: "1a0ro4n-requiredInput",
- styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
-} : {
- name: "5kkxb2-requiredInput-RequiredInput",
- styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZTogc3RyaW5nO1xuICByZWFkb25seSBvbkZvY3VzOiBGb2N1c0V2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0+ID0gKHsgbmFtZSwgb25Gb2N1cyB9KSA9PiAoXG4gIDxpbnB1dFxuICAgIHJlcXVpcmVkXG4gICAgbmFtZT17bmFtZX1cbiAgICB0YWJJbmRleD17LTF9XG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
-};
-var RequiredInput = function RequiredInput(_ref) {
- var name = _ref.name,
- onFocus = _ref.onFocus;
- return jsx("input", {
- required: true,
- name: name,
- tabIndex: -1,
- onFocus: onFocus,
- css: _ref2
- // Prevent `Switching from uncontrolled to controlled` error
- ,
- value: "",
- onChange: function onChange() {}
- });
-};
-
-var formatGroupLabel = function formatGroupLabel(group) {
- return group.label;
-};
-var getOptionLabel$1 = function getOptionLabel(option) {
- return option.label;
-};
-var getOptionValue$1 = function getOptionValue(option) {
- return option.value;
-};
-var isOptionDisabled = function isOptionDisabled(option) {
- return !!option.isDisabled;
-};
-
-var defaultStyles = {
- clearIndicator: clearIndicatorCSS,
- container: containerCSS,
- control: css$1,
- dropdownIndicator: dropdownIndicatorCSS,
- group: groupCSS,
- groupHeading: groupHeadingCSS,
- indicatorsContainer: indicatorsContainerCSS,
- indicatorSeparator: indicatorSeparatorCSS,
- input: inputCSS,
- loadingIndicator: loadingIndicatorCSS,
- loadingMessage: loadingMessageCSS,
- menu: menuCSS,
- menuList: menuListCSS,
- menuPortal: menuPortalCSS,
- multiValue: multiValueCSS,
- multiValueLabel: multiValueLabelCSS,
- multiValueRemove: multiValueRemoveCSS,
- noOptionsMessage: noOptionsMessageCSS,
- option: optionCSS,
- placeholder: placeholderCSS,
- singleValue: css$2,
- valueContainer: valueContainerCSS
-};
-// Merge Utility
-// Allows consumers to extend a base Select with additional styles
-
-function mergeStyles(source) {
- var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- // initialize with source styles
- var styles = _objectSpread({}, source);
-
- // massage in target styles
- Object.keys(target).forEach(function (keyAsString) {
- var key = keyAsString;
- if (source[key]) {
- styles[key] = function (rsCss, props) {
- return target[key](source[key](rsCss, props), props);
- };
- } else {
- styles[key] = target[key];
- }
- });
- return styles;
-}
-
-var colors = {
- primary: '#2684FF',
- primary75: '#4C9AFF',
- primary50: '#B2D4FF',
- primary25: '#DEEBFF',
- danger: '#DE350B',
- dangerLight: '#FFBDAD',
- neutral0: 'hsl(0, 0%, 100%)',
- neutral5: 'hsl(0, 0%, 95%)',
- neutral10: 'hsl(0, 0%, 90%)',
- neutral20: 'hsl(0, 0%, 80%)',
- neutral30: 'hsl(0, 0%, 70%)',
- neutral40: 'hsl(0, 0%, 60%)',
- neutral50: 'hsl(0, 0%, 50%)',
- neutral60: 'hsl(0, 0%, 40%)',
- neutral70: 'hsl(0, 0%, 30%)',
- neutral80: 'hsl(0, 0%, 20%)',
- neutral90: 'hsl(0, 0%, 10%)'
-};
-var borderRadius = 4;
-// Used to calculate consistent margin/padding on elements
-var baseUnit = 4;
-// The minimum height of the control
-var controlHeight = 38;
-// The amount of space between the control and menu */
-var menuGutter = baseUnit * 2;
-var spacing = {
- baseUnit: baseUnit,
- controlHeight: controlHeight,
- menuGutter: menuGutter
-};
-var defaultTheme = {
- borderRadius: borderRadius,
- colors: colors,
- spacing: spacing
-};
-
-var defaultProps = {
- 'aria-live': 'polite',
- backspaceRemovesValue: true,
- blurInputOnSelect: isTouchCapable(),
- captureMenuScroll: !isTouchCapable(),
- classNames: {},
- closeMenuOnSelect: true,
- closeMenuOnScroll: false,
- components: {},
- controlShouldRenderValue: true,
- escapeClearsValue: false,
- filterOption: createFilter(),
- formatGroupLabel: formatGroupLabel,
- getOptionLabel: getOptionLabel$1,
- getOptionValue: getOptionValue$1,
- isDisabled: false,
- isLoading: false,
- isMulti: false,
- isRtl: false,
- isSearchable: true,
- isOptionDisabled: isOptionDisabled,
- loadingMessage: function loadingMessage() {
- return 'Loading...';
- },
- maxMenuHeight: 300,
- minMenuHeight: 140,
- menuIsOpen: false,
- menuPlacement: 'bottom',
- menuPosition: 'absolute',
- menuShouldBlockScroll: false,
- menuShouldScrollIntoView: !isMobileDevice(),
- noOptionsMessage: function noOptionsMessage() {
- return 'No options';
- },
- openMenuOnFocus: false,
- openMenuOnClick: true,
- options: [],
- pageSize: 5,
- placeholder: 'Select...',
- screenReaderStatus: function screenReaderStatus(_ref) {
- var count = _ref.count;
- return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available");
- },
- styles: {},
- tabIndex: 0,
- tabSelectsValue: true,
- unstyled: false
-};
-function toCategorizedOption(props, option, selectValue, index) {
- var isDisabled = _isOptionDisabled(props, option, selectValue);
- var isSelected = _isOptionSelected(props, option, selectValue);
- var label = getOptionLabel(props, option);
- var value = getOptionValue(props, option);
- return {
- type: 'option',
- data: option,
- isDisabled: isDisabled,
- isSelected: isSelected,
- label: label,
- value: value,
- index: index
- };
-}
-function buildCategorizedOptions(props, selectValue) {
- return props.options.map(function (groupOrOption, groupOrOptionIndex) {
- if ('options' in groupOrOption) {
- var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) {
- return toCategorizedOption(props, option, selectValue, optionIndex);
- }).filter(function (categorizedOption) {
- return isFocusable(props, categorizedOption);
- });
- return categorizedOptions.length > 0 ? {
- type: 'group',
- data: groupOrOption,
- options: categorizedOptions,
- index: groupOrOptionIndex
- } : undefined;
- }
- var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
- return isFocusable(props, categorizedOption) ? categorizedOption : undefined;
- }).filter(notNullish);
-}
-function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
- if (categorizedOption.type === 'group') {
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
- return option.data;
- })));
- } else {
- optionsAccumulator.push(categorizedOption.data);
- }
- return optionsAccumulator;
- }, []);
-}
-function buildFocusableOptions(props, selectValue) {
- return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
-}
-function isFocusable(props, categorizedOption) {
- var _props$inputValue = props.inputValue,
- inputValue = _props$inputValue === void 0 ? '' : _props$inputValue;
- var data = categorizedOption.data,
- isSelected = categorizedOption.isSelected,
- label = categorizedOption.label,
- value = categorizedOption.value;
- return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
- label: label,
- value: value,
- data: data
- }, inputValue);
-}
-function getNextFocusedValue(state, nextSelectValue) {
- var focusedValue = state.focusedValue,
- lastSelectValue = state.selectValue;
- var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
- if (lastFocusedIndex > -1) {
- var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
- if (nextFocusedIndex > -1) {
- // the focused value is still in the selectValue, return it
- return focusedValue;
- } else if (lastFocusedIndex < nextSelectValue.length) {
- // the focusedValue is not present in the next selectValue array by
- // reference, so return the new value at the same index
- return nextSelectValue[lastFocusedIndex];
- }
- }
- return null;
-}
-function getNextFocusedOption(state, options) {
- var lastFocusedOption = state.focusedOption;
- return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
-}
-var getOptionLabel = function getOptionLabel(props, data) {
- return props.getOptionLabel(data);
-};
-var getOptionValue = function getOptionValue(props, data) {
- return props.getOptionValue(data);
-};
-function _isOptionDisabled(props, option, selectValue) {
- return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false;
-}
-function _isOptionSelected(props, option, selectValue) {
- if (selectValue.indexOf(option) > -1) return true;
- if (typeof props.isOptionSelected === 'function') {
- return props.isOptionSelected(option, selectValue);
- }
- var candidate = getOptionValue(props, option);
- return selectValue.some(function (i) {
- return getOptionValue(props, i) === candidate;
- });
-}
-function _filterOption(props, option, inputValue) {
- return props.filterOption ? props.filterOption(option, inputValue) : true;
-}
-var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) {
- var hideSelectedOptions = props.hideSelectedOptions,
- isMulti = props.isMulti;
- if (hideSelectedOptions === undefined) return isMulti;
- return hideSelectedOptions;
-};
-var instanceId = 1;
-var Select = /*#__PURE__*/function (_Component) {
- _inherits(Select, _Component);
- var _super = _createSuper(Select);
- // Misc. Instance Properties
- // ------------------------------
-
- // TODO
-
- // Refs
- // ------------------------------
-
- // Lifecycle
- // ------------------------------
-
- function Select(_props) {
- var _this;
- _classCallCheck(this, Select);
- _this = _super.call(this, _props);
- _this.state = {
- ariaSelection: null,
- focusedOption: null,
- focusedValue: null,
- inputIsHidden: false,
- isFocused: false,
- selectValue: [],
- clearFocusValueOnUpdate: false,
- prevWasFocused: false,
- inputIsHiddenAfterUpdate: undefined,
- prevProps: undefined
- };
- _this.blockOptionHover = false;
- _this.isComposing = false;
- _this.commonProps = void 0;
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- _this.instancePrefix = '';
- _this.openAfterFocus = false;
- _this.scrollToFocusedOptionOnUpdate = false;
- _this.userIsDragging = void 0;
- _this.controlRef = null;
- _this.getControlRef = function (ref) {
- _this.controlRef = ref;
- };
- _this.focusedOptionRef = null;
- _this.getFocusedOptionRef = function (ref) {
- _this.focusedOptionRef = ref;
- };
- _this.menuListRef = null;
- _this.getMenuListRef = function (ref) {
- _this.menuListRef = ref;
- };
- _this.inputRef = null;
- _this.getInputRef = function (ref) {
- _this.inputRef = ref;
- };
- _this.focus = _this.focusInput;
- _this.blur = _this.blurInput;
- _this.onChange = function (newValue, actionMeta) {
- var _this$props = _this.props,
- onChange = _this$props.onChange,
- name = _this$props.name;
- actionMeta.name = name;
- _this.ariaOnChange(newValue, actionMeta);
- onChange(newValue, actionMeta);
- };
- _this.setValue = function (newValue, action, option) {
- var _this$props2 = _this.props,
- closeMenuOnSelect = _this$props2.closeMenuOnSelect,
- isMulti = _this$props2.isMulti,
- inputValue = _this$props2.inputValue;
- _this.onInputChange('', {
- action: 'set-value',
- prevInputValue: inputValue
- });
- if (closeMenuOnSelect) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- }
- // when the select value should change, we should reset focusedValue
- _this.setState({
- clearFocusValueOnUpdate: true
- });
- _this.onChange(newValue, {
- action: action,
- option: option
- });
- };
- _this.selectOption = function (newValue) {
- var _this$props3 = _this.props,
- blurInputOnSelect = _this$props3.blurInputOnSelect,
- isMulti = _this$props3.isMulti,
- name = _this$props3.name;
- var selectValue = _this.state.selectValue;
- var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
- var isDisabled = _this.isOptionDisabled(newValue, selectValue);
- if (deselected) {
- var candidate = _this.getOptionValue(newValue);
- _this.setValue(multiValueAsValue(selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- })), 'deselect-option', newValue);
- } else if (!isDisabled) {
- // Select option if option is not disabled
- if (isMulti) {
- _this.setValue(multiValueAsValue([].concat(_toConsumableArray(selectValue), [newValue])), 'select-option', newValue);
- } else {
- _this.setValue(singleValueAsValue(newValue), 'select-option');
- }
- } else {
- _this.ariaOnChange(singleValueAsValue(newValue), {
- action: 'select-option',
- option: newValue,
- name: name
- });
- return;
- }
- if (blurInputOnSelect) {
- _this.blurInput();
- }
- };
- _this.removeValue = function (removedValue) {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var candidate = _this.getOptionValue(removedValue);
- var newValueArray = selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- });
- var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'remove-value',
- removedValue: removedValue
- });
- _this.focusInput();
- };
- _this.clearValue = function () {
- var selectValue = _this.state.selectValue;
- _this.onChange(valueTernary(_this.props.isMulti, [], null), {
- action: 'clear',
- removedValues: selectValue
- });
- };
- _this.popValue = function () {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var lastSelectedValue = selectValue[selectValue.length - 1];
- var newValueArray = selectValue.slice(0, selectValue.length - 1);
- var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'pop-value',
- removedValue: lastSelectedValue
- });
- };
- _this.getValue = function () {
- return _this.state.selectValue;
- };
- _this.cx = function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
- };
- _this.getOptionLabel = function (data) {
- return getOptionLabel(_this.props, data);
- };
- _this.getOptionValue = function (data) {
- return getOptionValue(_this.props, data);
- };
- _this.getStyles = function (key, props) {
- var unstyled = _this.props.unstyled;
- var base = defaultStyles[key](props, unstyled);
- base.boxSizing = 'border-box';
- var custom = _this.props.styles[key];
- return custom ? custom(base, props) : base;
- };
- _this.getClassNames = function (key, props) {
- var _this$props$className, _this$props$className2;
- return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
- };
- _this.getElementId = function (element) {
- return "".concat(_this.instancePrefix, "-").concat(element);
- };
- _this.getComponents = function () {
- return defaultComponents(_this.props);
- };
- _this.buildCategorizedOptions = function () {
- return buildCategorizedOptions(_this.props, _this.state.selectValue);
- };
- _this.getCategorizedOptions = function () {
- return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
- };
- _this.buildFocusableOptions = function () {
- return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
- };
- _this.getFocusableOptions = function () {
- return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
- };
- _this.ariaOnChange = function (value, actionMeta) {
- _this.setState({
- ariaSelection: _objectSpread({
- value: value
- }, actionMeta)
- });
- };
- _this.onMenuMouseDown = function (event) {
- if (event.button !== 0) {
- return;
- }
- event.stopPropagation();
- event.preventDefault();
- _this.focusInput();
- };
- _this.onMenuMouseMove = function (event) {
- _this.blockOptionHover = false;
- };
- _this.onControlMouseDown = function (event) {
- // Event captured by dropdown indicator
- if (event.defaultPrevented) {
- return;
- }
- var openMenuOnClick = _this.props.openMenuOnClick;
- if (!_this.state.isFocused) {
- if (openMenuOnClick) {
- _this.openAfterFocus = true;
- }
- _this.focusInput();
- } else if (!_this.props.menuIsOpen) {
- if (openMenuOnClick) {
- _this.openMenu('first');
- }
- } else {
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- _this.onMenuClose();
- }
- }
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- event.preventDefault();
- }
- };
- _this.onDropdownIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- if (_this.props.isDisabled) return;
- var _this$props4 = _this.props,
- isMulti = _this$props4.isMulti,
- menuIsOpen = _this$props4.menuIsOpen;
- _this.focusInput();
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- } else {
- _this.openMenu('first');
- }
- event.preventDefault();
- };
- _this.onClearIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- _this.clearValue();
- event.preventDefault();
- _this.openAfterFocus = false;
- if (event.type === 'touchend') {
- _this.focusInput();
- } else {
- setTimeout(function () {
- return _this.focusInput();
- });
- }
- };
- _this.onScroll = function (event) {
- if (typeof _this.props.closeMenuOnScroll === 'boolean') {
- if (event.target instanceof HTMLElement && isDocumentElement(event.target)) {
- _this.props.onMenuClose();
- }
- } else if (typeof _this.props.closeMenuOnScroll === 'function') {
- if (_this.props.closeMenuOnScroll(event)) {
- _this.props.onMenuClose();
- }
- }
- };
- _this.onCompositionStart = function () {
- _this.isComposing = true;
- };
- _this.onCompositionEnd = function () {
- _this.isComposing = false;
- };
- _this.onTouchStart = function (_ref2) {
- var touches = _ref2.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- _this.initialTouchX = touch.clientX;
- _this.initialTouchY = touch.clientY;
- _this.userIsDragging = false;
- };
- _this.onTouchMove = function (_ref3) {
- var touches = _ref3.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- var deltaX = Math.abs(touch.clientX - _this.initialTouchX);
- var deltaY = Math.abs(touch.clientY - _this.initialTouchY);
- var moveThreshold = 5;
- _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
- };
- _this.onTouchEnd = function (event) {
- if (_this.userIsDragging) return;
-
- // close the menu if the user taps outside
- // we're checking on event.target here instead of event.currentTarget, because we want to assert information
- // on events on child elements, not the document (which we've attached this handler to).
- if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {
- _this.blurInput();
- }
-
- // reset move vars
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- };
- _this.onControlTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onControlMouseDown(event);
- };
- _this.onClearIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onClearIndicatorMouseDown(event);
- };
- _this.onDropdownIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onDropdownIndicatorMouseDown(event);
- };
- _this.handleInputChange = function (event) {
- var prevInputValue = _this.props.inputValue;
- var inputValue = event.currentTarget.value;
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange(inputValue, {
- action: 'input-change',
- prevInputValue: prevInputValue
- });
- if (!_this.props.menuIsOpen) {
- _this.onMenuOpen();
- }
- };
- _this.onInputFocus = function (event) {
- if (_this.props.onFocus) {
- _this.props.onFocus(event);
- }
- _this.setState({
- inputIsHiddenAfterUpdate: false,
- isFocused: true
- });
- if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
- _this.openMenu('first');
- }
- _this.openAfterFocus = false;
- };
- _this.onInputBlur = function (event) {
- var prevInputValue = _this.props.inputValue;
- if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
- _this.inputRef.focus();
- return;
- }
- if (_this.props.onBlur) {
- _this.props.onBlur(event);
- }
- _this.onInputChange('', {
- action: 'input-blur',
- prevInputValue: prevInputValue
- });
- _this.onMenuClose();
- _this.setState({
- focusedValue: null,
- isFocused: false
- });
- };
- _this.onOptionHover = function (focusedOption) {
- if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
- return;
- }
- _this.setState({
- focusedOption: focusedOption
- });
- };
- _this.shouldHideSelectedOptions = function () {
- return shouldHideSelectedOptions(_this.props);
- };
- _this.onValueInputFocus = function (e) {
- e.preventDefault();
- e.stopPropagation();
- _this.focus();
- };
- _this.onKeyDown = function (event) {
- var _this$props5 = _this.props,
- isMulti = _this$props5.isMulti,
- backspaceRemovesValue = _this$props5.backspaceRemovesValue,
- escapeClearsValue = _this$props5.escapeClearsValue,
- inputValue = _this$props5.inputValue,
- isClearable = _this$props5.isClearable,
- isDisabled = _this$props5.isDisabled,
- menuIsOpen = _this$props5.menuIsOpen,
- onKeyDown = _this$props5.onKeyDown,
- tabSelectsValue = _this$props5.tabSelectsValue,
- openMenuOnFocus = _this$props5.openMenuOnFocus;
- var _this$state = _this.state,
- focusedOption = _this$state.focusedOption,
- focusedValue = _this$state.focusedValue,
- selectValue = _this$state.selectValue;
- if (isDisabled) return;
- if (typeof onKeyDown === 'function') {
- onKeyDown(event);
- if (event.defaultPrevented) {
- return;
- }
- }
-
- // Block option hover events when the user has just pressed a key
- _this.blockOptionHover = true;
- switch (event.key) {
- case 'ArrowLeft':
- if (!isMulti || inputValue) return;
- _this.focusValue('previous');
- break;
- case 'ArrowRight':
- if (!isMulti || inputValue) return;
- _this.focusValue('next');
- break;
- case 'Delete':
- case 'Backspace':
- if (inputValue) return;
- if (focusedValue) {
- _this.removeValue(focusedValue);
- } else {
- if (!backspaceRemovesValue) return;
- if (isMulti) {
- _this.popValue();
- } else if (isClearable) {
- _this.clearValue();
- }
- }
- break;
- case 'Tab':
- if (_this.isComposing) return;
- if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption ||
- // don't capture the event if the menu opens on focus and the focused
- // option is already selected; it breaks the flow of navigation
- openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
- return;
- }
- _this.selectOption(focusedOption);
- break;
- case 'Enter':
- if (event.keyCode === 229) {
- // ignore the keydown event from an Input Method Editor(IME)
- // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
- break;
- }
- if (menuIsOpen) {
- if (!focusedOption) return;
- if (_this.isComposing) return;
- _this.selectOption(focusedOption);
- break;
- }
- return;
- case 'Escape':
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: inputValue
- });
- _this.onMenuClose();
- } else if (isClearable && escapeClearsValue) {
- _this.clearValue();
- }
- break;
- case ' ':
- // space
- if (inputValue) {
- return;
- }
- if (!menuIsOpen) {
- _this.openMenu('first');
- break;
- }
- if (!focusedOption) return;
- _this.selectOption(focusedOption);
- break;
- case 'ArrowUp':
- if (menuIsOpen) {
- _this.focusOption('up');
- } else {
- _this.openMenu('last');
- }
- break;
- case 'ArrowDown':
- if (menuIsOpen) {
- _this.focusOption('down');
- } else {
- _this.openMenu('first');
- }
- break;
- case 'PageUp':
- if (!menuIsOpen) return;
- _this.focusOption('pageup');
- break;
- case 'PageDown':
- if (!menuIsOpen) return;
- _this.focusOption('pagedown');
- break;
- case 'Home':
- if (!menuIsOpen) return;
- _this.focusOption('first');
- break;
- case 'End':
- if (!menuIsOpen) return;
- _this.focusOption('last');
- break;
- default:
- return;
- }
- event.preventDefault();
- };
- _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
- _this.state.selectValue = cleanValue(_props.value);
-
- // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
- if (_props.menuIsOpen && _this.state.selectValue.length) {
- var focusableOptions = _this.buildFocusableOptions();
- var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
- _this.state.focusedOption = focusableOptions[optionIndex];
- }
- return _this;
- }
- _createClass(Select, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- this.startListeningComposition();
- this.startListeningToTouch();
- if (this.props.closeMenuOnScroll && document && document.addEventListener) {
- // Listen to all scroll events, and filter them out inside of 'onScroll'
- document.addEventListener('scroll', this.onScroll, true);
- }
- if (this.props.autoFocus) {
- this.focusInput();
- }
-
- // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen)
- if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
- scrollIntoView(this.menuListRef, this.focusedOptionRef);
- }
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate(prevProps) {
- var _this$props6 = this.props,
- isDisabled = _this$props6.isDisabled,
- menuIsOpen = _this$props6.menuIsOpen;
- var isFocused = this.state.isFocused;
- if (
- // ensure focus is restored correctly when the control becomes enabled
- isFocused && !isDisabled && prevProps.isDisabled ||
- // ensure focus is on the Input when the menu opens
- isFocused && menuIsOpen && !prevProps.menuIsOpen) {
- this.focusInput();
- }
- if (isFocused && isDisabled && !prevProps.isDisabled) {
- // ensure select state gets blurred in case Select is programmatically disabled while focused
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: false
- }, this.onMenuClose);
- } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
- // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: true
- });
- }
-
- // scroll the focused option into view if necessary
- if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
- scrollIntoView(this.menuListRef, this.focusedOptionRef);
- this.scrollToFocusedOptionOnUpdate = false;
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this.stopListeningComposition();
- this.stopListeningToTouch();
- document.removeEventListener('scroll', this.onScroll, true);
- }
-
- // ==============================
- // Consumer Handlers
- // ==============================
- }, {
- key: "onMenuOpen",
- value: function onMenuOpen() {
- this.props.onMenuOpen();
- }
- }, {
- key: "onMenuClose",
- value: function onMenuClose() {
- this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: this.props.inputValue
- });
- this.props.onMenuClose();
- }
- }, {
- key: "onInputChange",
- value: function onInputChange(newValue, actionMeta) {
- this.props.onInputChange(newValue, actionMeta);
- }
-
- // ==============================
- // Methods
- // ==============================
- }, {
- key: "focusInput",
- value: function focusInput() {
- if (!this.inputRef) return;
- this.inputRef.focus();
- }
- }, {
- key: "blurInput",
- value: function blurInput() {
- if (!this.inputRef) return;
- this.inputRef.blur();
- }
-
- // aliased for consumers
- }, {
- key: "openMenu",
- value: function openMenu(focusOption) {
- var _this2 = this;
- var _this$state2 = this.state,
- selectValue = _this$state2.selectValue,
- isFocused = _this$state2.isFocused;
- var focusableOptions = this.buildFocusableOptions();
- var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1;
- if (!this.props.isMulti) {
- var selectedIndex = focusableOptions.indexOf(selectValue[0]);
- if (selectedIndex > -1) {
- openAtIndex = selectedIndex;
- }
- }
-
- // only scroll if the menu isn't already open
- this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
- this.setState({
- inputIsHiddenAfterUpdate: false,
- focusedValue: null,
- focusedOption: focusableOptions[openAtIndex]
- }, function () {
- return _this2.onMenuOpen();
- });
- }
- }, {
- key: "focusValue",
- value: function focusValue(direction) {
- var _this$state3 = this.state,
- selectValue = _this$state3.selectValue,
- focusedValue = _this$state3.focusedValue;
-
- // Only multiselects support value focusing
- if (!this.props.isMulti) return;
- this.setState({
- focusedOption: null
- });
- var focusedIndex = selectValue.indexOf(focusedValue);
- if (!focusedValue) {
- focusedIndex = -1;
- }
- var lastIndex = selectValue.length - 1;
- var nextFocus = -1;
- if (!selectValue.length) return;
- switch (direction) {
- case 'previous':
- if (focusedIndex === 0) {
- // don't cycle from the start to the end
- nextFocus = 0;
- } else if (focusedIndex === -1) {
- // if nothing is focused, focus the last value first
- nextFocus = lastIndex;
- } else {
- nextFocus = focusedIndex - 1;
- }
- break;
- case 'next':
- if (focusedIndex > -1 && focusedIndex < lastIndex) {
- nextFocus = focusedIndex + 1;
- }
- break;
- }
- this.setState({
- inputIsHidden: nextFocus !== -1,
- focusedValue: selectValue[nextFocus]
- });
- }
- }, {
- key: "focusOption",
- value: function focusOption() {
- var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';
- var pageSize = this.props.pageSize;
- var focusedOption = this.state.focusedOption;
- var options = this.getFocusableOptions();
- if (!options.length) return;
- var nextFocus = 0; // handles 'first'
- var focusedIndex = options.indexOf(focusedOption);
- if (!focusedOption) {
- focusedIndex = -1;
- }
- if (direction === 'up') {
- nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
- } else if (direction === 'down') {
- nextFocus = (focusedIndex + 1) % options.length;
- } else if (direction === 'pageup') {
- nextFocus = focusedIndex - pageSize;
- if (nextFocus < 0) nextFocus = 0;
- } else if (direction === 'pagedown') {
- nextFocus = focusedIndex + pageSize;
- if (nextFocus > options.length - 1) nextFocus = options.length - 1;
- } else if (direction === 'last') {
- nextFocus = options.length - 1;
- }
- this.scrollToFocusedOptionOnUpdate = true;
- this.setState({
- focusedOption: options[nextFocus],
- focusedValue: null
- });
- }
- }, {
- key: "getTheme",
- value:
- // ==============================
- // Getters
- // ==============================
-
- function getTheme() {
- // Use the default theme if there are no customisations.
- if (!this.props.theme) {
- return defaultTheme;
- }
- // If the theme prop is a function, assume the function
- // knows how to merge the passed-in default theme with
- // its own modifications.
- if (typeof this.props.theme === 'function') {
- return this.props.theme(defaultTheme);
- }
- // Otherwise, if a plain theme object was passed in,
- // overlay it with the default theme.
- return _objectSpread(_objectSpread({}, defaultTheme), this.props.theme);
- }
- }, {
- key: "getCommonProps",
- value: function getCommonProps() {
- var clearValue = this.clearValue,
- cx = this.cx,
- getStyles = this.getStyles,
- getClassNames = this.getClassNames,
- getValue = this.getValue,
- selectOption = this.selectOption,
- setValue = this.setValue,
- props = this.props;
- var isMulti = props.isMulti,
- isRtl = props.isRtl,
- options = props.options;
- var hasValue = this.hasValue();
- return {
- clearValue: clearValue,
- cx: cx,
- getStyles: getStyles,
- getClassNames: getClassNames,
- getValue: getValue,
- hasValue: hasValue,
- isMulti: isMulti,
- isRtl: isRtl,
- options: options,
- selectOption: selectOption,
- selectProps: props,
- setValue: setValue,
- theme: this.getTheme()
- };
- }
- }, {
- key: "hasValue",
- value: function hasValue() {
- var selectValue = this.state.selectValue;
- return selectValue.length > 0;
- }
- }, {
- key: "hasOptions",
- value: function hasOptions() {
- return !!this.getFocusableOptions().length;
- }
- }, {
- key: "isClearable",
- value: function isClearable() {
- var _this$props7 = this.props,
- isClearable = _this$props7.isClearable,
- isMulti = _this$props7.isMulti;
-
- // single select, by default, IS NOT clearable
- // multi select, by default, IS clearable
- if (isClearable === undefined) return isMulti;
- return isClearable;
- }
- }, {
- key: "isOptionDisabled",
- value: function isOptionDisabled(option, selectValue) {
- return _isOptionDisabled(this.props, option, selectValue);
- }
- }, {
- key: "isOptionSelected",
- value: function isOptionSelected(option, selectValue) {
- return _isOptionSelected(this.props, option, selectValue);
- }
- }, {
- key: "filterOption",
- value: function filterOption(option, inputValue) {
- return _filterOption(this.props, option, inputValue);
- }
- }, {
- key: "formatOptionLabel",
- value: function formatOptionLabel(data, context) {
- if (typeof this.props.formatOptionLabel === 'function') {
- var _inputValue = this.props.inputValue;
- var _selectValue = this.state.selectValue;
- return this.props.formatOptionLabel(data, {
- context: context,
- inputValue: _inputValue,
- selectValue: _selectValue
- });
- } else {
- return this.getOptionLabel(data);
- }
- }
- }, {
- key: "formatGroupLabel",
- value: function formatGroupLabel(data) {
- return this.props.formatGroupLabel(data);
- }
-
- // ==============================
- // Mouse Handlers
- // ==============================
- }, {
- key: "startListeningComposition",
- value:
- // ==============================
- // Composition Handlers
- // ==============================
-
- function startListeningComposition() {
- if (document && document.addEventListener) {
- document.addEventListener('compositionstart', this.onCompositionStart, false);
- document.addEventListener('compositionend', this.onCompositionEnd, false);
- }
- }
- }, {
- key: "stopListeningComposition",
- value: function stopListeningComposition() {
- if (document && document.removeEventListener) {
- document.removeEventListener('compositionstart', this.onCompositionStart);
- document.removeEventListener('compositionend', this.onCompositionEnd);
- }
- }
- }, {
- key: "startListeningToTouch",
- value:
- // ==============================
- // Touch Handlers
- // ==============================
-
- function startListeningToTouch() {
- if (document && document.addEventListener) {
- document.addEventListener('touchstart', this.onTouchStart, false);
- document.addEventListener('touchmove', this.onTouchMove, false);
- document.addEventListener('touchend', this.onTouchEnd, false);
- }
- }
- }, {
- key: "stopListeningToTouch",
- value: function stopListeningToTouch() {
- if (document && document.removeEventListener) {
- document.removeEventListener('touchstart', this.onTouchStart);
- document.removeEventListener('touchmove', this.onTouchMove);
- document.removeEventListener('touchend', this.onTouchEnd);
- }
- }
- }, {
- key: "renderInput",
- value:
- // ==============================
- // Renderers
- // ==============================
- function renderInput() {
- var _this$props8 = this.props,
- isDisabled = _this$props8.isDisabled,
- isSearchable = _this$props8.isSearchable,
- inputId = _this$props8.inputId,
- inputValue = _this$props8.inputValue,
- tabIndex = _this$props8.tabIndex,
- form = _this$props8.form,
- menuIsOpen = _this$props8.menuIsOpen,
- required = _this$props8.required;
- var _this$getComponents = this.getComponents(),
- Input = _this$getComponents.Input;
- var _this$state4 = this.state,
- inputIsHidden = _this$state4.inputIsHidden,
- ariaSelection = _this$state4.ariaSelection;
- var commonProps = this.commonProps;
- var id = inputId || this.getElementId('input');
-
- // aria attributes makes the JSX "noisy", separated for clarity
- var ariaAttributes = _objectSpread(_objectSpread(_objectSpread({
- 'aria-autocomplete': 'list',
- 'aria-expanded': menuIsOpen,
- 'aria-haspopup': true,
- 'aria-errormessage': this.props['aria-errormessage'],
- 'aria-invalid': this.props['aria-invalid'],
- 'aria-label': this.props['aria-label'],
- 'aria-labelledby': this.props['aria-labelledby'],
- 'aria-required': required,
- role: 'combobox'
- }, menuIsOpen && {
- 'aria-controls': this.getElementId('listbox'),
- 'aria-owns': this.getElementId('listbox')
- }), !isSearchable && {
- 'aria-readonly': true
- }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
- 'aria-describedby': this.getElementId('live-region')
- } : {
- 'aria-describedby': this.getElementId('placeholder')
- });
- if (!isSearchable) {
- // use a dummy input to maintain focus/blur functionality
- return /*#__PURE__*/React.createElement(DummyInput, _extends({
- id: id,
- innerRef: this.getInputRef,
- onBlur: this.onInputBlur,
- onChange: noop,
- onFocus: this.onInputFocus,
- disabled: isDisabled,
- tabIndex: tabIndex,
- inputMode: "none",
- form: form,
- value: ""
- }, ariaAttributes));
- }
- return /*#__PURE__*/React.createElement(Input, _extends({}, commonProps, {
- autoCapitalize: "none",
- autoComplete: "off",
- autoCorrect: "off",
- id: id,
- innerRef: this.getInputRef,
- isDisabled: isDisabled,
- isHidden: inputIsHidden,
- onBlur: this.onInputBlur,
- onChange: this.handleInputChange,
- onFocus: this.onInputFocus,
- spellCheck: "false",
- tabIndex: tabIndex,
- form: form,
- type: "text",
- value: inputValue
- }, ariaAttributes));
- }
- }, {
- key: "renderPlaceholderOrValue",
- value: function renderPlaceholderOrValue() {
- var _this3 = this;
- var _this$getComponents2 = this.getComponents(),
- MultiValue = _this$getComponents2.MultiValue,
- MultiValueContainer = _this$getComponents2.MultiValueContainer,
- MultiValueLabel = _this$getComponents2.MultiValueLabel,
- MultiValueRemove = _this$getComponents2.MultiValueRemove,
- SingleValue = _this$getComponents2.SingleValue,
- Placeholder = _this$getComponents2.Placeholder;
- var commonProps = this.commonProps;
- var _this$props9 = this.props,
- controlShouldRenderValue = _this$props9.controlShouldRenderValue,
- isDisabled = _this$props9.isDisabled,
- isMulti = _this$props9.isMulti,
- inputValue = _this$props9.inputValue,
- placeholder = _this$props9.placeholder;
- var _this$state5 = this.state,
- selectValue = _this$state5.selectValue,
- focusedValue = _this$state5.focusedValue,
- isFocused = _this$state5.isFocused;
- if (!this.hasValue() || !controlShouldRenderValue) {
- return inputValue ? null : /*#__PURE__*/React.createElement(Placeholder, _extends({}, commonProps, {
- key: "placeholder",
- isDisabled: isDisabled,
- isFocused: isFocused,
- innerProps: {
- id: this.getElementId('placeholder')
- }
- }), placeholder);
- }
- if (isMulti) {
- return selectValue.map(function (opt, index) {
- var isOptionFocused = opt === focusedValue;
- var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
- return /*#__PURE__*/React.createElement(MultiValue, _extends({}, commonProps, {
- components: {
- Container: MultiValueContainer,
- Label: MultiValueLabel,
- Remove: MultiValueRemove
- },
- isFocused: isOptionFocused,
- isDisabled: isDisabled,
- key: key,
- index: index,
- removeProps: {
- onClick: function onClick() {
- return _this3.removeValue(opt);
- },
- onTouchEnd: function onTouchEnd() {
- return _this3.removeValue(opt);
- },
- onMouseDown: function onMouseDown(e) {
- e.preventDefault();
- }
- },
- data: opt
- }), _this3.formatOptionLabel(opt, 'value'));
- });
- }
- if (inputValue) {
- return null;
- }
- var singleValue = selectValue[0];
- return /*#__PURE__*/React.createElement(SingleValue, _extends({}, commonProps, {
- data: singleValue,
- isDisabled: isDisabled
- }), this.formatOptionLabel(singleValue, 'value'));
- }
- }, {
- key: "renderClearIndicator",
- value: function renderClearIndicator() {
- var _this$getComponents3 = this.getComponents(),
- ClearIndicator = _this$getComponents3.ClearIndicator;
- var commonProps = this.commonProps;
- var _this$props10 = this.props,
- isDisabled = _this$props10.isDisabled,
- isLoading = _this$props10.isLoading;
- var isFocused = this.state.isFocused;
- if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
- return null;
- }
- var innerProps = {
- onMouseDown: this.onClearIndicatorMouseDown,
- onTouchEnd: this.onClearIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React.createElement(ClearIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderLoadingIndicator",
- value: function renderLoadingIndicator() {
- var _this$getComponents4 = this.getComponents(),
- LoadingIndicator = _this$getComponents4.LoadingIndicator;
- var commonProps = this.commonProps;
- var _this$props11 = this.props,
- isDisabled = _this$props11.isDisabled,
- isLoading = _this$props11.isLoading;
- var isFocused = this.state.isFocused;
- if (!LoadingIndicator || !isLoading) return null;
- var innerProps = {
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderIndicatorSeparator",
- value: function renderIndicatorSeparator() {
- var _this$getComponents5 = this.getComponents(),
- DropdownIndicator = _this$getComponents5.DropdownIndicator,
- IndicatorSeparator = _this$getComponents5.IndicatorSeparator;
-
- // separator doesn't make sense without the dropdown indicator
- if (!DropdownIndicator || !IndicatorSeparator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- return /*#__PURE__*/React.createElement(IndicatorSeparator, _extends({}, commonProps, {
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderDropdownIndicator",
- value: function renderDropdownIndicator() {
- var _this$getComponents6 = this.getComponents(),
- DropdownIndicator = _this$getComponents6.DropdownIndicator;
- if (!DropdownIndicator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- var innerProps = {
- onMouseDown: this.onDropdownIndicatorMouseDown,
- onTouchEnd: this.onDropdownIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React.createElement(DropdownIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderMenu",
- value: function renderMenu() {
- var _this4 = this;
- var _this$getComponents7 = this.getComponents(),
- Group = _this$getComponents7.Group,
- GroupHeading = _this$getComponents7.GroupHeading,
- Menu = _this$getComponents7.Menu,
- MenuList = _this$getComponents7.MenuList,
- MenuPortal = _this$getComponents7.MenuPortal,
- LoadingMessage = _this$getComponents7.LoadingMessage,
- NoOptionsMessage = _this$getComponents7.NoOptionsMessage,
- Option = _this$getComponents7.Option;
- var commonProps = this.commonProps;
- var focusedOption = this.state.focusedOption;
- var _this$props12 = this.props,
- captureMenuScroll = _this$props12.captureMenuScroll,
- inputValue = _this$props12.inputValue,
- isLoading = _this$props12.isLoading,
- loadingMessage = _this$props12.loadingMessage,
- minMenuHeight = _this$props12.minMenuHeight,
- maxMenuHeight = _this$props12.maxMenuHeight,
- menuIsOpen = _this$props12.menuIsOpen,
- menuPlacement = _this$props12.menuPlacement,
- menuPosition = _this$props12.menuPosition,
- menuPortalTarget = _this$props12.menuPortalTarget,
- menuShouldBlockScroll = _this$props12.menuShouldBlockScroll,
- menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView,
- noOptionsMessage = _this$props12.noOptionsMessage,
- onMenuScrollToTop = _this$props12.onMenuScrollToTop,
- onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
- if (!menuIsOpen) return null;
-
- // TODO: Internal Option Type here
- var render = function render(props, id) {
- var type = props.type,
- data = props.data,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected,
- label = props.label,
- value = props.value;
- var isFocused = focusedOption === data;
- var onHover = isDisabled ? undefined : function () {
- return _this4.onOptionHover(data);
- };
- var onSelect = isDisabled ? undefined : function () {
- return _this4.selectOption(data);
- };
- var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
- var innerProps = {
- id: optionId,
- onClick: onSelect,
- onMouseMove: onHover,
- onMouseOver: onHover,
- tabIndex: -1
- };
- return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
- innerProps: innerProps,
- data: data,
- isDisabled: isDisabled,
- isSelected: isSelected,
- key: optionId,
- label: label,
- type: type,
- value: value,
- isFocused: isFocused,
- innerRef: isFocused ? _this4.getFocusedOptionRef : undefined
- }), _this4.formatOptionLabel(props.data, 'menu'));
- };
- var menuUI;
- if (this.hasOptions()) {
- menuUI = this.getCategorizedOptions().map(function (item) {
- if (item.type === 'group') {
- var _data = item.data,
- options = item.options,
- groupIndex = item.index;
- var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
- var headingId = "".concat(groupId, "-heading");
- return /*#__PURE__*/React.createElement(Group, _extends({}, commonProps, {
- key: groupId,
- data: _data,
- options: options,
- Heading: GroupHeading,
- headingProps: {
- id: headingId,
- data: item.data
- },
- label: _this4.formatGroupLabel(item.data)
- }), item.options.map(function (option) {
- return render(option, "".concat(groupIndex, "-").concat(option.index));
- }));
- } else if (item.type === 'option') {
- return render(item, "".concat(item.index));
- }
- });
- } else if (isLoading) {
- var message = loadingMessage({
- inputValue: inputValue
- });
- if (message === null) return null;
- menuUI = /*#__PURE__*/React.createElement(LoadingMessage, commonProps, message);
- } else {
- var _message = noOptionsMessage({
- inputValue: inputValue
- });
- if (_message === null) return null;
- menuUI = /*#__PURE__*/React.createElement(NoOptionsMessage, commonProps, _message);
- }
- var menuPlacementProps = {
- minMenuHeight: minMenuHeight,
- maxMenuHeight: maxMenuHeight,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition,
- menuShouldScrollIntoView: menuShouldScrollIntoView
- };
- var menuElement = /*#__PURE__*/React.createElement(MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref4) {
- var ref = _ref4.ref,
- _ref4$placerProps = _ref4.placerProps,
- placement = _ref4$placerProps.placement,
- maxHeight = _ref4$placerProps.maxHeight;
- return /*#__PURE__*/React.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {
- innerRef: ref,
- innerProps: {
- onMouseDown: _this4.onMenuMouseDown,
- onMouseMove: _this4.onMenuMouseMove,
- id: _this4.getElementId('listbox')
- },
- isLoading: isLoading,
- placement: placement
- }), /*#__PURE__*/React.createElement(ScrollManager, {
- captureEnabled: captureMenuScroll,
- onTopArrive: onMenuScrollToTop,
- onBottomArrive: onMenuScrollToBottom,
- lockEnabled: menuShouldBlockScroll
- }, function (scrollTargetRef) {
- return /*#__PURE__*/React.createElement(MenuList, _extends({}, commonProps, {
- innerRef: function innerRef(instance) {
- _this4.getMenuListRef(instance);
- scrollTargetRef(instance);
- },
- isLoading: isLoading,
- maxHeight: maxHeight,
- focusedOption: focusedOption
- }), menuUI);
- }));
- });
-
- // positioning behaviour is almost identical for portalled and fixed,
- // so we use the same component. the actual portalling logic is forked
- // within the component based on `menuPosition`
- return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React.createElement(MenuPortal, _extends({}, commonProps, {
- appendTo: menuPortalTarget,
- controlElement: this.controlRef,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition
- }), menuElement) : menuElement;
- }
- }, {
- key: "renderFormField",
- value: function renderFormField() {
- var _this5 = this;
- var _this$props13 = this.props,
- delimiter = _this$props13.delimiter,
- isDisabled = _this$props13.isDisabled,
- isMulti = _this$props13.isMulti,
- name = _this$props13.name,
- required = _this$props13.required;
- var selectValue = this.state.selectValue;
- if (!name || isDisabled) return;
- if (required && !this.hasValue()) {
- return /*#__PURE__*/React.createElement(RequiredInput, {
- name: name,
- onFocus: this.onValueInputFocus
- });
- }
- if (isMulti) {
- if (delimiter) {
- var value = selectValue.map(function (opt) {
- return _this5.getOptionValue(opt);
- }).join(delimiter);
- return /*#__PURE__*/React.createElement("input", {
- name: name,
- type: "hidden",
- value: value
- });
- } else {
- var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {
- return /*#__PURE__*/React.createElement("input", {
- key: "i-".concat(i),
- name: name,
- type: "hidden",
- value: _this5.getOptionValue(opt)
- });
- }) : /*#__PURE__*/React.createElement("input", {
- name: name,
- type: "hidden",
- value: ""
- });
- return /*#__PURE__*/React.createElement("div", null, input);
- }
- } else {
- var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';
- return /*#__PURE__*/React.createElement("input", {
- name: name,
- type: "hidden",
- value: _value
- });
- }
- }
- }, {
- key: "renderLiveRegion",
- value: function renderLiveRegion() {
- var commonProps = this.commonProps;
- var _this$state6 = this.state,
- ariaSelection = _this$state6.ariaSelection,
- focusedOption = _this$state6.focusedOption,
- focusedValue = _this$state6.focusedValue,
- isFocused = _this$state6.isFocused,
- selectValue = _this$state6.selectValue;
- var focusableOptions = this.getFocusableOptions();
- return /*#__PURE__*/React.createElement(LiveRegion, _extends({}, commonProps, {
- id: this.getElementId('live-region'),
- ariaSelection: ariaSelection,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- isFocused: isFocused,
- selectValue: selectValue,
- focusableOptions: focusableOptions
- }));
- }
- }, {
- key: "render",
- value: function render() {
- var _this$getComponents8 = this.getComponents(),
- Control = _this$getComponents8.Control,
- IndicatorsContainer = _this$getComponents8.IndicatorsContainer,
- SelectContainer = _this$getComponents8.SelectContainer,
- ValueContainer = _this$getComponents8.ValueContainer;
- var _this$props14 = this.props,
- className = _this$props14.className,
- id = _this$props14.id,
- isDisabled = _this$props14.isDisabled,
- menuIsOpen = _this$props14.menuIsOpen;
- var isFocused = this.state.isFocused;
- var commonProps = this.commonProps = this.getCommonProps();
- return /*#__PURE__*/React.createElement(SelectContainer, _extends({}, commonProps, {
- className: className,
- innerProps: {
- id: id,
- onKeyDown: this.onKeyDown
- },
- isDisabled: isDisabled,
- isFocused: isFocused
- }), this.renderLiveRegion(), /*#__PURE__*/React.createElement(Control, _extends({}, commonProps, {
- innerRef: this.getControlRef,
- innerProps: {
- onMouseDown: this.onControlMouseDown,
- onTouchEnd: this.onControlTouchEnd
- },
- isDisabled: isDisabled,
- isFocused: isFocused,
- menuIsOpen: menuIsOpen
- }), /*#__PURE__*/React.createElement(ValueContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function getDerivedStateFromProps(props, state) {
- var prevProps = state.prevProps,
- clearFocusValueOnUpdate = state.clearFocusValueOnUpdate,
- inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
- ariaSelection = state.ariaSelection,
- isFocused = state.isFocused,
- prevWasFocused = state.prevWasFocused;
- var options = props.options,
- value = props.value,
- menuIsOpen = props.menuIsOpen,
- inputValue = props.inputValue,
- isMulti = props.isMulti;
- var selectValue = cleanValue(value);
- var newMenuOptionsState = {};
- if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
- var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
- var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
- var focusedOption = getNextFocusedOption(state, focusableOptions);
- newMenuOptionsState = {
- selectValue: selectValue,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- clearFocusValueOnUpdate: false
- };
- }
- // some updates should toggle the state of the input visibility
- var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
- inputIsHidden: inputIsHiddenAfterUpdate,
- inputIsHiddenAfterUpdate: undefined
- } : {};
- var newAriaSelection = ariaSelection;
- var hasKeptFocus = isFocused && prevWasFocused;
- if (isFocused && !hasKeptFocus) {
- // If `value` or `defaultValue` props are not empty then announce them
- // when the Select is initially focused
- newAriaSelection = {
- value: valueTernary(isMulti, selectValue, selectValue[0] || null),
- options: selectValue,
- action: 'initial-input-focus'
- };
- hasKeptFocus = !prevWasFocused;
- }
-
- // If the 'initial-input-focus' action has been set already
- // then reset the ariaSelection to null
- if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') {
- newAriaSelection = null;
- }
- return _objectSpread(_objectSpread(_objectSpread({}, newMenuOptionsState), newInputIsHiddenState), {}, {
- prevProps: props,
- ariaSelection: newAriaSelection,
- prevWasFocused: hasKeptFocus
- });
- }
- }]);
- return Select;
-}(Component);
-Select.defaultProps = defaultProps;
-
-export { Select as S, defaultProps as a, getOptionLabel$1 as b, createFilter as c, defaultTheme as d, getOptionValue$1 as g, mergeStyles as m };
diff --git a/frontend/node_modules/react-select/dist/Select-73d77d2c.cjs.dev.js b/frontend/node_modules/react-select/dist/Select-73d77d2c.cjs.dev.js
deleted file mode 100644
index e2625255c..000000000
--- a/frontend/node_modules/react-select/dist/Select-73d77d2c.cjs.dev.js
+++ /dev/null
@@ -1,2603 +0,0 @@
-'use strict';
-
-var _extends = require('@babel/runtime/helpers/extends');
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
-var _createClass = require('@babel/runtime/helpers/createClass');
-var _inherits = require('@babel/runtime/helpers/inherits');
-var _createSuper = require('@babel/runtime/helpers/createSuper');
-var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
-var React = require('react');
-var index = require('./index-5b950e59.cjs.dev.js');
-var react = require('@emotion/react');
-var memoizeOne = require('memoize-one');
-var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
-
-function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-var memoizeOne__default = /*#__PURE__*/_interopDefault(memoizeOne);
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-
-// Assistive text to describe visual elements. Hidden for sighted users.
-var _ref = process.env.NODE_ENV === "production" ? {
- name: "7pg0cj-a11yText",
- styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
-} : {
- name: "1f43avz-a11yText-A11yText",
- styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
-};
-var A11yText = function A11yText(props) {
- return react.jsx("span", _extends({
- css: _ref
- }, props));
-};
-
-var defaultAriaLiveMessages = {
- guidance: function guidance(props) {
- var isSearchable = props.isSearchable,
- isMulti = props.isMulti,
- isDisabled = props.isDisabled,
- tabSelectsValue = props.tabSelectsValue,
- context = props.context;
- switch (context) {
- case 'menu':
- return "Use Up and Down to choose options".concat(isDisabled ? '' : ', press Enter to select the currently focused option', ", press Escape to exit the menu").concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
- case 'input':
- return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
- case 'value':
- return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
- default:
- return '';
- }
- },
- onChange: function onChange(props) {
- var action = props.action,
- _props$label = props.label,
- label = _props$label === void 0 ? '' : _props$label,
- labels = props.labels,
- isDisabled = props.isDisabled;
- switch (action) {
- case 'deselect-option':
- case 'pop-value':
- case 'remove-value':
- return "option ".concat(label, ", deselected.");
- case 'clear':
- return 'All selected options have been cleared.';
- case 'initial-input-focus':
- return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected.");
- case 'select-option':
- return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected.");
- default:
- return '';
- }
- },
- onFocus: function onFocus(props) {
- var context = props.context,
- focused = props.focused,
- options = props.options,
- _props$label2 = props.label,
- label = _props$label2 === void 0 ? '' : _props$label2,
- selectValue = props.selectValue,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected;
- var getArrayIndex = function getArrayIndex(arr, item) {
- return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
- };
- if (context === 'value' && selectValue) {
- return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
- }
- if (context === 'menu') {
- var disabled = isDisabled ? ' disabled' : '';
- var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
- return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
- }
- return '';
- },
- onFilter: function onFilter(props) {
- var inputValue = props.inputValue,
- resultsMessage = props.resultsMessage;
- return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', ".");
- }
-};
-
-var LiveRegion = function LiveRegion(props) {
- var ariaSelection = props.ariaSelection,
- focusedOption = props.focusedOption,
- focusedValue = props.focusedValue,
- focusableOptions = props.focusableOptions,
- isFocused = props.isFocused,
- selectValue = props.selectValue,
- selectProps = props.selectProps,
- id = props.id;
- var ariaLiveMessages = selectProps.ariaLiveMessages,
- getOptionLabel = selectProps.getOptionLabel,
- inputValue = selectProps.inputValue,
- isMulti = selectProps.isMulti,
- isOptionDisabled = selectProps.isOptionDisabled,
- isSearchable = selectProps.isSearchable,
- menuIsOpen = selectProps.menuIsOpen,
- options = selectProps.options,
- screenReaderStatus = selectProps.screenReaderStatus,
- tabSelectsValue = selectProps.tabSelectsValue;
- var ariaLabel = selectProps['aria-label'];
- var ariaLive = selectProps['aria-live'];
-
- // Update aria live message configuration when prop changes
- var messages = React.useMemo(function () {
- return _objectSpread(_objectSpread({}, defaultAriaLiveMessages), ariaLiveMessages || {});
- }, [ariaLiveMessages]);
-
- // Update aria live selected option when prop changes
- var ariaSelected = React.useMemo(function () {
- var message = '';
- if (ariaSelection && messages.onChange) {
- var option = ariaSelection.option,
- selectedOptions = ariaSelection.options,
- removedValue = ariaSelection.removedValue,
- removedValues = ariaSelection.removedValues,
- value = ariaSelection.value;
- // select-option when !isMulti does not return option so we assume selected option is value
- var asOption = function asOption(val) {
- return !Array.isArray(val) ? val : null;
- };
-
- // If there is just one item from the action then get its label
- var selected = removedValue || option || asOption(value);
- var label = selected ? getOptionLabel(selected) : '';
-
- // If there are multiple items from the action then return an array of labels
- var multiSelected = selectedOptions || removedValues || undefined;
- var labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
- var onChangeProps = _objectSpread({
- // multiSelected items are usually items that have already been selected
- // or set by the user as a default value so we assume they are not disabled
- isDisabled: selected && isOptionDisabled(selected, selectValue),
- label: label,
- labels: labels
- }, ariaSelection);
- message = messages.onChange(onChangeProps);
- }
- return message;
- }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]);
- var ariaFocused = React.useMemo(function () {
- var focusMsg = '';
- var focused = focusedOption || focusedValue;
- var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
- if (focused && messages.onFocus) {
- var onFocusProps = {
- focused: focused,
- label: getOptionLabel(focused),
- isDisabled: isOptionDisabled(focused, selectValue),
- isSelected: isSelected,
- options: focusableOptions,
- context: focused === focusedOption ? 'menu' : 'value',
- selectValue: selectValue
- };
- focusMsg = messages.onFocus(onFocusProps);
- }
- return focusMsg;
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
- var ariaResults = React.useMemo(function () {
- var resultsMsg = '';
- if (menuIsOpen && options.length && messages.onFilter) {
- var resultsMessage = screenReaderStatus({
- count: focusableOptions.length
- });
- resultsMsg = messages.onFilter({
- inputValue: inputValue,
- resultsMessage: resultsMessage
- });
- }
- return resultsMsg;
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
- var ariaGuidance = React.useMemo(function () {
- var guidanceMsg = '';
- if (messages.guidance) {
- var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';
- guidanceMsg = messages.guidance({
- 'aria-label': ariaLabel,
- context: context,
- isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
- isMulti: isMulti,
- isSearchable: isSearchable,
- tabSelectsValue: tabSelectsValue
- });
- }
- return guidanceMsg;
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
- var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
- var ScreenReaderText = react.jsx(React.Fragment, null, react.jsx("span", {
- id: "aria-selection"
- }, ariaSelected), react.jsx("span", {
- id: "aria-context"
- }, ariaContext));
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
- return react.jsx(React.Fragment, null, react.jsx(A11yText, {
- id: id
- }, isInitialFocus && ScreenReaderText), react.jsx(A11yText, {
- "aria-live": ariaLive,
- "aria-atomic": "false",
- "aria-relevant": "additions text"
- }, isFocused && !isInitialFocus && ScreenReaderText));
-};
-
-var diacritics = [{
- base: 'A',
- letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
-}, {
- base: 'AA',
- letters: "\uA732"
-}, {
- base: 'AE',
- letters: "\xC6\u01FC\u01E2"
-}, {
- base: 'AO',
- letters: "\uA734"
-}, {
- base: 'AU',
- letters: "\uA736"
-}, {
- base: 'AV',
- letters: "\uA738\uA73A"
-}, {
- base: 'AY',
- letters: "\uA73C"
-}, {
- base: 'B',
- letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
-}, {
- base: 'C',
- letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
-}, {
- base: 'D',
- letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
-}, {
- base: 'DZ',
- letters: "\u01F1\u01C4"
-}, {
- base: 'Dz',
- letters: "\u01F2\u01C5"
-}, {
- base: 'E',
- letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
-}, {
- base: 'F',
- letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
-}, {
- base: 'G',
- letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
-}, {
- base: 'H',
- letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
-}, {
- base: 'I',
- letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
-}, {
- base: 'J',
- letters: "J\u24BF\uFF2A\u0134\u0248"
-}, {
- base: 'K',
- letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
-}, {
- base: 'L',
- letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
-}, {
- base: 'LJ',
- letters: "\u01C7"
-}, {
- base: 'Lj',
- letters: "\u01C8"
-}, {
- base: 'M',
- letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
-}, {
- base: 'N',
- letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
-}, {
- base: 'NJ',
- letters: "\u01CA"
-}, {
- base: 'Nj',
- letters: "\u01CB"
-}, {
- base: 'O',
- letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
-}, {
- base: 'OI',
- letters: "\u01A2"
-}, {
- base: 'OO',
- letters: "\uA74E"
-}, {
- base: 'OU',
- letters: "\u0222"
-}, {
- base: 'P',
- letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
-}, {
- base: 'Q',
- letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
-}, {
- base: 'R',
- letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
-}, {
- base: 'S',
- letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
-}, {
- base: 'T',
- letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
-}, {
- base: 'TZ',
- letters: "\uA728"
-}, {
- base: 'U',
- letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
-}, {
- base: 'V',
- letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
-}, {
- base: 'VY',
- letters: "\uA760"
-}, {
- base: 'W',
- letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
-}, {
- base: 'X',
- letters: "X\u24CD\uFF38\u1E8A\u1E8C"
-}, {
- base: 'Y',
- letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
-}, {
- base: 'Z',
- letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
-}, {
- base: 'a',
- letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
-}, {
- base: 'aa',
- letters: "\uA733"
-}, {
- base: 'ae',
- letters: "\xE6\u01FD\u01E3"
-}, {
- base: 'ao',
- letters: "\uA735"
-}, {
- base: 'au',
- letters: "\uA737"
-}, {
- base: 'av',
- letters: "\uA739\uA73B"
-}, {
- base: 'ay',
- letters: "\uA73D"
-}, {
- base: 'b',
- letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
-}, {
- base: 'c',
- letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
-}, {
- base: 'd',
- letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
-}, {
- base: 'dz',
- letters: "\u01F3\u01C6"
-}, {
- base: 'e',
- letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
-}, {
- base: 'f',
- letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
-}, {
- base: 'g',
- letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
-}, {
- base: 'h',
- letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
-}, {
- base: 'hv',
- letters: "\u0195"
-}, {
- base: 'i',
- letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
-}, {
- base: 'j',
- letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
-}, {
- base: 'k',
- letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
-}, {
- base: 'l',
- letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
-}, {
- base: 'lj',
- letters: "\u01C9"
-}, {
- base: 'm',
- letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
-}, {
- base: 'n',
- letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
-}, {
- base: 'nj',
- letters: "\u01CC"
-}, {
- base: 'o',
- letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
-}, {
- base: 'oi',
- letters: "\u01A3"
-}, {
- base: 'ou',
- letters: "\u0223"
-}, {
- base: 'oo',
- letters: "\uA74F"
-}, {
- base: 'p',
- letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
-}, {
- base: 'q',
- letters: "q\u24E0\uFF51\u024B\uA757\uA759"
-}, {
- base: 'r',
- letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
-}, {
- base: 's',
- letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
-}, {
- base: 't',
- letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
-}, {
- base: 'tz',
- letters: "\uA729"
-}, {
- base: 'u',
- letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
-}, {
- base: 'v',
- letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
-}, {
- base: 'vy',
- letters: "\uA761"
-}, {
- base: 'w',
- letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
-}, {
- base: 'x',
- letters: "x\u24E7\uFF58\u1E8B\u1E8D"
-}, {
- base: 'y',
- letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
-}, {
- base: 'z',
- letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
-}];
-var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
- return d.letters;
-}).join('') + ']', 'g');
-var diacriticToBase = {};
-for (var i = 0; i < diacritics.length; i++) {
- var diacritic = diacritics[i];
- for (var j = 0; j < diacritic.letters.length; j++) {
- diacriticToBase[diacritic.letters[j]] = diacritic.base;
- }
-}
-var stripDiacritics = function stripDiacritics(str) {
- return str.replace(anyDiacritic, function (match) {
- return diacriticToBase[match];
- });
-};
-
-var memoizedStripDiacriticsForInput = memoizeOne__default['default'](stripDiacritics);
-var trimString = function trimString(str) {
- return str.replace(/^\s+|\s+$/g, '');
-};
-var defaultStringify = function defaultStringify(option) {
- return "".concat(option.label, " ").concat(option.value);
-};
-var createFilter = function createFilter(config) {
- return function (option, rawInput) {
- // eslint-disable-next-line no-underscore-dangle
- if (option.data.__isNew__) return true;
- var _ignoreCase$ignoreAcc = _objectSpread({
- ignoreCase: true,
- ignoreAccents: true,
- stringify: defaultStringify,
- trim: true,
- matchFrom: 'any'
- }, config),
- ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,
- ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,
- stringify = _ignoreCase$ignoreAcc.stringify,
- trim = _ignoreCase$ignoreAcc.trim,
- matchFrom = _ignoreCase$ignoreAcc.matchFrom;
- var input = trim ? trimString(rawInput) : rawInput;
- var candidate = trim ? trimString(stringify(option)) : stringify(option);
- if (ignoreCase) {
- input = input.toLowerCase();
- candidate = candidate.toLowerCase();
- }
- if (ignoreAccents) {
- input = memoizedStripDiacriticsForInput(input);
- candidate = stripDiacritics(candidate);
- }
- return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
- };
-};
-
-var _excluded = ["innerRef"];
-function DummyInput(_ref) {
- var innerRef = _ref.innerRef,
- props = _objectWithoutProperties(_ref, _excluded);
- // Remove animation props not meant for HTML elements
- var filteredProps = index.removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
- return react.jsx("input", _extends({
- ref: innerRef
- }, filteredProps, {
- css: /*#__PURE__*/react.css({
- label: 'dummyInput',
- // get rid of any default styles
- background: 0,
- border: 0,
- // important! this hides the flashing cursor
- caretColor: 'transparent',
- fontSize: 'inherit',
- gridArea: '1 / 1 / 2 / 3',
- outline: 0,
- padding: 0,
- // important! without `width` browsers won't allow focus
- width: 1,
- // remove cursor on desktop
- color: 'transparent',
- // remove cursor on mobile whilst maintaining "scroll into view" behaviour
- left: -100,
- opacity: 0,
- position: 'relative',
- transform: 'scale(.01)'
- }, process.env.NODE_ENV === "production" ? "" : ";label:DummyInput;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")
- }));
-}
-
-var cancelScroll = function cancelScroll(event) {
- event.preventDefault();
- event.stopPropagation();
-};
-function useScrollCapture(_ref) {
- var isEnabled = _ref.isEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var isBottom = React.useRef(false);
- var isTop = React.useRef(false);
- var touchStart = React.useRef(0);
- var scrollTarget = React.useRef(null);
- var handleEventDelta = React.useCallback(function (event, delta) {
- if (scrollTarget.current === null) return;
- var _scrollTarget$current = scrollTarget.current,
- scrollTop = _scrollTarget$current.scrollTop,
- scrollHeight = _scrollTarget$current.scrollHeight,
- clientHeight = _scrollTarget$current.clientHeight;
- var target = scrollTarget.current;
- var isDeltaPositive = delta > 0;
- var availableScroll = scrollHeight - clientHeight - scrollTop;
- var shouldCancelScroll = false;
-
- // reset bottom/top flags
- if (availableScroll > delta && isBottom.current) {
- if (onBottomLeave) onBottomLeave(event);
- isBottom.current = false;
- }
- if (isDeltaPositive && isTop.current) {
- if (onTopLeave) onTopLeave(event);
- isTop.current = false;
- }
-
- // bottom limit
- if (isDeltaPositive && delta > availableScroll) {
- if (onBottomArrive && !isBottom.current) {
- onBottomArrive(event);
- }
- target.scrollTop = scrollHeight;
- shouldCancelScroll = true;
- isBottom.current = true;
-
- // top limit
- } else if (!isDeltaPositive && -delta > scrollTop) {
- if (onTopArrive && !isTop.current) {
- onTopArrive(event);
- }
- target.scrollTop = 0;
- shouldCancelScroll = true;
- isTop.current = true;
- }
-
- // cancel scroll
- if (shouldCancelScroll) {
- cancelScroll(event);
- }
- }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
- var onWheel = React.useCallback(function (event) {
- handleEventDelta(event, event.deltaY);
- }, [handleEventDelta]);
- var onTouchStart = React.useCallback(function (event) {
- // set touch start so we can calculate touchmove delta
- touchStart.current = event.changedTouches[0].clientY;
- }, []);
- var onTouchMove = React.useCallback(function (event) {
- var deltaY = touchStart.current - event.changedTouches[0].clientY;
- handleEventDelta(event, deltaY);
- }, [handleEventDelta]);
- var startListening = React.useCallback(function (el) {
- // bail early if no element is available to attach to
- if (!el) return;
- var notPassive = index.supportsPassiveEvents ? {
- passive: false
- } : false;
- el.addEventListener('wheel', onWheel, notPassive);
- el.addEventListener('touchstart', onTouchStart, notPassive);
- el.addEventListener('touchmove', onTouchMove, notPassive);
- }, [onTouchMove, onTouchStart, onWheel]);
- var stopListening = React.useCallback(function (el) {
- // bail early if no element is available to detach from
- if (!el) return;
- el.removeEventListener('wheel', onWheel, false);
- el.removeEventListener('touchstart', onTouchStart, false);
- el.removeEventListener('touchmove', onTouchMove, false);
- }, [onTouchMove, onTouchStart, onWheel]);
- React.useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- startListening(element);
- return function () {
- stopListening(element);
- };
- }, [isEnabled, startListening, stopListening]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];
-var LOCK_STYLES = {
- boxSizing: 'border-box',
- // account for possible declaration `width: 100%;` on body
- overflow: 'hidden',
- position: 'relative',
- height: '100%'
-};
-function preventTouchMove(e) {
- e.preventDefault();
-}
-function allowTouchMove(e) {
- e.stopPropagation();
-}
-function preventInertiaScroll() {
- var top = this.scrollTop;
- var totalScroll = this.scrollHeight;
- var currentScroll = top + this.offsetHeight;
- if (top === 0) {
- this.scrollTop = 1;
- } else if (currentScroll === totalScroll) {
- this.scrollTop = top - 1;
- }
-}
-
-// `ontouchstart` check works on most browsers
-// `maxTouchPoints` works on IE10/11 and Surface
-function isTouchDevice() {
- return 'ontouchstart' in window || navigator.maxTouchPoints;
-}
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-var activeScrollLocks = 0;
-var listenerOptions = {
- capture: false,
- passive: false
-};
-function useScrollLock(_ref) {
- var isEnabled = _ref.isEnabled,
- _ref$accountForScroll = _ref.accountForScrollbars,
- accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
- var originalStyles = React.useRef({});
- var scrollTarget = React.useRef(null);
- var addScrollLock = React.useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
- if (accountForScrollbars) {
- // store any styles already applied to the body
- STYLE_KEYS.forEach(function (key) {
- var val = targetStyle && targetStyle[key];
- originalStyles.current[key] = val;
- });
- }
-
- // apply the lock styles and padding if this is the first scroll lock
- if (accountForScrollbars && activeScrollLocks < 1) {
- var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
- var clientWidth = document.body ? document.body.clientWidth : 0;
- var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
- Object.keys(LOCK_STYLES).forEach(function (key) {
- var val = LOCK_STYLES[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- if (targetStyle) {
- targetStyle.paddingRight = "".concat(adjustedPadding, "px");
- }
- }
-
- // account for touch devices
- if (target && isTouchDevice()) {
- // Mobile Safari ignores { overflow: hidden } declaration on the body.
- target.addEventListener('touchmove', preventTouchMove, listenerOptions);
-
- // Allow scroll on provided target
- if (touchScrollTarget) {
- touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
-
- // increment active scroll locks
- activeScrollLocks += 1;
- }, [accountForScrollbars]);
- var removeScrollLock = React.useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
-
- // safely decrement active scroll locks
- activeScrollLocks = Math.max(activeScrollLocks - 1, 0);
-
- // reapply original body styles, if any
- if (accountForScrollbars && activeScrollLocks < 1) {
- STYLE_KEYS.forEach(function (key) {
- var val = originalStyles.current[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- }
-
- // remove touch listeners
- if (target && isTouchDevice()) {
- target.removeEventListener('touchmove', preventTouchMove, listenerOptions);
- if (touchScrollTarget) {
- touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
- }, [accountForScrollbars]);
- React.useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- addScrollLock(element);
- return function () {
- removeScrollLock(element);
- };
- }, [isEnabled, addScrollLock, removeScrollLock]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-var blurSelectInput = function blurSelectInput() {
- return document.activeElement && document.activeElement.blur();
-};
-var _ref2$1 = process.env.NODE_ENV === "production" ? {
- name: "1kfdb0e",
- styles: "position:fixed;left:0;bottom:0;right:0;top:0"
-} : {
- name: "bp8cua-ScrollManager",
- styles: "position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStDVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2sgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9ICgpID0+XG4gIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgJiYgKGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgYXMgSFRNTEVsZW1lbnQpLmJsdXIoKTtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gU2Nyb2xsTWFuYWdlcih7XG4gIGNoaWxkcmVuLFxuICBsb2NrRW5hYmxlZCxcbiAgY2FwdHVyZUVuYWJsZWQgPSB0cnVlLFxuICBvbkJvdHRvbUFycml2ZSxcbiAgb25Cb3R0b21MZWF2ZSxcbiAgb25Ub3BBcnJpdmUsXG4gIG9uVG9wTGVhdmUsXG59OiBQcm9wcykge1xuICBjb25zdCBzZXRTY3JvbGxDYXB0dXJlVGFyZ2V0ID0gdXNlU2Nyb2xsQ2FwdHVyZSh7XG4gICAgaXNFbmFibGVkOiBjYXB0dXJlRW5hYmxlZCxcbiAgICBvbkJvdHRvbUFycml2ZSxcbiAgICBvbkJvdHRvbUxlYXZlLFxuICAgIG9uVG9wQXJyaXZlLFxuICAgIG9uVG9wTGVhdmUsXG4gIH0pO1xuICBjb25zdCBzZXRTY3JvbGxMb2NrVGFyZ2V0ID0gdXNlU2Nyb2xsTG9jayh7IGlzRW5hYmxlZDogbG9ja0VuYWJsZWQgfSk7XG5cbiAgY29uc3QgdGFyZ2V0UmVmOiBSZWZDYWxsYmFjazxIVE1MRWxlbWVudD4gPSAoZWxlbWVudCkgPT4ge1xuICAgIHNldFNjcm9sbENhcHR1cmVUYXJnZXQoZWxlbWVudCk7XG4gICAgc2V0U2Nyb2xsTG9ja1RhcmdldChlbGVtZW50KTtcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxGcmFnbWVudD5cbiAgICAgIHtsb2NrRW5hYmxlZCAmJiAoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBvbkNsaWNrPXtibHVyU2VsZWN0SW5wdXR9XG4gICAgICAgICAgY3NzPXt7IHBvc2l0aW9uOiAnZml4ZWQnLCBsZWZ0OiAwLCBib3R0b206IDAsIHJpZ2h0OiAwLCB0b3A6IDAgfX1cbiAgICAgICAgLz5cbiAgICAgICl9XG4gICAgICB7Y2hpbGRyZW4odGFyZ2V0UmVmKX1cbiAgICA8L0ZyYWdtZW50PlxuICApO1xufVxuIl19 */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
-};
-function ScrollManager(_ref) {
- var children = _ref.children,
- lockEnabled = _ref.lockEnabled,
- _ref$captureEnabled = _ref.captureEnabled,
- captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var setScrollCaptureTarget = useScrollCapture({
- isEnabled: captureEnabled,
- onBottomArrive: onBottomArrive,
- onBottomLeave: onBottomLeave,
- onTopArrive: onTopArrive,
- onTopLeave: onTopLeave
- });
- var setScrollLockTarget = useScrollLock({
- isEnabled: lockEnabled
- });
- var targetRef = function targetRef(element) {
- setScrollCaptureTarget(element);
- setScrollLockTarget(element);
- };
- return react.jsx(React.Fragment, null, lockEnabled && react.jsx("div", {
- onClick: blurSelectInput,
- css: _ref2$1
- }), children(targetRef));
-}
-
-function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-var _ref2 = process.env.NODE_ENV === "production" ? {
- name: "1a0ro4n-requiredInput",
- styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
-} : {
- name: "5kkxb2-requiredInput-RequiredInput",
- styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZTogc3RyaW5nO1xuICByZWFkb25seSBvbkZvY3VzOiBGb2N1c0V2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0+ID0gKHsgbmFtZSwgb25Gb2N1cyB9KSA9PiAoXG4gIDxpbnB1dFxuICAgIHJlcXVpcmVkXG4gICAgbmFtZT17bmFtZX1cbiAgICB0YWJJbmRleD17LTF9XG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
-};
-var RequiredInput = function RequiredInput(_ref) {
- var name = _ref.name,
- onFocus = _ref.onFocus;
- return react.jsx("input", {
- required: true,
- name: name,
- tabIndex: -1,
- onFocus: onFocus,
- css: _ref2
- // Prevent `Switching from uncontrolled to controlled` error
- ,
- value: "",
- onChange: function onChange() {}
- });
-};
-
-var formatGroupLabel = function formatGroupLabel(group) {
- return group.label;
-};
-var getOptionLabel$1 = function getOptionLabel(option) {
- return option.label;
-};
-var getOptionValue$1 = function getOptionValue(option) {
- return option.value;
-};
-var isOptionDisabled = function isOptionDisabled(option) {
- return !!option.isDisabled;
-};
-
-var defaultStyles = {
- clearIndicator: index.clearIndicatorCSS,
- container: index.containerCSS,
- control: index.css,
- dropdownIndicator: index.dropdownIndicatorCSS,
- group: index.groupCSS,
- groupHeading: index.groupHeadingCSS,
- indicatorsContainer: index.indicatorsContainerCSS,
- indicatorSeparator: index.indicatorSeparatorCSS,
- input: index.inputCSS,
- loadingIndicator: index.loadingIndicatorCSS,
- loadingMessage: index.loadingMessageCSS,
- menu: index.menuCSS,
- menuList: index.menuListCSS,
- menuPortal: index.menuPortalCSS,
- multiValue: index.multiValueCSS,
- multiValueLabel: index.multiValueLabelCSS,
- multiValueRemove: index.multiValueRemoveCSS,
- noOptionsMessage: index.noOptionsMessageCSS,
- option: index.optionCSS,
- placeholder: index.placeholderCSS,
- singleValue: index.css$1,
- valueContainer: index.valueContainerCSS
-};
-// Merge Utility
-// Allows consumers to extend a base Select with additional styles
-
-function mergeStyles(source) {
- var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- // initialize with source styles
- var styles = _objectSpread({}, source);
-
- // massage in target styles
- Object.keys(target).forEach(function (keyAsString) {
- var key = keyAsString;
- if (source[key]) {
- styles[key] = function (rsCss, props) {
- return target[key](source[key](rsCss, props), props);
- };
- } else {
- styles[key] = target[key];
- }
- });
- return styles;
-}
-
-var colors = {
- primary: '#2684FF',
- primary75: '#4C9AFF',
- primary50: '#B2D4FF',
- primary25: '#DEEBFF',
- danger: '#DE350B',
- dangerLight: '#FFBDAD',
- neutral0: 'hsl(0, 0%, 100%)',
- neutral5: 'hsl(0, 0%, 95%)',
- neutral10: 'hsl(0, 0%, 90%)',
- neutral20: 'hsl(0, 0%, 80%)',
- neutral30: 'hsl(0, 0%, 70%)',
- neutral40: 'hsl(0, 0%, 60%)',
- neutral50: 'hsl(0, 0%, 50%)',
- neutral60: 'hsl(0, 0%, 40%)',
- neutral70: 'hsl(0, 0%, 30%)',
- neutral80: 'hsl(0, 0%, 20%)',
- neutral90: 'hsl(0, 0%, 10%)'
-};
-var borderRadius = 4;
-// Used to calculate consistent margin/padding on elements
-var baseUnit = 4;
-// The minimum height of the control
-var controlHeight = 38;
-// The amount of space between the control and menu */
-var menuGutter = baseUnit * 2;
-var spacing = {
- baseUnit: baseUnit,
- controlHeight: controlHeight,
- menuGutter: menuGutter
-};
-var defaultTheme = {
- borderRadius: borderRadius,
- colors: colors,
- spacing: spacing
-};
-
-var defaultProps = {
- 'aria-live': 'polite',
- backspaceRemovesValue: true,
- blurInputOnSelect: index.isTouchCapable(),
- captureMenuScroll: !index.isTouchCapable(),
- classNames: {},
- closeMenuOnSelect: true,
- closeMenuOnScroll: false,
- components: {},
- controlShouldRenderValue: true,
- escapeClearsValue: false,
- filterOption: createFilter(),
- formatGroupLabel: formatGroupLabel,
- getOptionLabel: getOptionLabel$1,
- getOptionValue: getOptionValue$1,
- isDisabled: false,
- isLoading: false,
- isMulti: false,
- isRtl: false,
- isSearchable: true,
- isOptionDisabled: isOptionDisabled,
- loadingMessage: function loadingMessage() {
- return 'Loading...';
- },
- maxMenuHeight: 300,
- minMenuHeight: 140,
- menuIsOpen: false,
- menuPlacement: 'bottom',
- menuPosition: 'absolute',
- menuShouldBlockScroll: false,
- menuShouldScrollIntoView: !index.isMobileDevice(),
- noOptionsMessage: function noOptionsMessage() {
- return 'No options';
- },
- openMenuOnFocus: false,
- openMenuOnClick: true,
- options: [],
- pageSize: 5,
- placeholder: 'Select...',
- screenReaderStatus: function screenReaderStatus(_ref) {
- var count = _ref.count;
- return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available");
- },
- styles: {},
- tabIndex: 0,
- tabSelectsValue: true,
- unstyled: false
-};
-function toCategorizedOption(props, option, selectValue, index) {
- var isDisabled = _isOptionDisabled(props, option, selectValue);
- var isSelected = _isOptionSelected(props, option, selectValue);
- var label = getOptionLabel(props, option);
- var value = getOptionValue(props, option);
- return {
- type: 'option',
- data: option,
- isDisabled: isDisabled,
- isSelected: isSelected,
- label: label,
- value: value,
- index: index
- };
-}
-function buildCategorizedOptions(props, selectValue) {
- return props.options.map(function (groupOrOption, groupOrOptionIndex) {
- if ('options' in groupOrOption) {
- var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) {
- return toCategorizedOption(props, option, selectValue, optionIndex);
- }).filter(function (categorizedOption) {
- return isFocusable(props, categorizedOption);
- });
- return categorizedOptions.length > 0 ? {
- type: 'group',
- data: groupOrOption,
- options: categorizedOptions,
- index: groupOrOptionIndex
- } : undefined;
- }
- var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
- return isFocusable(props, categorizedOption) ? categorizedOption : undefined;
- }).filter(index.notNullish);
-}
-function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
- if (categorizedOption.type === 'group') {
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
- return option.data;
- })));
- } else {
- optionsAccumulator.push(categorizedOption.data);
- }
- return optionsAccumulator;
- }, []);
-}
-function buildFocusableOptions(props, selectValue) {
- return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
-}
-function isFocusable(props, categorizedOption) {
- var _props$inputValue = props.inputValue,
- inputValue = _props$inputValue === void 0 ? '' : _props$inputValue;
- var data = categorizedOption.data,
- isSelected = categorizedOption.isSelected,
- label = categorizedOption.label,
- value = categorizedOption.value;
- return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
- label: label,
- value: value,
- data: data
- }, inputValue);
-}
-function getNextFocusedValue(state, nextSelectValue) {
- var focusedValue = state.focusedValue,
- lastSelectValue = state.selectValue;
- var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
- if (lastFocusedIndex > -1) {
- var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
- if (nextFocusedIndex > -1) {
- // the focused value is still in the selectValue, return it
- return focusedValue;
- } else if (lastFocusedIndex < nextSelectValue.length) {
- // the focusedValue is not present in the next selectValue array by
- // reference, so return the new value at the same index
- return nextSelectValue[lastFocusedIndex];
- }
- }
- return null;
-}
-function getNextFocusedOption(state, options) {
- var lastFocusedOption = state.focusedOption;
- return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
-}
-var getOptionLabel = function getOptionLabel(props, data) {
- return props.getOptionLabel(data);
-};
-var getOptionValue = function getOptionValue(props, data) {
- return props.getOptionValue(data);
-};
-function _isOptionDisabled(props, option, selectValue) {
- return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false;
-}
-function _isOptionSelected(props, option, selectValue) {
- if (selectValue.indexOf(option) > -1) return true;
- if (typeof props.isOptionSelected === 'function') {
- return props.isOptionSelected(option, selectValue);
- }
- var candidate = getOptionValue(props, option);
- return selectValue.some(function (i) {
- return getOptionValue(props, i) === candidate;
- });
-}
-function _filterOption(props, option, inputValue) {
- return props.filterOption ? props.filterOption(option, inputValue) : true;
-}
-var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) {
- var hideSelectedOptions = props.hideSelectedOptions,
- isMulti = props.isMulti;
- if (hideSelectedOptions === undefined) return isMulti;
- return hideSelectedOptions;
-};
-var instanceId = 1;
-var Select = /*#__PURE__*/function (_Component) {
- _inherits(Select, _Component);
- var _super = _createSuper(Select);
- // Misc. Instance Properties
- // ------------------------------
-
- // TODO
-
- // Refs
- // ------------------------------
-
- // Lifecycle
- // ------------------------------
-
- function Select(_props) {
- var _this;
- _classCallCheck(this, Select);
- _this = _super.call(this, _props);
- _this.state = {
- ariaSelection: null,
- focusedOption: null,
- focusedValue: null,
- inputIsHidden: false,
- isFocused: false,
- selectValue: [],
- clearFocusValueOnUpdate: false,
- prevWasFocused: false,
- inputIsHiddenAfterUpdate: undefined,
- prevProps: undefined
- };
- _this.blockOptionHover = false;
- _this.isComposing = false;
- _this.commonProps = void 0;
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- _this.instancePrefix = '';
- _this.openAfterFocus = false;
- _this.scrollToFocusedOptionOnUpdate = false;
- _this.userIsDragging = void 0;
- _this.controlRef = null;
- _this.getControlRef = function (ref) {
- _this.controlRef = ref;
- };
- _this.focusedOptionRef = null;
- _this.getFocusedOptionRef = function (ref) {
- _this.focusedOptionRef = ref;
- };
- _this.menuListRef = null;
- _this.getMenuListRef = function (ref) {
- _this.menuListRef = ref;
- };
- _this.inputRef = null;
- _this.getInputRef = function (ref) {
- _this.inputRef = ref;
- };
- _this.focus = _this.focusInput;
- _this.blur = _this.blurInput;
- _this.onChange = function (newValue, actionMeta) {
- var _this$props = _this.props,
- onChange = _this$props.onChange,
- name = _this$props.name;
- actionMeta.name = name;
- _this.ariaOnChange(newValue, actionMeta);
- onChange(newValue, actionMeta);
- };
- _this.setValue = function (newValue, action, option) {
- var _this$props2 = _this.props,
- closeMenuOnSelect = _this$props2.closeMenuOnSelect,
- isMulti = _this$props2.isMulti,
- inputValue = _this$props2.inputValue;
- _this.onInputChange('', {
- action: 'set-value',
- prevInputValue: inputValue
- });
- if (closeMenuOnSelect) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- }
- // when the select value should change, we should reset focusedValue
- _this.setState({
- clearFocusValueOnUpdate: true
- });
- _this.onChange(newValue, {
- action: action,
- option: option
- });
- };
- _this.selectOption = function (newValue) {
- var _this$props3 = _this.props,
- blurInputOnSelect = _this$props3.blurInputOnSelect,
- isMulti = _this$props3.isMulti,
- name = _this$props3.name;
- var selectValue = _this.state.selectValue;
- var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
- var isDisabled = _this.isOptionDisabled(newValue, selectValue);
- if (deselected) {
- var candidate = _this.getOptionValue(newValue);
- _this.setValue(index.multiValueAsValue(selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- })), 'deselect-option', newValue);
- } else if (!isDisabled) {
- // Select option if option is not disabled
- if (isMulti) {
- _this.setValue(index.multiValueAsValue([].concat(_toConsumableArray(selectValue), [newValue])), 'select-option', newValue);
- } else {
- _this.setValue(index.singleValueAsValue(newValue), 'select-option');
- }
- } else {
- _this.ariaOnChange(index.singleValueAsValue(newValue), {
- action: 'select-option',
- option: newValue,
- name: name
- });
- return;
- }
- if (blurInputOnSelect) {
- _this.blurInput();
- }
- };
- _this.removeValue = function (removedValue) {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var candidate = _this.getOptionValue(removedValue);
- var newValueArray = selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- });
- var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'remove-value',
- removedValue: removedValue
- });
- _this.focusInput();
- };
- _this.clearValue = function () {
- var selectValue = _this.state.selectValue;
- _this.onChange(index.valueTernary(_this.props.isMulti, [], null), {
- action: 'clear',
- removedValues: selectValue
- });
- };
- _this.popValue = function () {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var lastSelectedValue = selectValue[selectValue.length - 1];
- var newValueArray = selectValue.slice(0, selectValue.length - 1);
- var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'pop-value',
- removedValue: lastSelectedValue
- });
- };
- _this.getValue = function () {
- return _this.state.selectValue;
- };
- _this.cx = function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return index.classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
- };
- _this.getOptionLabel = function (data) {
- return getOptionLabel(_this.props, data);
- };
- _this.getOptionValue = function (data) {
- return getOptionValue(_this.props, data);
- };
- _this.getStyles = function (key, props) {
- var unstyled = _this.props.unstyled;
- var base = defaultStyles[key](props, unstyled);
- base.boxSizing = 'border-box';
- var custom = _this.props.styles[key];
- return custom ? custom(base, props) : base;
- };
- _this.getClassNames = function (key, props) {
- var _this$props$className, _this$props$className2;
- return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
- };
- _this.getElementId = function (element) {
- return "".concat(_this.instancePrefix, "-").concat(element);
- };
- _this.getComponents = function () {
- return index.defaultComponents(_this.props);
- };
- _this.buildCategorizedOptions = function () {
- return buildCategorizedOptions(_this.props, _this.state.selectValue);
- };
- _this.getCategorizedOptions = function () {
- return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
- };
- _this.buildFocusableOptions = function () {
- return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
- };
- _this.getFocusableOptions = function () {
- return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
- };
- _this.ariaOnChange = function (value, actionMeta) {
- _this.setState({
- ariaSelection: _objectSpread({
- value: value
- }, actionMeta)
- });
- };
- _this.onMenuMouseDown = function (event) {
- if (event.button !== 0) {
- return;
- }
- event.stopPropagation();
- event.preventDefault();
- _this.focusInput();
- };
- _this.onMenuMouseMove = function (event) {
- _this.blockOptionHover = false;
- };
- _this.onControlMouseDown = function (event) {
- // Event captured by dropdown indicator
- if (event.defaultPrevented) {
- return;
- }
- var openMenuOnClick = _this.props.openMenuOnClick;
- if (!_this.state.isFocused) {
- if (openMenuOnClick) {
- _this.openAfterFocus = true;
- }
- _this.focusInput();
- } else if (!_this.props.menuIsOpen) {
- if (openMenuOnClick) {
- _this.openMenu('first');
- }
- } else {
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- _this.onMenuClose();
- }
- }
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- event.preventDefault();
- }
- };
- _this.onDropdownIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- if (_this.props.isDisabled) return;
- var _this$props4 = _this.props,
- isMulti = _this$props4.isMulti,
- menuIsOpen = _this$props4.menuIsOpen;
- _this.focusInput();
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- } else {
- _this.openMenu('first');
- }
- event.preventDefault();
- };
- _this.onClearIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- _this.clearValue();
- event.preventDefault();
- _this.openAfterFocus = false;
- if (event.type === 'touchend') {
- _this.focusInput();
- } else {
- setTimeout(function () {
- return _this.focusInput();
- });
- }
- };
- _this.onScroll = function (event) {
- if (typeof _this.props.closeMenuOnScroll === 'boolean') {
- if (event.target instanceof HTMLElement && index.isDocumentElement(event.target)) {
- _this.props.onMenuClose();
- }
- } else if (typeof _this.props.closeMenuOnScroll === 'function') {
- if (_this.props.closeMenuOnScroll(event)) {
- _this.props.onMenuClose();
- }
- }
- };
- _this.onCompositionStart = function () {
- _this.isComposing = true;
- };
- _this.onCompositionEnd = function () {
- _this.isComposing = false;
- };
- _this.onTouchStart = function (_ref2) {
- var touches = _ref2.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- _this.initialTouchX = touch.clientX;
- _this.initialTouchY = touch.clientY;
- _this.userIsDragging = false;
- };
- _this.onTouchMove = function (_ref3) {
- var touches = _ref3.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- var deltaX = Math.abs(touch.clientX - _this.initialTouchX);
- var deltaY = Math.abs(touch.clientY - _this.initialTouchY);
- var moveThreshold = 5;
- _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
- };
- _this.onTouchEnd = function (event) {
- if (_this.userIsDragging) return;
-
- // close the menu if the user taps outside
- // we're checking on event.target here instead of event.currentTarget, because we want to assert information
- // on events on child elements, not the document (which we've attached this handler to).
- if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {
- _this.blurInput();
- }
-
- // reset move vars
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- };
- _this.onControlTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onControlMouseDown(event);
- };
- _this.onClearIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onClearIndicatorMouseDown(event);
- };
- _this.onDropdownIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onDropdownIndicatorMouseDown(event);
- };
- _this.handleInputChange = function (event) {
- var prevInputValue = _this.props.inputValue;
- var inputValue = event.currentTarget.value;
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange(inputValue, {
- action: 'input-change',
- prevInputValue: prevInputValue
- });
- if (!_this.props.menuIsOpen) {
- _this.onMenuOpen();
- }
- };
- _this.onInputFocus = function (event) {
- if (_this.props.onFocus) {
- _this.props.onFocus(event);
- }
- _this.setState({
- inputIsHiddenAfterUpdate: false,
- isFocused: true
- });
- if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
- _this.openMenu('first');
- }
- _this.openAfterFocus = false;
- };
- _this.onInputBlur = function (event) {
- var prevInputValue = _this.props.inputValue;
- if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
- _this.inputRef.focus();
- return;
- }
- if (_this.props.onBlur) {
- _this.props.onBlur(event);
- }
- _this.onInputChange('', {
- action: 'input-blur',
- prevInputValue: prevInputValue
- });
- _this.onMenuClose();
- _this.setState({
- focusedValue: null,
- isFocused: false
- });
- };
- _this.onOptionHover = function (focusedOption) {
- if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
- return;
- }
- _this.setState({
- focusedOption: focusedOption
- });
- };
- _this.shouldHideSelectedOptions = function () {
- return shouldHideSelectedOptions(_this.props);
- };
- _this.onValueInputFocus = function (e) {
- e.preventDefault();
- e.stopPropagation();
- _this.focus();
- };
- _this.onKeyDown = function (event) {
- var _this$props5 = _this.props,
- isMulti = _this$props5.isMulti,
- backspaceRemovesValue = _this$props5.backspaceRemovesValue,
- escapeClearsValue = _this$props5.escapeClearsValue,
- inputValue = _this$props5.inputValue,
- isClearable = _this$props5.isClearable,
- isDisabled = _this$props5.isDisabled,
- menuIsOpen = _this$props5.menuIsOpen,
- onKeyDown = _this$props5.onKeyDown,
- tabSelectsValue = _this$props5.tabSelectsValue,
- openMenuOnFocus = _this$props5.openMenuOnFocus;
- var _this$state = _this.state,
- focusedOption = _this$state.focusedOption,
- focusedValue = _this$state.focusedValue,
- selectValue = _this$state.selectValue;
- if (isDisabled) return;
- if (typeof onKeyDown === 'function') {
- onKeyDown(event);
- if (event.defaultPrevented) {
- return;
- }
- }
-
- // Block option hover events when the user has just pressed a key
- _this.blockOptionHover = true;
- switch (event.key) {
- case 'ArrowLeft':
- if (!isMulti || inputValue) return;
- _this.focusValue('previous');
- break;
- case 'ArrowRight':
- if (!isMulti || inputValue) return;
- _this.focusValue('next');
- break;
- case 'Delete':
- case 'Backspace':
- if (inputValue) return;
- if (focusedValue) {
- _this.removeValue(focusedValue);
- } else {
- if (!backspaceRemovesValue) return;
- if (isMulti) {
- _this.popValue();
- } else if (isClearable) {
- _this.clearValue();
- }
- }
- break;
- case 'Tab':
- if (_this.isComposing) return;
- if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption ||
- // don't capture the event if the menu opens on focus and the focused
- // option is already selected; it breaks the flow of navigation
- openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
- return;
- }
- _this.selectOption(focusedOption);
- break;
- case 'Enter':
- if (event.keyCode === 229) {
- // ignore the keydown event from an Input Method Editor(IME)
- // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
- break;
- }
- if (menuIsOpen) {
- if (!focusedOption) return;
- if (_this.isComposing) return;
- _this.selectOption(focusedOption);
- break;
- }
- return;
- case 'Escape':
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: inputValue
- });
- _this.onMenuClose();
- } else if (isClearable && escapeClearsValue) {
- _this.clearValue();
- }
- break;
- case ' ':
- // space
- if (inputValue) {
- return;
- }
- if (!menuIsOpen) {
- _this.openMenu('first');
- break;
- }
- if (!focusedOption) return;
- _this.selectOption(focusedOption);
- break;
- case 'ArrowUp':
- if (menuIsOpen) {
- _this.focusOption('up');
- } else {
- _this.openMenu('last');
- }
- break;
- case 'ArrowDown':
- if (menuIsOpen) {
- _this.focusOption('down');
- } else {
- _this.openMenu('first');
- }
- break;
- case 'PageUp':
- if (!menuIsOpen) return;
- _this.focusOption('pageup');
- break;
- case 'PageDown':
- if (!menuIsOpen) return;
- _this.focusOption('pagedown');
- break;
- case 'Home':
- if (!menuIsOpen) return;
- _this.focusOption('first');
- break;
- case 'End':
- if (!menuIsOpen) return;
- _this.focusOption('last');
- break;
- default:
- return;
- }
- event.preventDefault();
- };
- _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
- _this.state.selectValue = index.cleanValue(_props.value);
-
- // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
- if (_props.menuIsOpen && _this.state.selectValue.length) {
- var focusableOptions = _this.buildFocusableOptions();
- var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
- _this.state.focusedOption = focusableOptions[optionIndex];
- }
- return _this;
- }
- _createClass(Select, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- this.startListeningComposition();
- this.startListeningToTouch();
- if (this.props.closeMenuOnScroll && document && document.addEventListener) {
- // Listen to all scroll events, and filter them out inside of 'onScroll'
- document.addEventListener('scroll', this.onScroll, true);
- }
- if (this.props.autoFocus) {
- this.focusInput();
- }
-
- // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen)
- if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
- index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
- }
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate(prevProps) {
- var _this$props6 = this.props,
- isDisabled = _this$props6.isDisabled,
- menuIsOpen = _this$props6.menuIsOpen;
- var isFocused = this.state.isFocused;
- if (
- // ensure focus is restored correctly when the control becomes enabled
- isFocused && !isDisabled && prevProps.isDisabled ||
- // ensure focus is on the Input when the menu opens
- isFocused && menuIsOpen && !prevProps.menuIsOpen) {
- this.focusInput();
- }
- if (isFocused && isDisabled && !prevProps.isDisabled) {
- // ensure select state gets blurred in case Select is programmatically disabled while focused
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: false
- }, this.onMenuClose);
- } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
- // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: true
- });
- }
-
- // scroll the focused option into view if necessary
- if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
- index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
- this.scrollToFocusedOptionOnUpdate = false;
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this.stopListeningComposition();
- this.stopListeningToTouch();
- document.removeEventListener('scroll', this.onScroll, true);
- }
-
- // ==============================
- // Consumer Handlers
- // ==============================
- }, {
- key: "onMenuOpen",
- value: function onMenuOpen() {
- this.props.onMenuOpen();
- }
- }, {
- key: "onMenuClose",
- value: function onMenuClose() {
- this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: this.props.inputValue
- });
- this.props.onMenuClose();
- }
- }, {
- key: "onInputChange",
- value: function onInputChange(newValue, actionMeta) {
- this.props.onInputChange(newValue, actionMeta);
- }
-
- // ==============================
- // Methods
- // ==============================
- }, {
- key: "focusInput",
- value: function focusInput() {
- if (!this.inputRef) return;
- this.inputRef.focus();
- }
- }, {
- key: "blurInput",
- value: function blurInput() {
- if (!this.inputRef) return;
- this.inputRef.blur();
- }
-
- // aliased for consumers
- }, {
- key: "openMenu",
- value: function openMenu(focusOption) {
- var _this2 = this;
- var _this$state2 = this.state,
- selectValue = _this$state2.selectValue,
- isFocused = _this$state2.isFocused;
- var focusableOptions = this.buildFocusableOptions();
- var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1;
- if (!this.props.isMulti) {
- var selectedIndex = focusableOptions.indexOf(selectValue[0]);
- if (selectedIndex > -1) {
- openAtIndex = selectedIndex;
- }
- }
-
- // only scroll if the menu isn't already open
- this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
- this.setState({
- inputIsHiddenAfterUpdate: false,
- focusedValue: null,
- focusedOption: focusableOptions[openAtIndex]
- }, function () {
- return _this2.onMenuOpen();
- });
- }
- }, {
- key: "focusValue",
- value: function focusValue(direction) {
- var _this$state3 = this.state,
- selectValue = _this$state3.selectValue,
- focusedValue = _this$state3.focusedValue;
-
- // Only multiselects support value focusing
- if (!this.props.isMulti) return;
- this.setState({
- focusedOption: null
- });
- var focusedIndex = selectValue.indexOf(focusedValue);
- if (!focusedValue) {
- focusedIndex = -1;
- }
- var lastIndex = selectValue.length - 1;
- var nextFocus = -1;
- if (!selectValue.length) return;
- switch (direction) {
- case 'previous':
- if (focusedIndex === 0) {
- // don't cycle from the start to the end
- nextFocus = 0;
- } else if (focusedIndex === -1) {
- // if nothing is focused, focus the last value first
- nextFocus = lastIndex;
- } else {
- nextFocus = focusedIndex - 1;
- }
- break;
- case 'next':
- if (focusedIndex > -1 && focusedIndex < lastIndex) {
- nextFocus = focusedIndex + 1;
- }
- break;
- }
- this.setState({
- inputIsHidden: nextFocus !== -1,
- focusedValue: selectValue[nextFocus]
- });
- }
- }, {
- key: "focusOption",
- value: function focusOption() {
- var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';
- var pageSize = this.props.pageSize;
- var focusedOption = this.state.focusedOption;
- var options = this.getFocusableOptions();
- if (!options.length) return;
- var nextFocus = 0; // handles 'first'
- var focusedIndex = options.indexOf(focusedOption);
- if (!focusedOption) {
- focusedIndex = -1;
- }
- if (direction === 'up') {
- nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
- } else if (direction === 'down') {
- nextFocus = (focusedIndex + 1) % options.length;
- } else if (direction === 'pageup') {
- nextFocus = focusedIndex - pageSize;
- if (nextFocus < 0) nextFocus = 0;
- } else if (direction === 'pagedown') {
- nextFocus = focusedIndex + pageSize;
- if (nextFocus > options.length - 1) nextFocus = options.length - 1;
- } else if (direction === 'last') {
- nextFocus = options.length - 1;
- }
- this.scrollToFocusedOptionOnUpdate = true;
- this.setState({
- focusedOption: options[nextFocus],
- focusedValue: null
- });
- }
- }, {
- key: "getTheme",
- value:
- // ==============================
- // Getters
- // ==============================
-
- function getTheme() {
- // Use the default theme if there are no customisations.
- if (!this.props.theme) {
- return defaultTheme;
- }
- // If the theme prop is a function, assume the function
- // knows how to merge the passed-in default theme with
- // its own modifications.
- if (typeof this.props.theme === 'function') {
- return this.props.theme(defaultTheme);
- }
- // Otherwise, if a plain theme object was passed in,
- // overlay it with the default theme.
- return _objectSpread(_objectSpread({}, defaultTheme), this.props.theme);
- }
- }, {
- key: "getCommonProps",
- value: function getCommonProps() {
- var clearValue = this.clearValue,
- cx = this.cx,
- getStyles = this.getStyles,
- getClassNames = this.getClassNames,
- getValue = this.getValue,
- selectOption = this.selectOption,
- setValue = this.setValue,
- props = this.props;
- var isMulti = props.isMulti,
- isRtl = props.isRtl,
- options = props.options;
- var hasValue = this.hasValue();
- return {
- clearValue: clearValue,
- cx: cx,
- getStyles: getStyles,
- getClassNames: getClassNames,
- getValue: getValue,
- hasValue: hasValue,
- isMulti: isMulti,
- isRtl: isRtl,
- options: options,
- selectOption: selectOption,
- selectProps: props,
- setValue: setValue,
- theme: this.getTheme()
- };
- }
- }, {
- key: "hasValue",
- value: function hasValue() {
- var selectValue = this.state.selectValue;
- return selectValue.length > 0;
- }
- }, {
- key: "hasOptions",
- value: function hasOptions() {
- return !!this.getFocusableOptions().length;
- }
- }, {
- key: "isClearable",
- value: function isClearable() {
- var _this$props7 = this.props,
- isClearable = _this$props7.isClearable,
- isMulti = _this$props7.isMulti;
-
- // single select, by default, IS NOT clearable
- // multi select, by default, IS clearable
- if (isClearable === undefined) return isMulti;
- return isClearable;
- }
- }, {
- key: "isOptionDisabled",
- value: function isOptionDisabled(option, selectValue) {
- return _isOptionDisabled(this.props, option, selectValue);
- }
- }, {
- key: "isOptionSelected",
- value: function isOptionSelected(option, selectValue) {
- return _isOptionSelected(this.props, option, selectValue);
- }
- }, {
- key: "filterOption",
- value: function filterOption(option, inputValue) {
- return _filterOption(this.props, option, inputValue);
- }
- }, {
- key: "formatOptionLabel",
- value: function formatOptionLabel(data, context) {
- if (typeof this.props.formatOptionLabel === 'function') {
- var _inputValue = this.props.inputValue;
- var _selectValue = this.state.selectValue;
- return this.props.formatOptionLabel(data, {
- context: context,
- inputValue: _inputValue,
- selectValue: _selectValue
- });
- } else {
- return this.getOptionLabel(data);
- }
- }
- }, {
- key: "formatGroupLabel",
- value: function formatGroupLabel(data) {
- return this.props.formatGroupLabel(data);
- }
-
- // ==============================
- // Mouse Handlers
- // ==============================
- }, {
- key: "startListeningComposition",
- value:
- // ==============================
- // Composition Handlers
- // ==============================
-
- function startListeningComposition() {
- if (document && document.addEventListener) {
- document.addEventListener('compositionstart', this.onCompositionStart, false);
- document.addEventListener('compositionend', this.onCompositionEnd, false);
- }
- }
- }, {
- key: "stopListeningComposition",
- value: function stopListeningComposition() {
- if (document && document.removeEventListener) {
- document.removeEventListener('compositionstart', this.onCompositionStart);
- document.removeEventListener('compositionend', this.onCompositionEnd);
- }
- }
- }, {
- key: "startListeningToTouch",
- value:
- // ==============================
- // Touch Handlers
- // ==============================
-
- function startListeningToTouch() {
- if (document && document.addEventListener) {
- document.addEventListener('touchstart', this.onTouchStart, false);
- document.addEventListener('touchmove', this.onTouchMove, false);
- document.addEventListener('touchend', this.onTouchEnd, false);
- }
- }
- }, {
- key: "stopListeningToTouch",
- value: function stopListeningToTouch() {
- if (document && document.removeEventListener) {
- document.removeEventListener('touchstart', this.onTouchStart);
- document.removeEventListener('touchmove', this.onTouchMove);
- document.removeEventListener('touchend', this.onTouchEnd);
- }
- }
- }, {
- key: "renderInput",
- value:
- // ==============================
- // Renderers
- // ==============================
- function renderInput() {
- var _this$props8 = this.props,
- isDisabled = _this$props8.isDisabled,
- isSearchable = _this$props8.isSearchable,
- inputId = _this$props8.inputId,
- inputValue = _this$props8.inputValue,
- tabIndex = _this$props8.tabIndex,
- form = _this$props8.form,
- menuIsOpen = _this$props8.menuIsOpen,
- required = _this$props8.required;
- var _this$getComponents = this.getComponents(),
- Input = _this$getComponents.Input;
- var _this$state4 = this.state,
- inputIsHidden = _this$state4.inputIsHidden,
- ariaSelection = _this$state4.ariaSelection;
- var commonProps = this.commonProps;
- var id = inputId || this.getElementId('input');
-
- // aria attributes makes the JSX "noisy", separated for clarity
- var ariaAttributes = _objectSpread(_objectSpread(_objectSpread({
- 'aria-autocomplete': 'list',
- 'aria-expanded': menuIsOpen,
- 'aria-haspopup': true,
- 'aria-errormessage': this.props['aria-errormessage'],
- 'aria-invalid': this.props['aria-invalid'],
- 'aria-label': this.props['aria-label'],
- 'aria-labelledby': this.props['aria-labelledby'],
- 'aria-required': required,
- role: 'combobox'
- }, menuIsOpen && {
- 'aria-controls': this.getElementId('listbox'),
- 'aria-owns': this.getElementId('listbox')
- }), !isSearchable && {
- 'aria-readonly': true
- }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
- 'aria-describedby': this.getElementId('live-region')
- } : {
- 'aria-describedby': this.getElementId('placeholder')
- });
- if (!isSearchable) {
- // use a dummy input to maintain focus/blur functionality
- return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends({
- id: id,
- innerRef: this.getInputRef,
- onBlur: this.onInputBlur,
- onChange: index.noop,
- onFocus: this.onInputFocus,
- disabled: isDisabled,
- tabIndex: tabIndex,
- inputMode: "none",
- form: form,
- value: ""
- }, ariaAttributes));
- }
- return /*#__PURE__*/React__namespace.createElement(Input, _extends({}, commonProps, {
- autoCapitalize: "none",
- autoComplete: "off",
- autoCorrect: "off",
- id: id,
- innerRef: this.getInputRef,
- isDisabled: isDisabled,
- isHidden: inputIsHidden,
- onBlur: this.onInputBlur,
- onChange: this.handleInputChange,
- onFocus: this.onInputFocus,
- spellCheck: "false",
- tabIndex: tabIndex,
- form: form,
- type: "text",
- value: inputValue
- }, ariaAttributes));
- }
- }, {
- key: "renderPlaceholderOrValue",
- value: function renderPlaceholderOrValue() {
- var _this3 = this;
- var _this$getComponents2 = this.getComponents(),
- MultiValue = _this$getComponents2.MultiValue,
- MultiValueContainer = _this$getComponents2.MultiValueContainer,
- MultiValueLabel = _this$getComponents2.MultiValueLabel,
- MultiValueRemove = _this$getComponents2.MultiValueRemove,
- SingleValue = _this$getComponents2.SingleValue,
- Placeholder = _this$getComponents2.Placeholder;
- var commonProps = this.commonProps;
- var _this$props9 = this.props,
- controlShouldRenderValue = _this$props9.controlShouldRenderValue,
- isDisabled = _this$props9.isDisabled,
- isMulti = _this$props9.isMulti,
- inputValue = _this$props9.inputValue,
- placeholder = _this$props9.placeholder;
- var _this$state5 = this.state,
- selectValue = _this$state5.selectValue,
- focusedValue = _this$state5.focusedValue,
- isFocused = _this$state5.isFocused;
- if (!this.hasValue() || !controlShouldRenderValue) {
- return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends({}, commonProps, {
- key: "placeholder",
- isDisabled: isDisabled,
- isFocused: isFocused,
- innerProps: {
- id: this.getElementId('placeholder')
- }
- }), placeholder);
- }
- if (isMulti) {
- return selectValue.map(function (opt, index) {
- var isOptionFocused = opt === focusedValue;
- var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
- return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends({}, commonProps, {
- components: {
- Container: MultiValueContainer,
- Label: MultiValueLabel,
- Remove: MultiValueRemove
- },
- isFocused: isOptionFocused,
- isDisabled: isDisabled,
- key: key,
- index: index,
- removeProps: {
- onClick: function onClick() {
- return _this3.removeValue(opt);
- },
- onTouchEnd: function onTouchEnd() {
- return _this3.removeValue(opt);
- },
- onMouseDown: function onMouseDown(e) {
- e.preventDefault();
- }
- },
- data: opt
- }), _this3.formatOptionLabel(opt, 'value'));
- });
- }
- if (inputValue) {
- return null;
- }
- var singleValue = selectValue[0];
- return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends({}, commonProps, {
- data: singleValue,
- isDisabled: isDisabled
- }), this.formatOptionLabel(singleValue, 'value'));
- }
- }, {
- key: "renderClearIndicator",
- value: function renderClearIndicator() {
- var _this$getComponents3 = this.getComponents(),
- ClearIndicator = _this$getComponents3.ClearIndicator;
- var commonProps = this.commonProps;
- var _this$props10 = this.props,
- isDisabled = _this$props10.isDisabled,
- isLoading = _this$props10.isLoading;
- var isFocused = this.state.isFocused;
- if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
- return null;
- }
- var innerProps = {
- onMouseDown: this.onClearIndicatorMouseDown,
- onTouchEnd: this.onClearIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderLoadingIndicator",
- value: function renderLoadingIndicator() {
- var _this$getComponents4 = this.getComponents(),
- LoadingIndicator = _this$getComponents4.LoadingIndicator;
- var commonProps = this.commonProps;
- var _this$props11 = this.props,
- isDisabled = _this$props11.isDisabled,
- isLoading = _this$props11.isLoading;
- var isFocused = this.state.isFocused;
- if (!LoadingIndicator || !isLoading) return null;
- var innerProps = {
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderIndicatorSeparator",
- value: function renderIndicatorSeparator() {
- var _this$getComponents5 = this.getComponents(),
- DropdownIndicator = _this$getComponents5.DropdownIndicator,
- IndicatorSeparator = _this$getComponents5.IndicatorSeparator;
-
- // separator doesn't make sense without the dropdown indicator
- if (!DropdownIndicator || !IndicatorSeparator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends({}, commonProps, {
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderDropdownIndicator",
- value: function renderDropdownIndicator() {
- var _this$getComponents6 = this.getComponents(),
- DropdownIndicator = _this$getComponents6.DropdownIndicator;
- if (!DropdownIndicator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- var innerProps = {
- onMouseDown: this.onDropdownIndicatorMouseDown,
- onTouchEnd: this.onDropdownIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderMenu",
- value: function renderMenu() {
- var _this4 = this;
- var _this$getComponents7 = this.getComponents(),
- Group = _this$getComponents7.Group,
- GroupHeading = _this$getComponents7.GroupHeading,
- Menu = _this$getComponents7.Menu,
- MenuList = _this$getComponents7.MenuList,
- MenuPortal = _this$getComponents7.MenuPortal,
- LoadingMessage = _this$getComponents7.LoadingMessage,
- NoOptionsMessage = _this$getComponents7.NoOptionsMessage,
- Option = _this$getComponents7.Option;
- var commonProps = this.commonProps;
- var focusedOption = this.state.focusedOption;
- var _this$props12 = this.props,
- captureMenuScroll = _this$props12.captureMenuScroll,
- inputValue = _this$props12.inputValue,
- isLoading = _this$props12.isLoading,
- loadingMessage = _this$props12.loadingMessage,
- minMenuHeight = _this$props12.minMenuHeight,
- maxMenuHeight = _this$props12.maxMenuHeight,
- menuIsOpen = _this$props12.menuIsOpen,
- menuPlacement = _this$props12.menuPlacement,
- menuPosition = _this$props12.menuPosition,
- menuPortalTarget = _this$props12.menuPortalTarget,
- menuShouldBlockScroll = _this$props12.menuShouldBlockScroll,
- menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView,
- noOptionsMessage = _this$props12.noOptionsMessage,
- onMenuScrollToTop = _this$props12.onMenuScrollToTop,
- onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
- if (!menuIsOpen) return null;
-
- // TODO: Internal Option Type here
- var render = function render(props, id) {
- var type = props.type,
- data = props.data,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected,
- label = props.label,
- value = props.value;
- var isFocused = focusedOption === data;
- var onHover = isDisabled ? undefined : function () {
- return _this4.onOptionHover(data);
- };
- var onSelect = isDisabled ? undefined : function () {
- return _this4.selectOption(data);
- };
- var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
- var innerProps = {
- id: optionId,
- onClick: onSelect,
- onMouseMove: onHover,
- onMouseOver: onHover,
- tabIndex: -1
- };
- return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
- innerProps: innerProps,
- data: data,
- isDisabled: isDisabled,
- isSelected: isSelected,
- key: optionId,
- label: label,
- type: type,
- value: value,
- isFocused: isFocused,
- innerRef: isFocused ? _this4.getFocusedOptionRef : undefined
- }), _this4.formatOptionLabel(props.data, 'menu'));
- };
- var menuUI;
- if (this.hasOptions()) {
- menuUI = this.getCategorizedOptions().map(function (item) {
- if (item.type === 'group') {
- var _data = item.data,
- options = item.options,
- groupIndex = item.index;
- var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
- var headingId = "".concat(groupId, "-heading");
- return /*#__PURE__*/React__namespace.createElement(Group, _extends({}, commonProps, {
- key: groupId,
- data: _data,
- options: options,
- Heading: GroupHeading,
- headingProps: {
- id: headingId,
- data: item.data
- },
- label: _this4.formatGroupLabel(item.data)
- }), item.options.map(function (option) {
- return render(option, "".concat(groupIndex, "-").concat(option.index));
- }));
- } else if (item.type === 'option') {
- return render(item, "".concat(item.index));
- }
- });
- } else if (isLoading) {
- var message = loadingMessage({
- inputValue: inputValue
- });
- if (message === null) return null;
- menuUI = /*#__PURE__*/React__namespace.createElement(LoadingMessage, commonProps, message);
- } else {
- var _message = noOptionsMessage({
- inputValue: inputValue
- });
- if (_message === null) return null;
- menuUI = /*#__PURE__*/React__namespace.createElement(NoOptionsMessage, commonProps, _message);
- }
- var menuPlacementProps = {
- minMenuHeight: minMenuHeight,
- maxMenuHeight: maxMenuHeight,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition,
- menuShouldScrollIntoView: menuShouldScrollIntoView
- };
- var menuElement = /*#__PURE__*/React__namespace.createElement(index.MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref4) {
- var ref = _ref4.ref,
- _ref4$placerProps = _ref4.placerProps,
- placement = _ref4$placerProps.placement,
- maxHeight = _ref4$placerProps.maxHeight;
- return /*#__PURE__*/React__namespace.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {
- innerRef: ref,
- innerProps: {
- onMouseDown: _this4.onMenuMouseDown,
- onMouseMove: _this4.onMenuMouseMove,
- id: _this4.getElementId('listbox')
- },
- isLoading: isLoading,
- placement: placement
- }), /*#__PURE__*/React__namespace.createElement(ScrollManager, {
- captureEnabled: captureMenuScroll,
- onTopArrive: onMenuScrollToTop,
- onBottomArrive: onMenuScrollToBottom,
- lockEnabled: menuShouldBlockScroll
- }, function (scrollTargetRef) {
- return /*#__PURE__*/React__namespace.createElement(MenuList, _extends({}, commonProps, {
- innerRef: function innerRef(instance) {
- _this4.getMenuListRef(instance);
- scrollTargetRef(instance);
- },
- isLoading: isLoading,
- maxHeight: maxHeight,
- focusedOption: focusedOption
- }), menuUI);
- }));
- });
-
- // positioning behaviour is almost identical for portalled and fixed,
- // so we use the same component. the actual portalling logic is forked
- // within the component based on `menuPosition`
- return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends({}, commonProps, {
- appendTo: menuPortalTarget,
- controlElement: this.controlRef,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition
- }), menuElement) : menuElement;
- }
- }, {
- key: "renderFormField",
- value: function renderFormField() {
- var _this5 = this;
- var _this$props13 = this.props,
- delimiter = _this$props13.delimiter,
- isDisabled = _this$props13.isDisabled,
- isMulti = _this$props13.isMulti,
- name = _this$props13.name,
- required = _this$props13.required;
- var selectValue = this.state.selectValue;
- if (!name || isDisabled) return;
- if (required && !this.hasValue()) {
- return /*#__PURE__*/React__namespace.createElement(RequiredInput, {
- name: name,
- onFocus: this.onValueInputFocus
- });
- }
- if (isMulti) {
- if (delimiter) {
- var value = selectValue.map(function (opt) {
- return _this5.getOptionValue(opt);
- }).join(delimiter);
- return /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: value
- });
- } else {
- var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {
- return /*#__PURE__*/React__namespace.createElement("input", {
- key: "i-".concat(i),
- name: name,
- type: "hidden",
- value: _this5.getOptionValue(opt)
- });
- }) : /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: ""
- });
- return /*#__PURE__*/React__namespace.createElement("div", null, input);
- }
- } else {
- var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';
- return /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: _value
- });
- }
- }
- }, {
- key: "renderLiveRegion",
- value: function renderLiveRegion() {
- var commonProps = this.commonProps;
- var _this$state6 = this.state,
- ariaSelection = _this$state6.ariaSelection,
- focusedOption = _this$state6.focusedOption,
- focusedValue = _this$state6.focusedValue,
- isFocused = _this$state6.isFocused,
- selectValue = _this$state6.selectValue;
- var focusableOptions = this.getFocusableOptions();
- return /*#__PURE__*/React__namespace.createElement(LiveRegion, _extends({}, commonProps, {
- id: this.getElementId('live-region'),
- ariaSelection: ariaSelection,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- isFocused: isFocused,
- selectValue: selectValue,
- focusableOptions: focusableOptions
- }));
- }
- }, {
- key: "render",
- value: function render() {
- var _this$getComponents8 = this.getComponents(),
- Control = _this$getComponents8.Control,
- IndicatorsContainer = _this$getComponents8.IndicatorsContainer,
- SelectContainer = _this$getComponents8.SelectContainer,
- ValueContainer = _this$getComponents8.ValueContainer;
- var _this$props14 = this.props,
- className = _this$props14.className,
- id = _this$props14.id,
- isDisabled = _this$props14.isDisabled,
- menuIsOpen = _this$props14.menuIsOpen;
- var isFocused = this.state.isFocused;
- var commonProps = this.commonProps = this.getCommonProps();
- return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends({}, commonProps, {
- className: className,
- innerProps: {
- id: id,
- onKeyDown: this.onKeyDown
- },
- isDisabled: isDisabled,
- isFocused: isFocused
- }), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends({}, commonProps, {
- innerRef: this.getControlRef,
- innerProps: {
- onMouseDown: this.onControlMouseDown,
- onTouchEnd: this.onControlTouchEnd
- },
- isDisabled: isDisabled,
- isFocused: isFocused,
- menuIsOpen: menuIsOpen
- }), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function getDerivedStateFromProps(props, state) {
- var prevProps = state.prevProps,
- clearFocusValueOnUpdate = state.clearFocusValueOnUpdate,
- inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
- ariaSelection = state.ariaSelection,
- isFocused = state.isFocused,
- prevWasFocused = state.prevWasFocused;
- var options = props.options,
- value = props.value,
- menuIsOpen = props.menuIsOpen,
- inputValue = props.inputValue,
- isMulti = props.isMulti;
- var selectValue = index.cleanValue(value);
- var newMenuOptionsState = {};
- if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
- var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
- var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
- var focusedOption = getNextFocusedOption(state, focusableOptions);
- newMenuOptionsState = {
- selectValue: selectValue,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- clearFocusValueOnUpdate: false
- };
- }
- // some updates should toggle the state of the input visibility
- var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
- inputIsHidden: inputIsHiddenAfterUpdate,
- inputIsHiddenAfterUpdate: undefined
- } : {};
- var newAriaSelection = ariaSelection;
- var hasKeptFocus = isFocused && prevWasFocused;
- if (isFocused && !hasKeptFocus) {
- // If `value` or `defaultValue` props are not empty then announce them
- // when the Select is initially focused
- newAriaSelection = {
- value: index.valueTernary(isMulti, selectValue, selectValue[0] || null),
- options: selectValue,
- action: 'initial-input-focus'
- };
- hasKeptFocus = !prevWasFocused;
- }
-
- // If the 'initial-input-focus' action has been set already
- // then reset the ariaSelection to null
- if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') {
- newAriaSelection = null;
- }
- return _objectSpread(_objectSpread(_objectSpread({}, newMenuOptionsState), newInputIsHiddenState), {}, {
- prevProps: props,
- ariaSelection: newAriaSelection,
- prevWasFocused: hasKeptFocus
- });
- }
- }]);
- return Select;
-}(React.Component);
-Select.defaultProps = defaultProps;
-
-exports.Select = Select;
-exports.createFilter = createFilter;
-exports.defaultProps = defaultProps;
-exports.defaultTheme = defaultTheme;
-exports.getOptionLabel = getOptionLabel$1;
-exports.getOptionValue = getOptionValue$1;
-exports.mergeStyles = mergeStyles;
diff --git a/frontend/node_modules/react-select/dist/Select-a4b66b9e.cjs.prod.js b/frontend/node_modules/react-select/dist/Select-a4b66b9e.cjs.prod.js
deleted file mode 100644
index 98448b290..000000000
--- a/frontend/node_modules/react-select/dist/Select-a4b66b9e.cjs.prod.js
+++ /dev/null
@@ -1,2584 +0,0 @@
-'use strict';
-
-var _extends = require('@babel/runtime/helpers/extends');
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
-var _createClass = require('@babel/runtime/helpers/createClass');
-var _inherits = require('@babel/runtime/helpers/inherits');
-var _createSuper = require('@babel/runtime/helpers/createSuper');
-var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
-var React = require('react');
-var index = require('./index-78cf371e.cjs.prod.js');
-var react = require('@emotion/react');
-var memoizeOne = require('memoize-one');
-var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
-
-function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
-
-function _interopNamespace(e) {
- if (e && e.__esModule) return e;
- var n = Object.create(null);
- if (e) {
- Object.keys(e).forEach(function (k) {
- if (k !== 'default') {
- var d = Object.getOwnPropertyDescriptor(e, k);
- Object.defineProperty(n, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return e[k];
- }
- });
- }
- });
- }
- n['default'] = e;
- return Object.freeze(n);
-}
-
-var React__namespace = /*#__PURE__*/_interopNamespace(React);
-var memoizeOne__default = /*#__PURE__*/_interopDefault(memoizeOne);
-
-// Assistive text to describe visual elements. Hidden for sighted users.
-var _ref = {
- name: "7pg0cj-a11yText",
- styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
-} ;
-var A11yText = function A11yText(props) {
- return react.jsx("span", _extends({
- css: _ref
- }, props));
-};
-
-var defaultAriaLiveMessages = {
- guidance: function guidance(props) {
- var isSearchable = props.isSearchable,
- isMulti = props.isMulti,
- isDisabled = props.isDisabled,
- tabSelectsValue = props.tabSelectsValue,
- context = props.context;
- switch (context) {
- case 'menu':
- return "Use Up and Down to choose options".concat(isDisabled ? '' : ', press Enter to select the currently focused option', ", press Escape to exit the menu").concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
- case 'input':
- return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
- case 'value':
- return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
- default:
- return '';
- }
- },
- onChange: function onChange(props) {
- var action = props.action,
- _props$label = props.label,
- label = _props$label === void 0 ? '' : _props$label,
- labels = props.labels,
- isDisabled = props.isDisabled;
- switch (action) {
- case 'deselect-option':
- case 'pop-value':
- case 'remove-value':
- return "option ".concat(label, ", deselected.");
- case 'clear':
- return 'All selected options have been cleared.';
- case 'initial-input-focus':
- return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected.");
- case 'select-option':
- return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected.");
- default:
- return '';
- }
- },
- onFocus: function onFocus(props) {
- var context = props.context,
- focused = props.focused,
- options = props.options,
- _props$label2 = props.label,
- label = _props$label2 === void 0 ? '' : _props$label2,
- selectValue = props.selectValue,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected;
- var getArrayIndex = function getArrayIndex(arr, item) {
- return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
- };
- if (context === 'value' && selectValue) {
- return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
- }
- if (context === 'menu') {
- var disabled = isDisabled ? ' disabled' : '';
- var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
- return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
- }
- return '';
- },
- onFilter: function onFilter(props) {
- var inputValue = props.inputValue,
- resultsMessage = props.resultsMessage;
- return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', ".");
- }
-};
-
-var LiveRegion = function LiveRegion(props) {
- var ariaSelection = props.ariaSelection,
- focusedOption = props.focusedOption,
- focusedValue = props.focusedValue,
- focusableOptions = props.focusableOptions,
- isFocused = props.isFocused,
- selectValue = props.selectValue,
- selectProps = props.selectProps,
- id = props.id;
- var ariaLiveMessages = selectProps.ariaLiveMessages,
- getOptionLabel = selectProps.getOptionLabel,
- inputValue = selectProps.inputValue,
- isMulti = selectProps.isMulti,
- isOptionDisabled = selectProps.isOptionDisabled,
- isSearchable = selectProps.isSearchable,
- menuIsOpen = selectProps.menuIsOpen,
- options = selectProps.options,
- screenReaderStatus = selectProps.screenReaderStatus,
- tabSelectsValue = selectProps.tabSelectsValue;
- var ariaLabel = selectProps['aria-label'];
- var ariaLive = selectProps['aria-live'];
-
- // Update aria live message configuration when prop changes
- var messages = React.useMemo(function () {
- return _objectSpread(_objectSpread({}, defaultAriaLiveMessages), ariaLiveMessages || {});
- }, [ariaLiveMessages]);
-
- // Update aria live selected option when prop changes
- var ariaSelected = React.useMemo(function () {
- var message = '';
- if (ariaSelection && messages.onChange) {
- var option = ariaSelection.option,
- selectedOptions = ariaSelection.options,
- removedValue = ariaSelection.removedValue,
- removedValues = ariaSelection.removedValues,
- value = ariaSelection.value;
- // select-option when !isMulti does not return option so we assume selected option is value
- var asOption = function asOption(val) {
- return !Array.isArray(val) ? val : null;
- };
-
- // If there is just one item from the action then get its label
- var selected = removedValue || option || asOption(value);
- var label = selected ? getOptionLabel(selected) : '';
-
- // If there are multiple items from the action then return an array of labels
- var multiSelected = selectedOptions || removedValues || undefined;
- var labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
- var onChangeProps = _objectSpread({
- // multiSelected items are usually items that have already been selected
- // or set by the user as a default value so we assume they are not disabled
- isDisabled: selected && isOptionDisabled(selected, selectValue),
- label: label,
- labels: labels
- }, ariaSelection);
- message = messages.onChange(onChangeProps);
- }
- return message;
- }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]);
- var ariaFocused = React.useMemo(function () {
- var focusMsg = '';
- var focused = focusedOption || focusedValue;
- var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
- if (focused && messages.onFocus) {
- var onFocusProps = {
- focused: focused,
- label: getOptionLabel(focused),
- isDisabled: isOptionDisabled(focused, selectValue),
- isSelected: isSelected,
- options: focusableOptions,
- context: focused === focusedOption ? 'menu' : 'value',
- selectValue: selectValue
- };
- focusMsg = messages.onFocus(onFocusProps);
- }
- return focusMsg;
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
- var ariaResults = React.useMemo(function () {
- var resultsMsg = '';
- if (menuIsOpen && options.length && messages.onFilter) {
- var resultsMessage = screenReaderStatus({
- count: focusableOptions.length
- });
- resultsMsg = messages.onFilter({
- inputValue: inputValue,
- resultsMessage: resultsMessage
- });
- }
- return resultsMsg;
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
- var ariaGuidance = React.useMemo(function () {
- var guidanceMsg = '';
- if (messages.guidance) {
- var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';
- guidanceMsg = messages.guidance({
- 'aria-label': ariaLabel,
- context: context,
- isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
- isMulti: isMulti,
- isSearchable: isSearchable,
- tabSelectsValue: tabSelectsValue
- });
- }
- return guidanceMsg;
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
- var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
- var ScreenReaderText = react.jsx(React.Fragment, null, react.jsx("span", {
- id: "aria-selection"
- }, ariaSelected), react.jsx("span", {
- id: "aria-context"
- }, ariaContext));
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
- return react.jsx(React.Fragment, null, react.jsx(A11yText, {
- id: id
- }, isInitialFocus && ScreenReaderText), react.jsx(A11yText, {
- "aria-live": ariaLive,
- "aria-atomic": "false",
- "aria-relevant": "additions text"
- }, isFocused && !isInitialFocus && ScreenReaderText));
-};
-
-var diacritics = [{
- base: 'A',
- letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
-}, {
- base: 'AA',
- letters: "\uA732"
-}, {
- base: 'AE',
- letters: "\xC6\u01FC\u01E2"
-}, {
- base: 'AO',
- letters: "\uA734"
-}, {
- base: 'AU',
- letters: "\uA736"
-}, {
- base: 'AV',
- letters: "\uA738\uA73A"
-}, {
- base: 'AY',
- letters: "\uA73C"
-}, {
- base: 'B',
- letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
-}, {
- base: 'C',
- letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
-}, {
- base: 'D',
- letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
-}, {
- base: 'DZ',
- letters: "\u01F1\u01C4"
-}, {
- base: 'Dz',
- letters: "\u01F2\u01C5"
-}, {
- base: 'E',
- letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
-}, {
- base: 'F',
- letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
-}, {
- base: 'G',
- letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
-}, {
- base: 'H',
- letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
-}, {
- base: 'I',
- letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
-}, {
- base: 'J',
- letters: "J\u24BF\uFF2A\u0134\u0248"
-}, {
- base: 'K',
- letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
-}, {
- base: 'L',
- letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
-}, {
- base: 'LJ',
- letters: "\u01C7"
-}, {
- base: 'Lj',
- letters: "\u01C8"
-}, {
- base: 'M',
- letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
-}, {
- base: 'N',
- letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
-}, {
- base: 'NJ',
- letters: "\u01CA"
-}, {
- base: 'Nj',
- letters: "\u01CB"
-}, {
- base: 'O',
- letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
-}, {
- base: 'OI',
- letters: "\u01A2"
-}, {
- base: 'OO',
- letters: "\uA74E"
-}, {
- base: 'OU',
- letters: "\u0222"
-}, {
- base: 'P',
- letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
-}, {
- base: 'Q',
- letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
-}, {
- base: 'R',
- letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
-}, {
- base: 'S',
- letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
-}, {
- base: 'T',
- letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
-}, {
- base: 'TZ',
- letters: "\uA728"
-}, {
- base: 'U',
- letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
-}, {
- base: 'V',
- letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
-}, {
- base: 'VY',
- letters: "\uA760"
-}, {
- base: 'W',
- letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
-}, {
- base: 'X',
- letters: "X\u24CD\uFF38\u1E8A\u1E8C"
-}, {
- base: 'Y',
- letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
-}, {
- base: 'Z',
- letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
-}, {
- base: 'a',
- letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
-}, {
- base: 'aa',
- letters: "\uA733"
-}, {
- base: 'ae',
- letters: "\xE6\u01FD\u01E3"
-}, {
- base: 'ao',
- letters: "\uA735"
-}, {
- base: 'au',
- letters: "\uA737"
-}, {
- base: 'av',
- letters: "\uA739\uA73B"
-}, {
- base: 'ay',
- letters: "\uA73D"
-}, {
- base: 'b',
- letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
-}, {
- base: 'c',
- letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
-}, {
- base: 'd',
- letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
-}, {
- base: 'dz',
- letters: "\u01F3\u01C6"
-}, {
- base: 'e',
- letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
-}, {
- base: 'f',
- letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
-}, {
- base: 'g',
- letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
-}, {
- base: 'h',
- letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
-}, {
- base: 'hv',
- letters: "\u0195"
-}, {
- base: 'i',
- letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
-}, {
- base: 'j',
- letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
-}, {
- base: 'k',
- letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
-}, {
- base: 'l',
- letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
-}, {
- base: 'lj',
- letters: "\u01C9"
-}, {
- base: 'm',
- letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
-}, {
- base: 'n',
- letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
-}, {
- base: 'nj',
- letters: "\u01CC"
-}, {
- base: 'o',
- letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
-}, {
- base: 'oi',
- letters: "\u01A3"
-}, {
- base: 'ou',
- letters: "\u0223"
-}, {
- base: 'oo',
- letters: "\uA74F"
-}, {
- base: 'p',
- letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
-}, {
- base: 'q',
- letters: "q\u24E0\uFF51\u024B\uA757\uA759"
-}, {
- base: 'r',
- letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
-}, {
- base: 's',
- letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
-}, {
- base: 't',
- letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
-}, {
- base: 'tz',
- letters: "\uA729"
-}, {
- base: 'u',
- letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
-}, {
- base: 'v',
- letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
-}, {
- base: 'vy',
- letters: "\uA761"
-}, {
- base: 'w',
- letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
-}, {
- base: 'x',
- letters: "x\u24E7\uFF58\u1E8B\u1E8D"
-}, {
- base: 'y',
- letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
-}, {
- base: 'z',
- letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
-}];
-var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
- return d.letters;
-}).join('') + ']', 'g');
-var diacriticToBase = {};
-for (var i = 0; i < diacritics.length; i++) {
- var diacritic = diacritics[i];
- for (var j = 0; j < diacritic.letters.length; j++) {
- diacriticToBase[diacritic.letters[j]] = diacritic.base;
- }
-}
-var stripDiacritics = function stripDiacritics(str) {
- return str.replace(anyDiacritic, function (match) {
- return diacriticToBase[match];
- });
-};
-
-var memoizedStripDiacriticsForInput = memoizeOne__default['default'](stripDiacritics);
-var trimString = function trimString(str) {
- return str.replace(/^\s+|\s+$/g, '');
-};
-var defaultStringify = function defaultStringify(option) {
- return "".concat(option.label, " ").concat(option.value);
-};
-var createFilter = function createFilter(config) {
- return function (option, rawInput) {
- // eslint-disable-next-line no-underscore-dangle
- if (option.data.__isNew__) return true;
- var _ignoreCase$ignoreAcc = _objectSpread({
- ignoreCase: true,
- ignoreAccents: true,
- stringify: defaultStringify,
- trim: true,
- matchFrom: 'any'
- }, config),
- ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,
- ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,
- stringify = _ignoreCase$ignoreAcc.stringify,
- trim = _ignoreCase$ignoreAcc.trim,
- matchFrom = _ignoreCase$ignoreAcc.matchFrom;
- var input = trim ? trimString(rawInput) : rawInput;
- var candidate = trim ? trimString(stringify(option)) : stringify(option);
- if (ignoreCase) {
- input = input.toLowerCase();
- candidate = candidate.toLowerCase();
- }
- if (ignoreAccents) {
- input = memoizedStripDiacriticsForInput(input);
- candidate = stripDiacritics(candidate);
- }
- return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
- };
-};
-
-var _excluded = ["innerRef"];
-function DummyInput(_ref) {
- var innerRef = _ref.innerRef,
- props = _objectWithoutProperties(_ref, _excluded);
- // Remove animation props not meant for HTML elements
- var filteredProps = index.removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
- return react.jsx("input", _extends({
- ref: innerRef
- }, filteredProps, {
- css: /*#__PURE__*/react.css({
- label: 'dummyInput',
- // get rid of any default styles
- background: 0,
- border: 0,
- // important! this hides the flashing cursor
- caretColor: 'transparent',
- fontSize: 'inherit',
- gridArea: '1 / 1 / 2 / 3',
- outline: 0,
- padding: 0,
- // important! without `width` browsers won't allow focus
- width: 1,
- // remove cursor on desktop
- color: 'transparent',
- // remove cursor on mobile whilst maintaining "scroll into view" behaviour
- left: -100,
- opacity: 0,
- position: 'relative',
- transform: 'scale(.01)'
- }, "" , "" )
- }));
-}
-
-var cancelScroll = function cancelScroll(event) {
- event.preventDefault();
- event.stopPropagation();
-};
-function useScrollCapture(_ref) {
- var isEnabled = _ref.isEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var isBottom = React.useRef(false);
- var isTop = React.useRef(false);
- var touchStart = React.useRef(0);
- var scrollTarget = React.useRef(null);
- var handleEventDelta = React.useCallback(function (event, delta) {
- if (scrollTarget.current === null) return;
- var _scrollTarget$current = scrollTarget.current,
- scrollTop = _scrollTarget$current.scrollTop,
- scrollHeight = _scrollTarget$current.scrollHeight,
- clientHeight = _scrollTarget$current.clientHeight;
- var target = scrollTarget.current;
- var isDeltaPositive = delta > 0;
- var availableScroll = scrollHeight - clientHeight - scrollTop;
- var shouldCancelScroll = false;
-
- // reset bottom/top flags
- if (availableScroll > delta && isBottom.current) {
- if (onBottomLeave) onBottomLeave(event);
- isBottom.current = false;
- }
- if (isDeltaPositive && isTop.current) {
- if (onTopLeave) onTopLeave(event);
- isTop.current = false;
- }
-
- // bottom limit
- if (isDeltaPositive && delta > availableScroll) {
- if (onBottomArrive && !isBottom.current) {
- onBottomArrive(event);
- }
- target.scrollTop = scrollHeight;
- shouldCancelScroll = true;
- isBottom.current = true;
-
- // top limit
- } else if (!isDeltaPositive && -delta > scrollTop) {
- if (onTopArrive && !isTop.current) {
- onTopArrive(event);
- }
- target.scrollTop = 0;
- shouldCancelScroll = true;
- isTop.current = true;
- }
-
- // cancel scroll
- if (shouldCancelScroll) {
- cancelScroll(event);
- }
- }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
- var onWheel = React.useCallback(function (event) {
- handleEventDelta(event, event.deltaY);
- }, [handleEventDelta]);
- var onTouchStart = React.useCallback(function (event) {
- // set touch start so we can calculate touchmove delta
- touchStart.current = event.changedTouches[0].clientY;
- }, []);
- var onTouchMove = React.useCallback(function (event) {
- var deltaY = touchStart.current - event.changedTouches[0].clientY;
- handleEventDelta(event, deltaY);
- }, [handleEventDelta]);
- var startListening = React.useCallback(function (el) {
- // bail early if no element is available to attach to
- if (!el) return;
- var notPassive = index.supportsPassiveEvents ? {
- passive: false
- } : false;
- el.addEventListener('wheel', onWheel, notPassive);
- el.addEventListener('touchstart', onTouchStart, notPassive);
- el.addEventListener('touchmove', onTouchMove, notPassive);
- }, [onTouchMove, onTouchStart, onWheel]);
- var stopListening = React.useCallback(function (el) {
- // bail early if no element is available to detach from
- if (!el) return;
- el.removeEventListener('wheel', onWheel, false);
- el.removeEventListener('touchstart', onTouchStart, false);
- el.removeEventListener('touchmove', onTouchMove, false);
- }, [onTouchMove, onTouchStart, onWheel]);
- React.useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- startListening(element);
- return function () {
- stopListening(element);
- };
- }, [isEnabled, startListening, stopListening]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];
-var LOCK_STYLES = {
- boxSizing: 'border-box',
- // account for possible declaration `width: 100%;` on body
- overflow: 'hidden',
- position: 'relative',
- height: '100%'
-};
-function preventTouchMove(e) {
- e.preventDefault();
-}
-function allowTouchMove(e) {
- e.stopPropagation();
-}
-function preventInertiaScroll() {
- var top = this.scrollTop;
- var totalScroll = this.scrollHeight;
- var currentScroll = top + this.offsetHeight;
- if (top === 0) {
- this.scrollTop = 1;
- } else if (currentScroll === totalScroll) {
- this.scrollTop = top - 1;
- }
-}
-
-// `ontouchstart` check works on most browsers
-// `maxTouchPoints` works on IE10/11 and Surface
-function isTouchDevice() {
- return 'ontouchstart' in window || navigator.maxTouchPoints;
-}
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-var activeScrollLocks = 0;
-var listenerOptions = {
- capture: false,
- passive: false
-};
-function useScrollLock(_ref) {
- var isEnabled = _ref.isEnabled,
- _ref$accountForScroll = _ref.accountForScrollbars,
- accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
- var originalStyles = React.useRef({});
- var scrollTarget = React.useRef(null);
- var addScrollLock = React.useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
- if (accountForScrollbars) {
- // store any styles already applied to the body
- STYLE_KEYS.forEach(function (key) {
- var val = targetStyle && targetStyle[key];
- originalStyles.current[key] = val;
- });
- }
-
- // apply the lock styles and padding if this is the first scroll lock
- if (accountForScrollbars && activeScrollLocks < 1) {
- var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
- var clientWidth = document.body ? document.body.clientWidth : 0;
- var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
- Object.keys(LOCK_STYLES).forEach(function (key) {
- var val = LOCK_STYLES[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- if (targetStyle) {
- targetStyle.paddingRight = "".concat(adjustedPadding, "px");
- }
- }
-
- // account for touch devices
- if (target && isTouchDevice()) {
- // Mobile Safari ignores { overflow: hidden } declaration on the body.
- target.addEventListener('touchmove', preventTouchMove, listenerOptions);
-
- // Allow scroll on provided target
- if (touchScrollTarget) {
- touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
-
- // increment active scroll locks
- activeScrollLocks += 1;
- }, [accountForScrollbars]);
- var removeScrollLock = React.useCallback(function (touchScrollTarget) {
- if (!canUseDOM) return;
- var target = document.body;
- var targetStyle = target && target.style;
-
- // safely decrement active scroll locks
- activeScrollLocks = Math.max(activeScrollLocks - 1, 0);
-
- // reapply original body styles, if any
- if (accountForScrollbars && activeScrollLocks < 1) {
- STYLE_KEYS.forEach(function (key) {
- var val = originalStyles.current[key];
- if (targetStyle) {
- targetStyle[key] = val;
- }
- });
- }
-
- // remove touch listeners
- if (target && isTouchDevice()) {
- target.removeEventListener('touchmove', preventTouchMove, listenerOptions);
- if (touchScrollTarget) {
- touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions);
- touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions);
- }
- }
- }, [accountForScrollbars]);
- React.useEffect(function () {
- if (!isEnabled) return;
- var element = scrollTarget.current;
- addScrollLock(element);
- return function () {
- removeScrollLock(element);
- };
- }, [isEnabled, addScrollLock, removeScrollLock]);
- return function (element) {
- scrollTarget.current = element;
- };
-}
-
-var blurSelectInput = function blurSelectInput() {
- return document.activeElement && document.activeElement.blur();
-};
-var _ref2$1 = {
- name: "1kfdb0e",
- styles: "position:fixed;left:0;bottom:0;right:0;top:0"
-} ;
-function ScrollManager(_ref) {
- var children = _ref.children,
- lockEnabled = _ref.lockEnabled,
- _ref$captureEnabled = _ref.captureEnabled,
- captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled,
- onBottomArrive = _ref.onBottomArrive,
- onBottomLeave = _ref.onBottomLeave,
- onTopArrive = _ref.onTopArrive,
- onTopLeave = _ref.onTopLeave;
- var setScrollCaptureTarget = useScrollCapture({
- isEnabled: captureEnabled,
- onBottomArrive: onBottomArrive,
- onBottomLeave: onBottomLeave,
- onTopArrive: onTopArrive,
- onTopLeave: onTopLeave
- });
- var setScrollLockTarget = useScrollLock({
- isEnabled: lockEnabled
- });
- var targetRef = function targetRef(element) {
- setScrollCaptureTarget(element);
- setScrollLockTarget(element);
- };
- return react.jsx(React.Fragment, null, lockEnabled && react.jsx("div", {
- onClick: blurSelectInput,
- css: _ref2$1
- }), children(targetRef));
-}
-
-var _ref2 = {
- name: "1a0ro4n-requiredInput",
- styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
-} ;
-var RequiredInput = function RequiredInput(_ref) {
- var name = _ref.name,
- onFocus = _ref.onFocus;
- return react.jsx("input", {
- required: true,
- name: name,
- tabIndex: -1,
- onFocus: onFocus,
- css: _ref2
- // Prevent `Switching from uncontrolled to controlled` error
- ,
- value: "",
- onChange: function onChange() {}
- });
-};
-
-var formatGroupLabel = function formatGroupLabel(group) {
- return group.label;
-};
-var getOptionLabel$1 = function getOptionLabel(option) {
- return option.label;
-};
-var getOptionValue$1 = function getOptionValue(option) {
- return option.value;
-};
-var isOptionDisabled = function isOptionDisabled(option) {
- return !!option.isDisabled;
-};
-
-var defaultStyles = {
- clearIndicator: index.clearIndicatorCSS,
- container: index.containerCSS,
- control: index.css,
- dropdownIndicator: index.dropdownIndicatorCSS,
- group: index.groupCSS,
- groupHeading: index.groupHeadingCSS,
- indicatorsContainer: index.indicatorsContainerCSS,
- indicatorSeparator: index.indicatorSeparatorCSS,
- input: index.inputCSS,
- loadingIndicator: index.loadingIndicatorCSS,
- loadingMessage: index.loadingMessageCSS,
- menu: index.menuCSS,
- menuList: index.menuListCSS,
- menuPortal: index.menuPortalCSS,
- multiValue: index.multiValueCSS,
- multiValueLabel: index.multiValueLabelCSS,
- multiValueRemove: index.multiValueRemoveCSS,
- noOptionsMessage: index.noOptionsMessageCSS,
- option: index.optionCSS,
- placeholder: index.placeholderCSS,
- singleValue: index.css$1,
- valueContainer: index.valueContainerCSS
-};
-// Merge Utility
-// Allows consumers to extend a base Select with additional styles
-
-function mergeStyles(source) {
- var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- // initialize with source styles
- var styles = _objectSpread({}, source);
-
- // massage in target styles
- Object.keys(target).forEach(function (keyAsString) {
- var key = keyAsString;
- if (source[key]) {
- styles[key] = function (rsCss, props) {
- return target[key](source[key](rsCss, props), props);
- };
- } else {
- styles[key] = target[key];
- }
- });
- return styles;
-}
-
-var colors = {
- primary: '#2684FF',
- primary75: '#4C9AFF',
- primary50: '#B2D4FF',
- primary25: '#DEEBFF',
- danger: '#DE350B',
- dangerLight: '#FFBDAD',
- neutral0: 'hsl(0, 0%, 100%)',
- neutral5: 'hsl(0, 0%, 95%)',
- neutral10: 'hsl(0, 0%, 90%)',
- neutral20: 'hsl(0, 0%, 80%)',
- neutral30: 'hsl(0, 0%, 70%)',
- neutral40: 'hsl(0, 0%, 60%)',
- neutral50: 'hsl(0, 0%, 50%)',
- neutral60: 'hsl(0, 0%, 40%)',
- neutral70: 'hsl(0, 0%, 30%)',
- neutral80: 'hsl(0, 0%, 20%)',
- neutral90: 'hsl(0, 0%, 10%)'
-};
-var borderRadius = 4;
-// Used to calculate consistent margin/padding on elements
-var baseUnit = 4;
-// The minimum height of the control
-var controlHeight = 38;
-// The amount of space between the control and menu */
-var menuGutter = baseUnit * 2;
-var spacing = {
- baseUnit: baseUnit,
- controlHeight: controlHeight,
- menuGutter: menuGutter
-};
-var defaultTheme = {
- borderRadius: borderRadius,
- colors: colors,
- spacing: spacing
-};
-
-var defaultProps = {
- 'aria-live': 'polite',
- backspaceRemovesValue: true,
- blurInputOnSelect: index.isTouchCapable(),
- captureMenuScroll: !index.isTouchCapable(),
- classNames: {},
- closeMenuOnSelect: true,
- closeMenuOnScroll: false,
- components: {},
- controlShouldRenderValue: true,
- escapeClearsValue: false,
- filterOption: createFilter(),
- formatGroupLabel: formatGroupLabel,
- getOptionLabel: getOptionLabel$1,
- getOptionValue: getOptionValue$1,
- isDisabled: false,
- isLoading: false,
- isMulti: false,
- isRtl: false,
- isSearchable: true,
- isOptionDisabled: isOptionDisabled,
- loadingMessage: function loadingMessage() {
- return 'Loading...';
- },
- maxMenuHeight: 300,
- minMenuHeight: 140,
- menuIsOpen: false,
- menuPlacement: 'bottom',
- menuPosition: 'absolute',
- menuShouldBlockScroll: false,
- menuShouldScrollIntoView: !index.isMobileDevice(),
- noOptionsMessage: function noOptionsMessage() {
- return 'No options';
- },
- openMenuOnFocus: false,
- openMenuOnClick: true,
- options: [],
- pageSize: 5,
- placeholder: 'Select...',
- screenReaderStatus: function screenReaderStatus(_ref) {
- var count = _ref.count;
- return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available");
- },
- styles: {},
- tabIndex: 0,
- tabSelectsValue: true,
- unstyled: false
-};
-function toCategorizedOption(props, option, selectValue, index) {
- var isDisabled = _isOptionDisabled(props, option, selectValue);
- var isSelected = _isOptionSelected(props, option, selectValue);
- var label = getOptionLabel(props, option);
- var value = getOptionValue(props, option);
- return {
- type: 'option',
- data: option,
- isDisabled: isDisabled,
- isSelected: isSelected,
- label: label,
- value: value,
- index: index
- };
-}
-function buildCategorizedOptions(props, selectValue) {
- return props.options.map(function (groupOrOption, groupOrOptionIndex) {
- if ('options' in groupOrOption) {
- var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) {
- return toCategorizedOption(props, option, selectValue, optionIndex);
- }).filter(function (categorizedOption) {
- return isFocusable(props, categorizedOption);
- });
- return categorizedOptions.length > 0 ? {
- type: 'group',
- data: groupOrOption,
- options: categorizedOptions,
- index: groupOrOptionIndex
- } : undefined;
- }
- var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
- return isFocusable(props, categorizedOption) ? categorizedOption : undefined;
- }).filter(index.notNullish);
-}
-function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
- if (categorizedOption.type === 'group') {
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
- return option.data;
- })));
- } else {
- optionsAccumulator.push(categorizedOption.data);
- }
- return optionsAccumulator;
- }, []);
-}
-function buildFocusableOptions(props, selectValue) {
- return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
-}
-function isFocusable(props, categorizedOption) {
- var _props$inputValue = props.inputValue,
- inputValue = _props$inputValue === void 0 ? '' : _props$inputValue;
- var data = categorizedOption.data,
- isSelected = categorizedOption.isSelected,
- label = categorizedOption.label,
- value = categorizedOption.value;
- return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
- label: label,
- value: value,
- data: data
- }, inputValue);
-}
-function getNextFocusedValue(state, nextSelectValue) {
- var focusedValue = state.focusedValue,
- lastSelectValue = state.selectValue;
- var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
- if (lastFocusedIndex > -1) {
- var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
- if (nextFocusedIndex > -1) {
- // the focused value is still in the selectValue, return it
- return focusedValue;
- } else if (lastFocusedIndex < nextSelectValue.length) {
- // the focusedValue is not present in the next selectValue array by
- // reference, so return the new value at the same index
- return nextSelectValue[lastFocusedIndex];
- }
- }
- return null;
-}
-function getNextFocusedOption(state, options) {
- var lastFocusedOption = state.focusedOption;
- return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
-}
-var getOptionLabel = function getOptionLabel(props, data) {
- return props.getOptionLabel(data);
-};
-var getOptionValue = function getOptionValue(props, data) {
- return props.getOptionValue(data);
-};
-function _isOptionDisabled(props, option, selectValue) {
- return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false;
-}
-function _isOptionSelected(props, option, selectValue) {
- if (selectValue.indexOf(option) > -1) return true;
- if (typeof props.isOptionSelected === 'function') {
- return props.isOptionSelected(option, selectValue);
- }
- var candidate = getOptionValue(props, option);
- return selectValue.some(function (i) {
- return getOptionValue(props, i) === candidate;
- });
-}
-function _filterOption(props, option, inputValue) {
- return props.filterOption ? props.filterOption(option, inputValue) : true;
-}
-var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) {
- var hideSelectedOptions = props.hideSelectedOptions,
- isMulti = props.isMulti;
- if (hideSelectedOptions === undefined) return isMulti;
- return hideSelectedOptions;
-};
-var instanceId = 1;
-var Select = /*#__PURE__*/function (_Component) {
- _inherits(Select, _Component);
- var _super = _createSuper(Select);
- // Misc. Instance Properties
- // ------------------------------
-
- // TODO
-
- // Refs
- // ------------------------------
-
- // Lifecycle
- // ------------------------------
-
- function Select(_props) {
- var _this;
- _classCallCheck(this, Select);
- _this = _super.call(this, _props);
- _this.state = {
- ariaSelection: null,
- focusedOption: null,
- focusedValue: null,
- inputIsHidden: false,
- isFocused: false,
- selectValue: [],
- clearFocusValueOnUpdate: false,
- prevWasFocused: false,
- inputIsHiddenAfterUpdate: undefined,
- prevProps: undefined
- };
- _this.blockOptionHover = false;
- _this.isComposing = false;
- _this.commonProps = void 0;
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- _this.instancePrefix = '';
- _this.openAfterFocus = false;
- _this.scrollToFocusedOptionOnUpdate = false;
- _this.userIsDragging = void 0;
- _this.controlRef = null;
- _this.getControlRef = function (ref) {
- _this.controlRef = ref;
- };
- _this.focusedOptionRef = null;
- _this.getFocusedOptionRef = function (ref) {
- _this.focusedOptionRef = ref;
- };
- _this.menuListRef = null;
- _this.getMenuListRef = function (ref) {
- _this.menuListRef = ref;
- };
- _this.inputRef = null;
- _this.getInputRef = function (ref) {
- _this.inputRef = ref;
- };
- _this.focus = _this.focusInput;
- _this.blur = _this.blurInput;
- _this.onChange = function (newValue, actionMeta) {
- var _this$props = _this.props,
- onChange = _this$props.onChange,
- name = _this$props.name;
- actionMeta.name = name;
- _this.ariaOnChange(newValue, actionMeta);
- onChange(newValue, actionMeta);
- };
- _this.setValue = function (newValue, action, option) {
- var _this$props2 = _this.props,
- closeMenuOnSelect = _this$props2.closeMenuOnSelect,
- isMulti = _this$props2.isMulti,
- inputValue = _this$props2.inputValue;
- _this.onInputChange('', {
- action: 'set-value',
- prevInputValue: inputValue
- });
- if (closeMenuOnSelect) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- }
- // when the select value should change, we should reset focusedValue
- _this.setState({
- clearFocusValueOnUpdate: true
- });
- _this.onChange(newValue, {
- action: action,
- option: option
- });
- };
- _this.selectOption = function (newValue) {
- var _this$props3 = _this.props,
- blurInputOnSelect = _this$props3.blurInputOnSelect,
- isMulti = _this$props3.isMulti,
- name = _this$props3.name;
- var selectValue = _this.state.selectValue;
- var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
- var isDisabled = _this.isOptionDisabled(newValue, selectValue);
- if (deselected) {
- var candidate = _this.getOptionValue(newValue);
- _this.setValue(index.multiValueAsValue(selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- })), 'deselect-option', newValue);
- } else if (!isDisabled) {
- // Select option if option is not disabled
- if (isMulti) {
- _this.setValue(index.multiValueAsValue([].concat(_toConsumableArray(selectValue), [newValue])), 'select-option', newValue);
- } else {
- _this.setValue(index.singleValueAsValue(newValue), 'select-option');
- }
- } else {
- _this.ariaOnChange(index.singleValueAsValue(newValue), {
- action: 'select-option',
- option: newValue,
- name: name
- });
- return;
- }
- if (blurInputOnSelect) {
- _this.blurInput();
- }
- };
- _this.removeValue = function (removedValue) {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var candidate = _this.getOptionValue(removedValue);
- var newValueArray = selectValue.filter(function (i) {
- return _this.getOptionValue(i) !== candidate;
- });
- var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'remove-value',
- removedValue: removedValue
- });
- _this.focusInput();
- };
- _this.clearValue = function () {
- var selectValue = _this.state.selectValue;
- _this.onChange(index.valueTernary(_this.props.isMulti, [], null), {
- action: 'clear',
- removedValues: selectValue
- });
- };
- _this.popValue = function () {
- var isMulti = _this.props.isMulti;
- var selectValue = _this.state.selectValue;
- var lastSelectedValue = selectValue[selectValue.length - 1];
- var newValueArray = selectValue.slice(0, selectValue.length - 1);
- var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
- _this.onChange(newValue, {
- action: 'pop-value',
- removedValue: lastSelectedValue
- });
- };
- _this.getValue = function () {
- return _this.state.selectValue;
- };
- _this.cx = function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return index.classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
- };
- _this.getOptionLabel = function (data) {
- return getOptionLabel(_this.props, data);
- };
- _this.getOptionValue = function (data) {
- return getOptionValue(_this.props, data);
- };
- _this.getStyles = function (key, props) {
- var unstyled = _this.props.unstyled;
- var base = defaultStyles[key](props, unstyled);
- base.boxSizing = 'border-box';
- var custom = _this.props.styles[key];
- return custom ? custom(base, props) : base;
- };
- _this.getClassNames = function (key, props) {
- var _this$props$className, _this$props$className2;
- return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
- };
- _this.getElementId = function (element) {
- return "".concat(_this.instancePrefix, "-").concat(element);
- };
- _this.getComponents = function () {
- return index.defaultComponents(_this.props);
- };
- _this.buildCategorizedOptions = function () {
- return buildCategorizedOptions(_this.props, _this.state.selectValue);
- };
- _this.getCategorizedOptions = function () {
- return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
- };
- _this.buildFocusableOptions = function () {
- return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
- };
- _this.getFocusableOptions = function () {
- return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
- };
- _this.ariaOnChange = function (value, actionMeta) {
- _this.setState({
- ariaSelection: _objectSpread({
- value: value
- }, actionMeta)
- });
- };
- _this.onMenuMouseDown = function (event) {
- if (event.button !== 0) {
- return;
- }
- event.stopPropagation();
- event.preventDefault();
- _this.focusInput();
- };
- _this.onMenuMouseMove = function (event) {
- _this.blockOptionHover = false;
- };
- _this.onControlMouseDown = function (event) {
- // Event captured by dropdown indicator
- if (event.defaultPrevented) {
- return;
- }
- var openMenuOnClick = _this.props.openMenuOnClick;
- if (!_this.state.isFocused) {
- if (openMenuOnClick) {
- _this.openAfterFocus = true;
- }
- _this.focusInput();
- } else if (!_this.props.menuIsOpen) {
- if (openMenuOnClick) {
- _this.openMenu('first');
- }
- } else {
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- _this.onMenuClose();
- }
- }
- if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
- event.preventDefault();
- }
- };
- _this.onDropdownIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- if (_this.props.isDisabled) return;
- var _this$props4 = _this.props,
- isMulti = _this$props4.isMulti,
- menuIsOpen = _this$props4.menuIsOpen;
- _this.focusInput();
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: !isMulti
- });
- _this.onMenuClose();
- } else {
- _this.openMenu('first');
- }
- event.preventDefault();
- };
- _this.onClearIndicatorMouseDown = function (event) {
- // ignore mouse events that weren't triggered by the primary button
- if (event && event.type === 'mousedown' && event.button !== 0) {
- return;
- }
- _this.clearValue();
- event.preventDefault();
- _this.openAfterFocus = false;
- if (event.type === 'touchend') {
- _this.focusInput();
- } else {
- setTimeout(function () {
- return _this.focusInput();
- });
- }
- };
- _this.onScroll = function (event) {
- if (typeof _this.props.closeMenuOnScroll === 'boolean') {
- if (event.target instanceof HTMLElement && index.isDocumentElement(event.target)) {
- _this.props.onMenuClose();
- }
- } else if (typeof _this.props.closeMenuOnScroll === 'function') {
- if (_this.props.closeMenuOnScroll(event)) {
- _this.props.onMenuClose();
- }
- }
- };
- _this.onCompositionStart = function () {
- _this.isComposing = true;
- };
- _this.onCompositionEnd = function () {
- _this.isComposing = false;
- };
- _this.onTouchStart = function (_ref2) {
- var touches = _ref2.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- _this.initialTouchX = touch.clientX;
- _this.initialTouchY = touch.clientY;
- _this.userIsDragging = false;
- };
- _this.onTouchMove = function (_ref3) {
- var touches = _ref3.touches;
- var touch = touches && touches.item(0);
- if (!touch) {
- return;
- }
- var deltaX = Math.abs(touch.clientX - _this.initialTouchX);
- var deltaY = Math.abs(touch.clientY - _this.initialTouchY);
- var moveThreshold = 5;
- _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
- };
- _this.onTouchEnd = function (event) {
- if (_this.userIsDragging) return;
-
- // close the menu if the user taps outside
- // we're checking on event.target here instead of event.currentTarget, because we want to assert information
- // on events on child elements, not the document (which we've attached this handler to).
- if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {
- _this.blurInput();
- }
-
- // reset move vars
- _this.initialTouchX = 0;
- _this.initialTouchY = 0;
- };
- _this.onControlTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onControlMouseDown(event);
- };
- _this.onClearIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onClearIndicatorMouseDown(event);
- };
- _this.onDropdownIndicatorTouchEnd = function (event) {
- if (_this.userIsDragging) return;
- _this.onDropdownIndicatorMouseDown(event);
- };
- _this.handleInputChange = function (event) {
- var prevInputValue = _this.props.inputValue;
- var inputValue = event.currentTarget.value;
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange(inputValue, {
- action: 'input-change',
- prevInputValue: prevInputValue
- });
- if (!_this.props.menuIsOpen) {
- _this.onMenuOpen();
- }
- };
- _this.onInputFocus = function (event) {
- if (_this.props.onFocus) {
- _this.props.onFocus(event);
- }
- _this.setState({
- inputIsHiddenAfterUpdate: false,
- isFocused: true
- });
- if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
- _this.openMenu('first');
- }
- _this.openAfterFocus = false;
- };
- _this.onInputBlur = function (event) {
- var prevInputValue = _this.props.inputValue;
- if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
- _this.inputRef.focus();
- return;
- }
- if (_this.props.onBlur) {
- _this.props.onBlur(event);
- }
- _this.onInputChange('', {
- action: 'input-blur',
- prevInputValue: prevInputValue
- });
- _this.onMenuClose();
- _this.setState({
- focusedValue: null,
- isFocused: false
- });
- };
- _this.onOptionHover = function (focusedOption) {
- if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
- return;
- }
- _this.setState({
- focusedOption: focusedOption
- });
- };
- _this.shouldHideSelectedOptions = function () {
- return shouldHideSelectedOptions(_this.props);
- };
- _this.onValueInputFocus = function (e) {
- e.preventDefault();
- e.stopPropagation();
- _this.focus();
- };
- _this.onKeyDown = function (event) {
- var _this$props5 = _this.props,
- isMulti = _this$props5.isMulti,
- backspaceRemovesValue = _this$props5.backspaceRemovesValue,
- escapeClearsValue = _this$props5.escapeClearsValue,
- inputValue = _this$props5.inputValue,
- isClearable = _this$props5.isClearable,
- isDisabled = _this$props5.isDisabled,
- menuIsOpen = _this$props5.menuIsOpen,
- onKeyDown = _this$props5.onKeyDown,
- tabSelectsValue = _this$props5.tabSelectsValue,
- openMenuOnFocus = _this$props5.openMenuOnFocus;
- var _this$state = _this.state,
- focusedOption = _this$state.focusedOption,
- focusedValue = _this$state.focusedValue,
- selectValue = _this$state.selectValue;
- if (isDisabled) return;
- if (typeof onKeyDown === 'function') {
- onKeyDown(event);
- if (event.defaultPrevented) {
- return;
- }
- }
-
- // Block option hover events when the user has just pressed a key
- _this.blockOptionHover = true;
- switch (event.key) {
- case 'ArrowLeft':
- if (!isMulti || inputValue) return;
- _this.focusValue('previous');
- break;
- case 'ArrowRight':
- if (!isMulti || inputValue) return;
- _this.focusValue('next');
- break;
- case 'Delete':
- case 'Backspace':
- if (inputValue) return;
- if (focusedValue) {
- _this.removeValue(focusedValue);
- } else {
- if (!backspaceRemovesValue) return;
- if (isMulti) {
- _this.popValue();
- } else if (isClearable) {
- _this.clearValue();
- }
- }
- break;
- case 'Tab':
- if (_this.isComposing) return;
- if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption ||
- // don't capture the event if the menu opens on focus and the focused
- // option is already selected; it breaks the flow of navigation
- openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
- return;
- }
- _this.selectOption(focusedOption);
- break;
- case 'Enter':
- if (event.keyCode === 229) {
- // ignore the keydown event from an Input Method Editor(IME)
- // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
- break;
- }
- if (menuIsOpen) {
- if (!focusedOption) return;
- if (_this.isComposing) return;
- _this.selectOption(focusedOption);
- break;
- }
- return;
- case 'Escape':
- if (menuIsOpen) {
- _this.setState({
- inputIsHiddenAfterUpdate: false
- });
- _this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: inputValue
- });
- _this.onMenuClose();
- } else if (isClearable && escapeClearsValue) {
- _this.clearValue();
- }
- break;
- case ' ':
- // space
- if (inputValue) {
- return;
- }
- if (!menuIsOpen) {
- _this.openMenu('first');
- break;
- }
- if (!focusedOption) return;
- _this.selectOption(focusedOption);
- break;
- case 'ArrowUp':
- if (menuIsOpen) {
- _this.focusOption('up');
- } else {
- _this.openMenu('last');
- }
- break;
- case 'ArrowDown':
- if (menuIsOpen) {
- _this.focusOption('down');
- } else {
- _this.openMenu('first');
- }
- break;
- case 'PageUp':
- if (!menuIsOpen) return;
- _this.focusOption('pageup');
- break;
- case 'PageDown':
- if (!menuIsOpen) return;
- _this.focusOption('pagedown');
- break;
- case 'Home':
- if (!menuIsOpen) return;
- _this.focusOption('first');
- break;
- case 'End':
- if (!menuIsOpen) return;
- _this.focusOption('last');
- break;
- default:
- return;
- }
- event.preventDefault();
- };
- _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
- _this.state.selectValue = index.cleanValue(_props.value);
-
- // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
- if (_props.menuIsOpen && _this.state.selectValue.length) {
- var focusableOptions = _this.buildFocusableOptions();
- var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
- _this.state.focusedOption = focusableOptions[optionIndex];
- }
- return _this;
- }
- _createClass(Select, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- this.startListeningComposition();
- this.startListeningToTouch();
- if (this.props.closeMenuOnScroll && document && document.addEventListener) {
- // Listen to all scroll events, and filter them out inside of 'onScroll'
- document.addEventListener('scroll', this.onScroll, true);
- }
- if (this.props.autoFocus) {
- this.focusInput();
- }
-
- // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen)
- if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
- index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
- }
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate(prevProps) {
- var _this$props6 = this.props,
- isDisabled = _this$props6.isDisabled,
- menuIsOpen = _this$props6.menuIsOpen;
- var isFocused = this.state.isFocused;
- if (
- // ensure focus is restored correctly when the control becomes enabled
- isFocused && !isDisabled && prevProps.isDisabled ||
- // ensure focus is on the Input when the menu opens
- isFocused && menuIsOpen && !prevProps.menuIsOpen) {
- this.focusInput();
- }
- if (isFocused && isDisabled && !prevProps.isDisabled) {
- // ensure select state gets blurred in case Select is programmatically disabled while focused
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: false
- }, this.onMenuClose);
- } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
- // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
- // eslint-disable-next-line react/no-did-update-set-state
- this.setState({
- isFocused: true
- });
- }
-
- // scroll the focused option into view if necessary
- if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
- index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
- this.scrollToFocusedOptionOnUpdate = false;
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this.stopListeningComposition();
- this.stopListeningToTouch();
- document.removeEventListener('scroll', this.onScroll, true);
- }
-
- // ==============================
- // Consumer Handlers
- // ==============================
- }, {
- key: "onMenuOpen",
- value: function onMenuOpen() {
- this.props.onMenuOpen();
- }
- }, {
- key: "onMenuClose",
- value: function onMenuClose() {
- this.onInputChange('', {
- action: 'menu-close',
- prevInputValue: this.props.inputValue
- });
- this.props.onMenuClose();
- }
- }, {
- key: "onInputChange",
- value: function onInputChange(newValue, actionMeta) {
- this.props.onInputChange(newValue, actionMeta);
- }
-
- // ==============================
- // Methods
- // ==============================
- }, {
- key: "focusInput",
- value: function focusInput() {
- if (!this.inputRef) return;
- this.inputRef.focus();
- }
- }, {
- key: "blurInput",
- value: function blurInput() {
- if (!this.inputRef) return;
- this.inputRef.blur();
- }
-
- // aliased for consumers
- }, {
- key: "openMenu",
- value: function openMenu(focusOption) {
- var _this2 = this;
- var _this$state2 = this.state,
- selectValue = _this$state2.selectValue,
- isFocused = _this$state2.isFocused;
- var focusableOptions = this.buildFocusableOptions();
- var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1;
- if (!this.props.isMulti) {
- var selectedIndex = focusableOptions.indexOf(selectValue[0]);
- if (selectedIndex > -1) {
- openAtIndex = selectedIndex;
- }
- }
-
- // only scroll if the menu isn't already open
- this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
- this.setState({
- inputIsHiddenAfterUpdate: false,
- focusedValue: null,
- focusedOption: focusableOptions[openAtIndex]
- }, function () {
- return _this2.onMenuOpen();
- });
- }
- }, {
- key: "focusValue",
- value: function focusValue(direction) {
- var _this$state3 = this.state,
- selectValue = _this$state3.selectValue,
- focusedValue = _this$state3.focusedValue;
-
- // Only multiselects support value focusing
- if (!this.props.isMulti) return;
- this.setState({
- focusedOption: null
- });
- var focusedIndex = selectValue.indexOf(focusedValue);
- if (!focusedValue) {
- focusedIndex = -1;
- }
- var lastIndex = selectValue.length - 1;
- var nextFocus = -1;
- if (!selectValue.length) return;
- switch (direction) {
- case 'previous':
- if (focusedIndex === 0) {
- // don't cycle from the start to the end
- nextFocus = 0;
- } else if (focusedIndex === -1) {
- // if nothing is focused, focus the last value first
- nextFocus = lastIndex;
- } else {
- nextFocus = focusedIndex - 1;
- }
- break;
- case 'next':
- if (focusedIndex > -1 && focusedIndex < lastIndex) {
- nextFocus = focusedIndex + 1;
- }
- break;
- }
- this.setState({
- inputIsHidden: nextFocus !== -1,
- focusedValue: selectValue[nextFocus]
- });
- }
- }, {
- key: "focusOption",
- value: function focusOption() {
- var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';
- var pageSize = this.props.pageSize;
- var focusedOption = this.state.focusedOption;
- var options = this.getFocusableOptions();
- if (!options.length) return;
- var nextFocus = 0; // handles 'first'
- var focusedIndex = options.indexOf(focusedOption);
- if (!focusedOption) {
- focusedIndex = -1;
- }
- if (direction === 'up') {
- nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
- } else if (direction === 'down') {
- nextFocus = (focusedIndex + 1) % options.length;
- } else if (direction === 'pageup') {
- nextFocus = focusedIndex - pageSize;
- if (nextFocus < 0) nextFocus = 0;
- } else if (direction === 'pagedown') {
- nextFocus = focusedIndex + pageSize;
- if (nextFocus > options.length - 1) nextFocus = options.length - 1;
- } else if (direction === 'last') {
- nextFocus = options.length - 1;
- }
- this.scrollToFocusedOptionOnUpdate = true;
- this.setState({
- focusedOption: options[nextFocus],
- focusedValue: null
- });
- }
- }, {
- key: "getTheme",
- value:
- // ==============================
- // Getters
- // ==============================
-
- function getTheme() {
- // Use the default theme if there are no customisations.
- if (!this.props.theme) {
- return defaultTheme;
- }
- // If the theme prop is a function, assume the function
- // knows how to merge the passed-in default theme with
- // its own modifications.
- if (typeof this.props.theme === 'function') {
- return this.props.theme(defaultTheme);
- }
- // Otherwise, if a plain theme object was passed in,
- // overlay it with the default theme.
- return _objectSpread(_objectSpread({}, defaultTheme), this.props.theme);
- }
- }, {
- key: "getCommonProps",
- value: function getCommonProps() {
- var clearValue = this.clearValue,
- cx = this.cx,
- getStyles = this.getStyles,
- getClassNames = this.getClassNames,
- getValue = this.getValue,
- selectOption = this.selectOption,
- setValue = this.setValue,
- props = this.props;
- var isMulti = props.isMulti,
- isRtl = props.isRtl,
- options = props.options;
- var hasValue = this.hasValue();
- return {
- clearValue: clearValue,
- cx: cx,
- getStyles: getStyles,
- getClassNames: getClassNames,
- getValue: getValue,
- hasValue: hasValue,
- isMulti: isMulti,
- isRtl: isRtl,
- options: options,
- selectOption: selectOption,
- selectProps: props,
- setValue: setValue,
- theme: this.getTheme()
- };
- }
- }, {
- key: "hasValue",
- value: function hasValue() {
- var selectValue = this.state.selectValue;
- return selectValue.length > 0;
- }
- }, {
- key: "hasOptions",
- value: function hasOptions() {
- return !!this.getFocusableOptions().length;
- }
- }, {
- key: "isClearable",
- value: function isClearable() {
- var _this$props7 = this.props,
- isClearable = _this$props7.isClearable,
- isMulti = _this$props7.isMulti;
-
- // single select, by default, IS NOT clearable
- // multi select, by default, IS clearable
- if (isClearable === undefined) return isMulti;
- return isClearable;
- }
- }, {
- key: "isOptionDisabled",
- value: function isOptionDisabled(option, selectValue) {
- return _isOptionDisabled(this.props, option, selectValue);
- }
- }, {
- key: "isOptionSelected",
- value: function isOptionSelected(option, selectValue) {
- return _isOptionSelected(this.props, option, selectValue);
- }
- }, {
- key: "filterOption",
- value: function filterOption(option, inputValue) {
- return _filterOption(this.props, option, inputValue);
- }
- }, {
- key: "formatOptionLabel",
- value: function formatOptionLabel(data, context) {
- if (typeof this.props.formatOptionLabel === 'function') {
- var _inputValue = this.props.inputValue;
- var _selectValue = this.state.selectValue;
- return this.props.formatOptionLabel(data, {
- context: context,
- inputValue: _inputValue,
- selectValue: _selectValue
- });
- } else {
- return this.getOptionLabel(data);
- }
- }
- }, {
- key: "formatGroupLabel",
- value: function formatGroupLabel(data) {
- return this.props.formatGroupLabel(data);
- }
-
- // ==============================
- // Mouse Handlers
- // ==============================
- }, {
- key: "startListeningComposition",
- value:
- // ==============================
- // Composition Handlers
- // ==============================
-
- function startListeningComposition() {
- if (document && document.addEventListener) {
- document.addEventListener('compositionstart', this.onCompositionStart, false);
- document.addEventListener('compositionend', this.onCompositionEnd, false);
- }
- }
- }, {
- key: "stopListeningComposition",
- value: function stopListeningComposition() {
- if (document && document.removeEventListener) {
- document.removeEventListener('compositionstart', this.onCompositionStart);
- document.removeEventListener('compositionend', this.onCompositionEnd);
- }
- }
- }, {
- key: "startListeningToTouch",
- value:
- // ==============================
- // Touch Handlers
- // ==============================
-
- function startListeningToTouch() {
- if (document && document.addEventListener) {
- document.addEventListener('touchstart', this.onTouchStart, false);
- document.addEventListener('touchmove', this.onTouchMove, false);
- document.addEventListener('touchend', this.onTouchEnd, false);
- }
- }
- }, {
- key: "stopListeningToTouch",
- value: function stopListeningToTouch() {
- if (document && document.removeEventListener) {
- document.removeEventListener('touchstart', this.onTouchStart);
- document.removeEventListener('touchmove', this.onTouchMove);
- document.removeEventListener('touchend', this.onTouchEnd);
- }
- }
- }, {
- key: "renderInput",
- value:
- // ==============================
- // Renderers
- // ==============================
- function renderInput() {
- var _this$props8 = this.props,
- isDisabled = _this$props8.isDisabled,
- isSearchable = _this$props8.isSearchable,
- inputId = _this$props8.inputId,
- inputValue = _this$props8.inputValue,
- tabIndex = _this$props8.tabIndex,
- form = _this$props8.form,
- menuIsOpen = _this$props8.menuIsOpen,
- required = _this$props8.required;
- var _this$getComponents = this.getComponents(),
- Input = _this$getComponents.Input;
- var _this$state4 = this.state,
- inputIsHidden = _this$state4.inputIsHidden,
- ariaSelection = _this$state4.ariaSelection;
- var commonProps = this.commonProps;
- var id = inputId || this.getElementId('input');
-
- // aria attributes makes the JSX "noisy", separated for clarity
- var ariaAttributes = _objectSpread(_objectSpread(_objectSpread({
- 'aria-autocomplete': 'list',
- 'aria-expanded': menuIsOpen,
- 'aria-haspopup': true,
- 'aria-errormessage': this.props['aria-errormessage'],
- 'aria-invalid': this.props['aria-invalid'],
- 'aria-label': this.props['aria-label'],
- 'aria-labelledby': this.props['aria-labelledby'],
- 'aria-required': required,
- role: 'combobox'
- }, menuIsOpen && {
- 'aria-controls': this.getElementId('listbox'),
- 'aria-owns': this.getElementId('listbox')
- }), !isSearchable && {
- 'aria-readonly': true
- }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
- 'aria-describedby': this.getElementId('live-region')
- } : {
- 'aria-describedby': this.getElementId('placeholder')
- });
- if (!isSearchable) {
- // use a dummy input to maintain focus/blur functionality
- return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends({
- id: id,
- innerRef: this.getInputRef,
- onBlur: this.onInputBlur,
- onChange: index.noop,
- onFocus: this.onInputFocus,
- disabled: isDisabled,
- tabIndex: tabIndex,
- inputMode: "none",
- form: form,
- value: ""
- }, ariaAttributes));
- }
- return /*#__PURE__*/React__namespace.createElement(Input, _extends({}, commonProps, {
- autoCapitalize: "none",
- autoComplete: "off",
- autoCorrect: "off",
- id: id,
- innerRef: this.getInputRef,
- isDisabled: isDisabled,
- isHidden: inputIsHidden,
- onBlur: this.onInputBlur,
- onChange: this.handleInputChange,
- onFocus: this.onInputFocus,
- spellCheck: "false",
- tabIndex: tabIndex,
- form: form,
- type: "text",
- value: inputValue
- }, ariaAttributes));
- }
- }, {
- key: "renderPlaceholderOrValue",
- value: function renderPlaceholderOrValue() {
- var _this3 = this;
- var _this$getComponents2 = this.getComponents(),
- MultiValue = _this$getComponents2.MultiValue,
- MultiValueContainer = _this$getComponents2.MultiValueContainer,
- MultiValueLabel = _this$getComponents2.MultiValueLabel,
- MultiValueRemove = _this$getComponents2.MultiValueRemove,
- SingleValue = _this$getComponents2.SingleValue,
- Placeholder = _this$getComponents2.Placeholder;
- var commonProps = this.commonProps;
- var _this$props9 = this.props,
- controlShouldRenderValue = _this$props9.controlShouldRenderValue,
- isDisabled = _this$props9.isDisabled,
- isMulti = _this$props9.isMulti,
- inputValue = _this$props9.inputValue,
- placeholder = _this$props9.placeholder;
- var _this$state5 = this.state,
- selectValue = _this$state5.selectValue,
- focusedValue = _this$state5.focusedValue,
- isFocused = _this$state5.isFocused;
- if (!this.hasValue() || !controlShouldRenderValue) {
- return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends({}, commonProps, {
- key: "placeholder",
- isDisabled: isDisabled,
- isFocused: isFocused,
- innerProps: {
- id: this.getElementId('placeholder')
- }
- }), placeholder);
- }
- if (isMulti) {
- return selectValue.map(function (opt, index) {
- var isOptionFocused = opt === focusedValue;
- var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
- return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends({}, commonProps, {
- components: {
- Container: MultiValueContainer,
- Label: MultiValueLabel,
- Remove: MultiValueRemove
- },
- isFocused: isOptionFocused,
- isDisabled: isDisabled,
- key: key,
- index: index,
- removeProps: {
- onClick: function onClick() {
- return _this3.removeValue(opt);
- },
- onTouchEnd: function onTouchEnd() {
- return _this3.removeValue(opt);
- },
- onMouseDown: function onMouseDown(e) {
- e.preventDefault();
- }
- },
- data: opt
- }), _this3.formatOptionLabel(opt, 'value'));
- });
- }
- if (inputValue) {
- return null;
- }
- var singleValue = selectValue[0];
- return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends({}, commonProps, {
- data: singleValue,
- isDisabled: isDisabled
- }), this.formatOptionLabel(singleValue, 'value'));
- }
- }, {
- key: "renderClearIndicator",
- value: function renderClearIndicator() {
- var _this$getComponents3 = this.getComponents(),
- ClearIndicator = _this$getComponents3.ClearIndicator;
- var commonProps = this.commonProps;
- var _this$props10 = this.props,
- isDisabled = _this$props10.isDisabled,
- isLoading = _this$props10.isLoading;
- var isFocused = this.state.isFocused;
- if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
- return null;
- }
- var innerProps = {
- onMouseDown: this.onClearIndicatorMouseDown,
- onTouchEnd: this.onClearIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderLoadingIndicator",
- value: function renderLoadingIndicator() {
- var _this$getComponents4 = this.getComponents(),
- LoadingIndicator = _this$getComponents4.LoadingIndicator;
- var commonProps = this.commonProps;
- var _this$props11 = this.props,
- isDisabled = _this$props11.isDisabled,
- isLoading = _this$props11.isLoading;
- var isFocused = this.state.isFocused;
- if (!LoadingIndicator || !isLoading) return null;
- var innerProps = {
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderIndicatorSeparator",
- value: function renderIndicatorSeparator() {
- var _this$getComponents5 = this.getComponents(),
- DropdownIndicator = _this$getComponents5.DropdownIndicator,
- IndicatorSeparator = _this$getComponents5.IndicatorSeparator;
-
- // separator doesn't make sense without the dropdown indicator
- if (!DropdownIndicator || !IndicatorSeparator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends({}, commonProps, {
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderDropdownIndicator",
- value: function renderDropdownIndicator() {
- var _this$getComponents6 = this.getComponents(),
- DropdownIndicator = _this$getComponents6.DropdownIndicator;
- if (!DropdownIndicator) return null;
- var commonProps = this.commonProps;
- var isDisabled = this.props.isDisabled;
- var isFocused = this.state.isFocused;
- var innerProps = {
- onMouseDown: this.onDropdownIndicatorMouseDown,
- onTouchEnd: this.onDropdownIndicatorTouchEnd,
- 'aria-hidden': 'true'
- };
- return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends({}, commonProps, {
- innerProps: innerProps,
- isDisabled: isDisabled,
- isFocused: isFocused
- }));
- }
- }, {
- key: "renderMenu",
- value: function renderMenu() {
- var _this4 = this;
- var _this$getComponents7 = this.getComponents(),
- Group = _this$getComponents7.Group,
- GroupHeading = _this$getComponents7.GroupHeading,
- Menu = _this$getComponents7.Menu,
- MenuList = _this$getComponents7.MenuList,
- MenuPortal = _this$getComponents7.MenuPortal,
- LoadingMessage = _this$getComponents7.LoadingMessage,
- NoOptionsMessage = _this$getComponents7.NoOptionsMessage,
- Option = _this$getComponents7.Option;
- var commonProps = this.commonProps;
- var focusedOption = this.state.focusedOption;
- var _this$props12 = this.props,
- captureMenuScroll = _this$props12.captureMenuScroll,
- inputValue = _this$props12.inputValue,
- isLoading = _this$props12.isLoading,
- loadingMessage = _this$props12.loadingMessage,
- minMenuHeight = _this$props12.minMenuHeight,
- maxMenuHeight = _this$props12.maxMenuHeight,
- menuIsOpen = _this$props12.menuIsOpen,
- menuPlacement = _this$props12.menuPlacement,
- menuPosition = _this$props12.menuPosition,
- menuPortalTarget = _this$props12.menuPortalTarget,
- menuShouldBlockScroll = _this$props12.menuShouldBlockScroll,
- menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView,
- noOptionsMessage = _this$props12.noOptionsMessage,
- onMenuScrollToTop = _this$props12.onMenuScrollToTop,
- onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
- if (!menuIsOpen) return null;
-
- // TODO: Internal Option Type here
- var render = function render(props, id) {
- var type = props.type,
- data = props.data,
- isDisabled = props.isDisabled,
- isSelected = props.isSelected,
- label = props.label,
- value = props.value;
- var isFocused = focusedOption === data;
- var onHover = isDisabled ? undefined : function () {
- return _this4.onOptionHover(data);
- };
- var onSelect = isDisabled ? undefined : function () {
- return _this4.selectOption(data);
- };
- var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
- var innerProps = {
- id: optionId,
- onClick: onSelect,
- onMouseMove: onHover,
- onMouseOver: onHover,
- tabIndex: -1
- };
- return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
- innerProps: innerProps,
- data: data,
- isDisabled: isDisabled,
- isSelected: isSelected,
- key: optionId,
- label: label,
- type: type,
- value: value,
- isFocused: isFocused,
- innerRef: isFocused ? _this4.getFocusedOptionRef : undefined
- }), _this4.formatOptionLabel(props.data, 'menu'));
- };
- var menuUI;
- if (this.hasOptions()) {
- menuUI = this.getCategorizedOptions().map(function (item) {
- if (item.type === 'group') {
- var _data = item.data,
- options = item.options,
- groupIndex = item.index;
- var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
- var headingId = "".concat(groupId, "-heading");
- return /*#__PURE__*/React__namespace.createElement(Group, _extends({}, commonProps, {
- key: groupId,
- data: _data,
- options: options,
- Heading: GroupHeading,
- headingProps: {
- id: headingId,
- data: item.data
- },
- label: _this4.formatGroupLabel(item.data)
- }), item.options.map(function (option) {
- return render(option, "".concat(groupIndex, "-").concat(option.index));
- }));
- } else if (item.type === 'option') {
- return render(item, "".concat(item.index));
- }
- });
- } else if (isLoading) {
- var message = loadingMessage({
- inputValue: inputValue
- });
- if (message === null) return null;
- menuUI = /*#__PURE__*/React__namespace.createElement(LoadingMessage, commonProps, message);
- } else {
- var _message = noOptionsMessage({
- inputValue: inputValue
- });
- if (_message === null) return null;
- menuUI = /*#__PURE__*/React__namespace.createElement(NoOptionsMessage, commonProps, _message);
- }
- var menuPlacementProps = {
- minMenuHeight: minMenuHeight,
- maxMenuHeight: maxMenuHeight,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition,
- menuShouldScrollIntoView: menuShouldScrollIntoView
- };
- var menuElement = /*#__PURE__*/React__namespace.createElement(index.MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref4) {
- var ref = _ref4.ref,
- _ref4$placerProps = _ref4.placerProps,
- placement = _ref4$placerProps.placement,
- maxHeight = _ref4$placerProps.maxHeight;
- return /*#__PURE__*/React__namespace.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {
- innerRef: ref,
- innerProps: {
- onMouseDown: _this4.onMenuMouseDown,
- onMouseMove: _this4.onMenuMouseMove,
- id: _this4.getElementId('listbox')
- },
- isLoading: isLoading,
- placement: placement
- }), /*#__PURE__*/React__namespace.createElement(ScrollManager, {
- captureEnabled: captureMenuScroll,
- onTopArrive: onMenuScrollToTop,
- onBottomArrive: onMenuScrollToBottom,
- lockEnabled: menuShouldBlockScroll
- }, function (scrollTargetRef) {
- return /*#__PURE__*/React__namespace.createElement(MenuList, _extends({}, commonProps, {
- innerRef: function innerRef(instance) {
- _this4.getMenuListRef(instance);
- scrollTargetRef(instance);
- },
- isLoading: isLoading,
- maxHeight: maxHeight,
- focusedOption: focusedOption
- }), menuUI);
- }));
- });
-
- // positioning behaviour is almost identical for portalled and fixed,
- // so we use the same component. the actual portalling logic is forked
- // within the component based on `menuPosition`
- return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends({}, commonProps, {
- appendTo: menuPortalTarget,
- controlElement: this.controlRef,
- menuPlacement: menuPlacement,
- menuPosition: menuPosition
- }), menuElement) : menuElement;
- }
- }, {
- key: "renderFormField",
- value: function renderFormField() {
- var _this5 = this;
- var _this$props13 = this.props,
- delimiter = _this$props13.delimiter,
- isDisabled = _this$props13.isDisabled,
- isMulti = _this$props13.isMulti,
- name = _this$props13.name,
- required = _this$props13.required;
- var selectValue = this.state.selectValue;
- if (!name || isDisabled) return;
- if (required && !this.hasValue()) {
- return /*#__PURE__*/React__namespace.createElement(RequiredInput, {
- name: name,
- onFocus: this.onValueInputFocus
- });
- }
- if (isMulti) {
- if (delimiter) {
- var value = selectValue.map(function (opt) {
- return _this5.getOptionValue(opt);
- }).join(delimiter);
- return /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: value
- });
- } else {
- var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {
- return /*#__PURE__*/React__namespace.createElement("input", {
- key: "i-".concat(i),
- name: name,
- type: "hidden",
- value: _this5.getOptionValue(opt)
- });
- }) : /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: ""
- });
- return /*#__PURE__*/React__namespace.createElement("div", null, input);
- }
- } else {
- var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';
- return /*#__PURE__*/React__namespace.createElement("input", {
- name: name,
- type: "hidden",
- value: _value
- });
- }
- }
- }, {
- key: "renderLiveRegion",
- value: function renderLiveRegion() {
- var commonProps = this.commonProps;
- var _this$state6 = this.state,
- ariaSelection = _this$state6.ariaSelection,
- focusedOption = _this$state6.focusedOption,
- focusedValue = _this$state6.focusedValue,
- isFocused = _this$state6.isFocused,
- selectValue = _this$state6.selectValue;
- var focusableOptions = this.getFocusableOptions();
- return /*#__PURE__*/React__namespace.createElement(LiveRegion, _extends({}, commonProps, {
- id: this.getElementId('live-region'),
- ariaSelection: ariaSelection,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- isFocused: isFocused,
- selectValue: selectValue,
- focusableOptions: focusableOptions
- }));
- }
- }, {
- key: "render",
- value: function render() {
- var _this$getComponents8 = this.getComponents(),
- Control = _this$getComponents8.Control,
- IndicatorsContainer = _this$getComponents8.IndicatorsContainer,
- SelectContainer = _this$getComponents8.SelectContainer,
- ValueContainer = _this$getComponents8.ValueContainer;
- var _this$props14 = this.props,
- className = _this$props14.className,
- id = _this$props14.id,
- isDisabled = _this$props14.isDisabled,
- menuIsOpen = _this$props14.menuIsOpen;
- var isFocused = this.state.isFocused;
- var commonProps = this.commonProps = this.getCommonProps();
- return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends({}, commonProps, {
- className: className,
- innerProps: {
- id: id,
- onKeyDown: this.onKeyDown
- },
- isDisabled: isDisabled,
- isFocused: isFocused
- }), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends({}, commonProps, {
- innerRef: this.getControlRef,
- innerProps: {
- onMouseDown: this.onControlMouseDown,
- onTouchEnd: this.onControlTouchEnd
- },
- isDisabled: isDisabled,
- isFocused: isFocused,
- menuIsOpen: menuIsOpen
- }), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends({}, commonProps, {
- isDisabled: isDisabled
- }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function getDerivedStateFromProps(props, state) {
- var prevProps = state.prevProps,
- clearFocusValueOnUpdate = state.clearFocusValueOnUpdate,
- inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
- ariaSelection = state.ariaSelection,
- isFocused = state.isFocused,
- prevWasFocused = state.prevWasFocused;
- var options = props.options,
- value = props.value,
- menuIsOpen = props.menuIsOpen,
- inputValue = props.inputValue,
- isMulti = props.isMulti;
- var selectValue = index.cleanValue(value);
- var newMenuOptionsState = {};
- if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
- var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
- var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
- var focusedOption = getNextFocusedOption(state, focusableOptions);
- newMenuOptionsState = {
- selectValue: selectValue,
- focusedOption: focusedOption,
- focusedValue: focusedValue,
- clearFocusValueOnUpdate: false
- };
- }
- // some updates should toggle the state of the input visibility
- var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
- inputIsHidden: inputIsHiddenAfterUpdate,
- inputIsHiddenAfterUpdate: undefined
- } : {};
- var newAriaSelection = ariaSelection;
- var hasKeptFocus = isFocused && prevWasFocused;
- if (isFocused && !hasKeptFocus) {
- // If `value` or `defaultValue` props are not empty then announce them
- // when the Select is initially focused
- newAriaSelection = {
- value: index.valueTernary(isMulti, selectValue, selectValue[0] || null),
- options: selectValue,
- action: 'initial-input-focus'
- };
- hasKeptFocus = !prevWasFocused;
- }
-
- // If the 'initial-input-focus' action has been set already
- // then reset the ariaSelection to null
- if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') {
- newAriaSelection = null;
- }
- return _objectSpread(_objectSpread(_objectSpread({}, newMenuOptionsState), newInputIsHiddenState), {}, {
- prevProps: props,
- ariaSelection: newAriaSelection,
- prevWasFocused: hasKeptFocus
- });
- }
- }]);
- return Select;
-}(React.Component);
-Select.defaultProps = defaultProps;
-
-exports.Select = Select;
-exports.createFilter = createFilter;
-exports.defaultProps = defaultProps;
-exports.defaultTheme = defaultTheme;
-exports.getOptionLabel = getOptionLabel$1;
-exports.getOptionValue = getOptionValue$1;
-exports.mergeStyles = mergeStyles;
diff --git a/frontend/node_modules/react-select/dist/declarations/src/Async.d.ts b/frontend/node_modules/react-select/dist/declarations/src/Async.d.ts
deleted file mode 100644
index 68766ca78..000000000
--- a/frontend/node_modules/react-select/dist/declarations/src/Async.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { ReactElement, RefAttributes } from 'react';
-import Select from './Select';
-import { GroupBase } from './types';
-import useAsync from './useAsync';
-import type { AsyncProps } from './useAsync';
-export type { AsyncProps };
-declare type AsyncSelect =