@luminati-io/uikit 3.2.6 → 3.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -36846,7 +36846,7 @@ __webpack_require__.r(__webpack_exports__);
36846
36846
  /* harmony export */ buildComponents: () => (/* binding */ buildComponents)
36847
36847
  /* harmony export */ });
36848
36848
  /* harmony import */ var _option__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./option */ "./src/input/checkbox_list/option.js");
36849
- /* harmony import */ var _virtualized_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./virtualized_list */ "./src/input/checkbox_list/virtualized_list.js");
36849
+ /* harmony import */ var _util_virtualized_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/virtualized_list */ "./src/util/virtualized_list.js");
36850
36850
  // LICENSE_CODE ZON
36851
36851
 
36852
36852
 
@@ -36866,10 +36866,11 @@ var buildComponents = function buildComponents(props) {
36866
36866
  Option: _option__WEBPACK_IMPORTED_MODULE_0__.Option
36867
36867
  }, props.components);
36868
36868
  if (props.virtualized) {
36869
- components.MenuList = (0,_virtualized_list__WEBPACK_IMPORTED_MODULE_1__.VirtualizedListFactory)({
36869
+ components.MenuList = (0,_util_virtualized_list__WEBPACK_IMPORTED_MODULE_1__.VirtualizedListFactory)({
36870
36870
  optionHeight: props.optionHeight,
36871
36871
  defaultValue: props.defaultValue,
36872
- formatOptionLabel: props.formatOptionLabel
36872
+ formatOptionLabel: props.formatOptionLabel,
36873
+ Option: components.Option
36873
36874
  });
36874
36875
  }
36875
36876
  return components;
@@ -37288,237 +37289,6 @@ var useStyles = function useStyles(_ref) {
37288
37289
 
37289
37290
  /***/ }),
37290
37291
 
37291
- /***/ "./src/input/checkbox_list/virtualized_list.js":
37292
- /*!*****************************************************!*\
37293
- !*** ./src/input/checkbox_list/virtualized_list.js ***!
37294
- \*****************************************************/
37295
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
37296
-
37297
- "use strict";
37298
- __webpack_require__.r(__webpack_exports__);
37299
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37300
- /* harmony export */ VirtualizedListFactory: () => (/* binding */ VirtualizedListFactory)
37301
- /* harmony export */ });
37302
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
37303
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
37304
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
37305
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
37306
- /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-select */ "./node_modules/react-select/dist/index-a301f526.esm.js");
37307
- /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
37308
- /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_2__);
37309
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
37310
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
37311
- /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks */ "./src/hooks/index.js");
37312
- /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme */ "./src/theme.js");
37313
- /* harmony import */ var _util_getters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/getters */ "./src/util/getters.js");
37314
- /* harmony import */ var _option__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./option */ "./src/input/checkbox_list/option.js");
37315
- // LICENSE_CODE ZON
37316
-
37317
-
37318
- /*jslint react:true*/
37319
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37320
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
37321
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37322
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
37323
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
37324
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37325
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
37326
-
37327
-
37328
-
37329
-
37330
-
37331
-
37332
-
37333
-
37334
-
37335
- var VirtualizedListFactory = function VirtualizedListFactory(_ref) {
37336
- var _ref$optionHeight = _ref.optionHeight,
37337
- optionHeight = _ref$optionHeight === void 0 ? 40 : _ref$optionHeight,
37338
- defaultValue = _ref.defaultValue,
37339
- valueGetter = _ref.valueGetter,
37340
- formatOptionLabel = _ref.formatOptionLabel;
37341
- var Comp = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(function (props) {
37342
- var selectedValue = props.getValue() ? props.getValue()[0] : undefined;
37343
- if (props.children && !props.children.length) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_select__WEBPACK_IMPORTED_MODULE_8__.c.NoOptionsMessage, props.children.props);
37344
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ListVirtualized, _extends({}, props, {
37345
- optionHeight: optionHeight,
37346
- selectedValue: selectedValue,
37347
- defaultValue: defaultValue,
37348
- valueGetter: valueGetter,
37349
- formatOptionLabel: formatOptionLabel
37350
- }));
37351
- });
37352
- Comp.displayName = 'VirtualizedListComp';
37353
- return Comp;
37354
- };
37355
- var StyledList = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.List).withConfig({
37356
- displayName: "StyledList",
37357
- componentId: "sc-14zmt95-0"
37358
- })(["", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
37359
- var ListVirtualizedComponent = function ListVirtualizedComponent(props) {
37360
- var listComponent;
37361
- var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
37362
- _useState2 = _slicedToArray(_useState, 2),
37363
- focusedItemIndex = _useState2[0],
37364
- setFocusedItemIndex = _useState2[1];
37365
- var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
37366
- _useState4 = _slicedToArray(_useState3, 2),
37367
- queueScrollToIdx = _useState4[0],
37368
- setQueueScrollToIdx = _useState4[1];
37369
- var maxHeight = props.maxHeight,
37370
- children = props.children,
37371
- optionHeight = props.optionHeight,
37372
- options = props.options,
37373
- selectedValue = props.selectedValue,
37374
- defaultValue = props.defaultValue,
37375
- valueGetter = props.valueGetter,
37376
- formatOptionLabel = props.formatOptionLabel;
37377
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
37378
- // only scroll to index when we have something in the queue of focused
37379
- // and not visible
37380
- if (listComponent && queueScrollToIdx !== undefined && focusedItemIndex !== undefined) {
37381
- listComponent.current.scrollToRow((0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getNextRowIndex)(focusedItemIndex, queueScrollToIdx, options));
37382
- setQueueScrollToIdx(undefined);
37383
- }
37384
- }, [listComponent, queueScrollToIdx, focusedItemIndex, options]);
37385
- var onOptionFocused = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref2) {
37386
- var index = _ref2.index,
37387
- isVisible = _ref2.isVisible;
37388
- // enqueue the changes to the task queue so we do not interrupt rendering
37389
- setTimeout(function () {
37390
- if (index !== undefined && focusedItemIndex !== index && isVisible) setFocusedItemIndex(index);else if (index !== undefined && !isVisible && !queueScrollToIdx) setQueueScrollToIdx(index);
37391
- }, 100);
37392
- }, [setFocusedItemIndex, focusedItemIndex, setQueueScrollToIdx, queueScrollToIdx]);
37393
- var height = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
37394
- return (0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getListHeight)({
37395
- maxHeight: maxHeight,
37396
- totalSize: children.length,
37397
- optionHeight: optionHeight
37398
- });
37399
- }, [maxHeight, children.length, optionHeight]);
37400
- var scrollToIndex = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
37401
- return (0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getScrollIndex)({
37402
- children: options,
37403
- selected: selectedValue || defaultValue,
37404
- valueGetter: valueGetter
37405
- });
37406
- }, [options, selectedValue, defaultValue, valueGetter]);
37407
- var rowRenderer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
37408
- return VirtualizedListRowRenderer({
37409
- children: children,
37410
- onOptionFocused: onOptionFocused,
37411
- optionHeight: optionHeight,
37412
- formatOptionLabel: formatOptionLabel
37413
- });
37414
- }, [children, onOptionFocused, optionHeight, formatOptionLabel]);
37415
- var list = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
37416
- return [];
37417
- }, []);
37418
- var isRowLoaded = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref3) {
37419
- var index = _ref3.index;
37420
- return !!list[index];
37421
- }, [list]);
37422
- var loadMoreRows = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useDebouncedCallback)(function (_ref4) {
37423
- var startIndex = _ref4.startIndex,
37424
- stopIndex = _ref4.stopIndex;
37425
- for (var i = startIndex; i <= stopIndex; i++) list.push(children[i]);
37426
- }, 100);
37427
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.AutoSizer, {
37428
- disableHeight: true
37429
- }, function (_ref5) {
37430
- var width = _ref5.width;
37431
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.InfiniteLoader, {
37432
- isRowLoaded: isRowLoaded,
37433
- threshold: props.threshold,
37434
- loadMoreRows: loadMoreRows,
37435
- rowCount: props.children.length || 0,
37436
- minimumBatchSize: props.minimumBatchSize
37437
- }, function (_ref6) {
37438
- var onRowsRendered = _ref6.onRowsRendered,
37439
- registerChild = _ref6.registerChild;
37440
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledList, {
37441
- ref: function ref(element) {
37442
- registerChild(element);
37443
- listComponent = {
37444
- current: element
37445
- };
37446
- return element;
37447
- },
37448
- onRowsRendered: onRowsRendered,
37449
- height: height,
37450
- scrollToIndex: scrollToIndex,
37451
- rowCount: props.children.length,
37452
- rowHeight: props.optionHeight,
37453
- rowRenderer: rowRenderer,
37454
- width: width
37455
- });
37456
- });
37457
- });
37458
- };
37459
- var ListVirtualized = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(ListVirtualizedComponent);
37460
- ListVirtualized.propTypes = {
37461
- maxHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
37462
- // this prop is coming from react-select
37463
- children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
37464
- optionHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
37465
- selectedValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
37466
- defaultValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
37467
- valueGetter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
37468
- options: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
37469
- minimumBatchSize: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
37470
- };
37471
- ListVirtualized.defaultProps = {
37472
- valueGetter: function valueGetter(item) {
37473
- return item && item.value;
37474
- },
37475
- maxHeight: 200,
37476
- minimumBatchSize: 100
37477
- };
37478
- var VirtualizedListRowRenderer = function VirtualizedListRowRenderer(_ref7) {
37479
- var children = _ref7.children,
37480
- onOptionFocused = _ref7.onOptionFocused,
37481
- optionHeight = _ref7.optionHeight,
37482
- formatOptionLabel = _ref7.formatOptionLabel;
37483
- var Comp = function Comp(_ref8) {
37484
- var key = _ref8.key,
37485
- index = _ref8.index,
37486
- style = _ref8.style,
37487
- isVisible = _ref8.isVisible,
37488
- isScrolling = _ref8.isScrolling;
37489
- // reality is that we do not need to pass the list here.
37490
- // we can work straight with the children.
37491
- // since the actual behavior will be handled by the renderer
37492
- var thisProps = children[index].props;
37493
- var className = thisProps.cx({
37494
- 'virtualized-item': true
37495
- });
37496
- if (thisProps.isFocused && !isScrolling) onOptionFocused({
37497
- data: thisProps.data,
37498
- index: index,
37499
- isVisible: isVisible,
37500
- isScrolling: isScrolling
37501
- });
37502
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
37503
- className: className,
37504
- key: key,
37505
- style: style
37506
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_option__WEBPACK_IMPORTED_MODULE_7__.Option, _extends({}, thisProps, {
37507
- key: key,
37508
- style: style,
37509
- isVisible: isVisible,
37510
- isScrolling: isScrolling,
37511
- optionHeight: optionHeight,
37512
- formatOptionLabel: formatOptionLabel,
37513
- tag: "div"
37514
- })));
37515
- };
37516
- Comp.displayName = 'VirtualizedListRowRendererComp';
37517
- return Comp;
37518
- };
37519
-
37520
- /***/ }),
37521
-
37522
37292
  /***/ "./src/input/compare_to.js":
37523
37293
  /*!*********************************!*\
37524
37294
  !*** ./src/input/compare_to.js ***!
@@ -37976,7 +37746,7 @@ __webpack_require__.r(__webpack_exports__);
37976
37746
  /* harmony import */ var _menu_list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu_list */ "./src/input/dropdown/menu_list.js");
37977
37747
  /* harmony import */ var _option__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./option */ "./src/input/dropdown/option.js");
37978
37748
  /* harmony import */ var _value_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./value_container */ "./src/input/dropdown/value_container.js");
37979
- /* harmony import */ var _virtualized_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./virtualized_list */ "./src/input/dropdown/virtualized_list.js");
37749
+ /* harmony import */ var _util_virtualized_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/virtualized_list */ "./src/util/virtualized_list.js");
37980
37750
  // LICENSE_CODE ZON
37981
37751
 
37982
37752
 
@@ -38006,10 +37776,11 @@ var buildComponents = function buildComponents(props) {
38006
37776
  Option: _option__WEBPACK_IMPORTED_MODULE_4__.Option
38007
37777
  }, props.components);
38008
37778
  if (props.virtualized) {
38009
- components.MenuList = (0,_virtualized_list__WEBPACK_IMPORTED_MODULE_6__.VirtualizedListFactory)({
37779
+ components.MenuList = (0,_util_virtualized_list__WEBPACK_IMPORTED_MODULE_6__.VirtualizedListFactory)({
38010
37780
  optionHeight: props.optionHeight,
38011
37781
  defaultValue: props.defaultValue,
38012
- formatOptionLabel: props.formatOptionLabel
37782
+ formatOptionLabel: props.formatOptionLabel,
37783
+ Option: components.Option
38013
37784
  });
38014
37785
  }
38015
37786
  if (props.autosize === false && props.multiselect) components.ValueContainer = _value_container__WEBPACK_IMPORTED_MODULE_5__.ValueContainer;
@@ -38247,7 +38018,7 @@ Dropdown.propTypes = {
38247
38018
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
38248
38019
  required: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
38249
38020
  invalid: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
38250
- label: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]),
38021
+ label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
38251
38022
  labelIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
38252
38023
  helperText: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
38253
38024
  size: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['sm', 'md', 'lg']),
@@ -38500,6 +38271,7 @@ var Option = function Option(props) {
38500
38271
  }, className)
38501
38272
  }, lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(innerProps, 'onMouseMove', 'onMouseOver'), {
38502
38273
  text: children,
38274
+ description: data.description,
38503
38275
  tooltip: data.tooltip,
38504
38276
  disabled: isDisabled,
38505
38277
  selected: isSelected,
@@ -38768,278 +38540,39 @@ var ValueContainerComponent = function ValueContainerComponent(props) {
38768
38540
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select__WEBPACK_IMPORTED_MODULE_4__.c.ValueContainer, rest, visibleOpts, (recalculationRender || hiddenCount > 0) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MoreOpt, {
38769
38541
  key: "more-badge",
38770
38542
  ref: moreOptRef,
38771
- inputProps: props,
38772
- count: hiddenCount
38773
- }), childsToRender));
38774
- };
38775
- var ValueContainer = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(ValueContainerComponent);
38776
- var MoreOpt = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
38777
- var count = props.count,
38778
- inputProps = props.inputProps;
38779
- var multiValueProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValue', {
38780
- 'multi-value': true,
38781
- 'multi-value--more': true
38782
- });
38783
- var multiValueLabelProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValueLabel', {
38784
- 'multi-value__label': true
38785
- });
38786
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, _extends({
38787
- ref: ref
38788
- }, multiValueProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, multiValueLabelProps, "+".concat(count), "\xA0"));
38789
- });
38790
- MoreOpt.displayName = 'MoreOpt';
38791
- var OptsWrapper = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38792
- displayName: "OptsWrapper",
38793
- componentId: "sc-1kh0w5j-0"
38794
- })(["flex:1;"]);
38795
- var Generic = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38796
- displayName: "Generic",
38797
- componentId: "sc-1kh0w5j-1"
38798
- })(["", ""], function (prop) {
38799
- return prop.$css;
38800
- });
38801
- var isValueChild = function isValueChild(child) {
38802
- var _child$type;
38803
- return ['MultiValue', 'SingleValue'].includes((child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) || '');
38804
- };
38805
-
38806
- /***/ }),
38807
-
38808
- /***/ "./src/input/dropdown/virtualized_list.js":
38809
- /*!************************************************!*\
38810
- !*** ./src/input/dropdown/virtualized_list.js ***!
38811
- \************************************************/
38812
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38813
-
38814
- "use strict";
38815
- __webpack_require__.r(__webpack_exports__);
38816
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38817
- /* harmony export */ VirtualizedListFactory: () => (/* binding */ VirtualizedListFactory)
38818
- /* harmony export */ });
38819
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
38820
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
38821
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
38822
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
38823
- /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-select */ "./node_modules/react-select/dist/index-a301f526.esm.js");
38824
- /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
38825
- /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_2__);
38826
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
38827
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
38828
- /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks */ "./src/hooks/index.js");
38829
- /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme */ "./src/theme.js");
38830
- /* harmony import */ var _util_getters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/getters */ "./src/util/getters.js");
38831
- /* harmony import */ var _option__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./option */ "./src/input/dropdown/option.js");
38832
- // LICENSE_CODE ZON
38833
-
38834
-
38835
- /*jslint react:true*/
38836
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
38837
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
38838
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
38839
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
38840
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
38841
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38842
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
38843
-
38844
-
38845
-
38846
-
38847
-
38848
-
38849
-
38850
-
38851
-
38852
- var VirtualizedListFactory = function VirtualizedListFactory(_ref) {
38853
- var _ref$optionHeight = _ref.optionHeight,
38854
- optionHeight = _ref$optionHeight === void 0 ? 40 : _ref$optionHeight,
38855
- defaultValue = _ref.defaultValue,
38856
- valueGetter = _ref.valueGetter,
38857
- formatOptionLabel = _ref.formatOptionLabel;
38858
- var Comp = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(function (props) {
38859
- var selectedValue = props.getValue() ? props.getValue()[0] : undefined;
38860
- if (props.children && !props.children.length) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_select__WEBPACK_IMPORTED_MODULE_8__.c.NoOptionsMessage, props.children.props);
38861
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ListVirtualized, _extends({}, props, {
38862
- optionHeight: optionHeight,
38863
- selectedValue: selectedValue,
38864
- defaultValue: defaultValue,
38865
- valueGetter: valueGetter,
38866
- formatOptionLabel: formatOptionLabel
38867
- }));
38868
- });
38869
- Comp.displayName = 'VirtualizedListComp';
38870
- return Comp;
38871
- };
38872
- var StyledList = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.List).withConfig({
38873
- displayName: "StyledList",
38874
- componentId: "sc-18emnrh-0"
38875
- })(["", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
38876
- var ListVirtualizedComponent = function ListVirtualizedComponent(props) {
38877
- var listComponent;
38878
- var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
38879
- _useState2 = _slicedToArray(_useState, 2),
38880
- focusedItemIndex = _useState2[0],
38881
- setFocusedItemIndex = _useState2[1];
38882
- var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
38883
- _useState4 = _slicedToArray(_useState3, 2),
38884
- queueScrollToIdx = _useState4[0],
38885
- setQueueScrollToIdx = _useState4[1];
38886
- var maxHeight = props.maxHeight,
38887
- children = props.children,
38888
- optionHeight = props.optionHeight,
38889
- options = props.options,
38890
- selectedValue = props.selectedValue,
38891
- defaultValue = props.defaultValue,
38892
- valueGetter = props.valueGetter,
38893
- formatOptionLabel = props.formatOptionLabel;
38894
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
38895
- // only scroll to index when we have something in the queue of focused
38896
- // and not visible
38897
- if (listComponent && queueScrollToIdx !== undefined && focusedItemIndex !== undefined) {
38898
- listComponent.current.scrollToRow((0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getNextRowIndex)(focusedItemIndex, queueScrollToIdx, options));
38899
- setQueueScrollToIdx(undefined);
38900
- }
38901
- }, [listComponent, queueScrollToIdx, focusedItemIndex, options]);
38902
- var onOptionFocused = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref2) {
38903
- var index = _ref2.index,
38904
- isVisible = _ref2.isVisible;
38905
- // enqueue the changes to the task queue so we do not interrupt rendering
38906
- setTimeout(function () {
38907
- if (index !== undefined && focusedItemIndex !== index && isVisible) setFocusedItemIndex(index);else if (index !== undefined && !isVisible && !queueScrollToIdx) setQueueScrollToIdx(index);
38908
- }, 100);
38909
- }, [setFocusedItemIndex, focusedItemIndex, setQueueScrollToIdx, queueScrollToIdx]);
38910
- var height = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
38911
- return (0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getListHeight)({
38912
- maxHeight: maxHeight,
38913
- totalSize: children.length,
38914
- optionHeight: optionHeight
38915
- });
38916
- }, [maxHeight, children.length, optionHeight]);
38917
- var scrollToIndex = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
38918
- return (0,_util_getters__WEBPACK_IMPORTED_MODULE_6__.getScrollIndex)({
38919
- children: options,
38920
- selected: selectedValue || defaultValue,
38921
- valueGetter: valueGetter
38922
- });
38923
- }, [options, selectedValue, defaultValue, valueGetter]);
38924
- var rowRenderer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
38925
- return VirtualizedListRowRenderer({
38926
- children: children,
38927
- onOptionFocused: onOptionFocused,
38928
- optionHeight: optionHeight,
38929
- formatOptionLabel: formatOptionLabel
38930
- });
38931
- }, [children, onOptionFocused, optionHeight, formatOptionLabel]);
38932
- var list = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
38933
- return [];
38934
- }, []);
38935
- var isRowLoaded = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref3) {
38936
- var index = _ref3.index;
38937
- return !!list[index];
38938
- }, [list]);
38939
- var loadMoreRows = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useDebouncedCallback)(function (_ref4) {
38940
- var startIndex = _ref4.startIndex,
38941
- stopIndex = _ref4.stopIndex;
38942
- for (var i = startIndex; i <= stopIndex; i++) list.push(children[i]);
38943
- }, 100);
38944
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.AutoSizer, {
38945
- disableHeight: true
38946
- }, function (_ref5) {
38947
- var width = _ref5.width;
38948
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.InfiniteLoader, {
38949
- isRowLoaded: isRowLoaded,
38950
- threshold: props.threshold,
38951
- loadMoreRows: loadMoreRows,
38952
- rowCount: props.children.length || 0,
38953
- minimumBatchSize: props.minimumBatchSize
38954
- }, function (_ref6) {
38955
- var onRowsRendered = _ref6.onRowsRendered,
38956
- registerChild = _ref6.registerChild;
38957
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledList, {
38958
- ref: function ref(element) {
38959
- registerChild(element);
38960
- listComponent = {
38961
- current: element
38962
- };
38963
- return element;
38964
- },
38965
- onRowsRendered: onRowsRendered,
38966
- height: height,
38967
- scrollToIndex: scrollToIndex,
38968
- rowCount: props.children.length,
38969
- rowHeight: props.optionHeight,
38970
- rowRenderer: rowRenderer,
38971
- width: width
38972
- });
38973
- });
38974
- });
38975
- };
38976
- var ListVirtualized = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(ListVirtualizedComponent);
38977
- ListVirtualized.propTypes = {
38978
- maxHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
38979
- // this prop is coming from react-select
38980
- children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
38981
- optionHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
38982
- selectedValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
38983
- defaultValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
38984
- valueGetter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
38985
- options: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
38986
- minimumBatchSize: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
38987
- };
38988
- ListVirtualized.defaultProps = {
38989
- valueGetter: function valueGetter(item) {
38990
- return item && item.value;
38991
- },
38992
- maxHeight: 200,
38993
- minimumBatchSize: 100
38994
- };
38995
- var VirtualizedListRowRenderer = function VirtualizedListRowRenderer(_ref7) {
38996
- var children = _ref7.children,
38997
- onOptionFocused = _ref7.onOptionFocused,
38998
- optionHeight = _ref7.optionHeight,
38999
- formatOptionLabel = _ref7.formatOptionLabel;
39000
- var Comp = function Comp(_ref8) {
39001
- var key = _ref8.key,
39002
- index = _ref8.index,
39003
- style = _ref8.style,
39004
- isVisible = _ref8.isVisible,
39005
- isScrolling = _ref8.isScrolling;
39006
- // reality is that we do not need to pass the list here.
39007
- // we can work straight with the children.
39008
- // since the actual behavior will be handled by the renderer
39009
- var thisProps = children[index].props;
39010
- var className = thisProps.cx({
39011
- 'virtualized-item': true
39012
- });
39013
- if (thisProps.isFocused && !isScrolling) onOptionFocused({
39014
- data: thisProps.data,
39015
- index: index,
39016
- isVisible: isVisible,
39017
- isScrolling: isScrolling
39018
- });
39019
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
39020
- className: className,
39021
- key: key,
39022
- style: style
39023
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_option__WEBPACK_IMPORTED_MODULE_7__.Option, {
39024
- key: key,
39025
- style: style,
39026
- data: thisProps.data,
39027
- isVisible: isVisible,
39028
- isScrolling: isScrolling,
39029
- optionHeight: optionHeight,
39030
- isDisabled: thisProps.isDisabled,
39031
- isFocused: thisProps.isFocused,
39032
- isSelected: thisProps.isSelected,
39033
- className: thisProps.className,
39034
- cx: thisProps.cx,
39035
- innerRef: thisProps.innerRef,
39036
- innerProps: thisProps.innerProps,
39037
- formatOptionLabel: formatOptionLabel,
39038
- tag: "div"
39039
- }, thisProps.children));
39040
- };
39041
- Comp.displayName = 'VirtualizedListRowRendererComp';
39042
- return Comp;
38543
+ inputProps: props,
38544
+ count: hiddenCount
38545
+ }), childsToRender));
38546
+ };
38547
+ var ValueContainer = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(ValueContainerComponent);
38548
+ var MoreOpt = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
38549
+ var count = props.count,
38550
+ inputProps = props.inputProps;
38551
+ var multiValueProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValue', {
38552
+ 'multi-value': true,
38553
+ 'multi-value--more': true
38554
+ });
38555
+ var multiValueLabelProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValueLabel', {
38556
+ 'multi-value__label': true
38557
+ });
38558
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, _extends({
38559
+ ref: ref
38560
+ }, multiValueProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, multiValueLabelProps, "+".concat(count), "\xA0"));
38561
+ });
38562
+ MoreOpt.displayName = 'MoreOpt';
38563
+ var OptsWrapper = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38564
+ displayName: "OptsWrapper",
38565
+ componentId: "sc-1kh0w5j-0"
38566
+ })(["flex:1;"]);
38567
+ var Generic = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38568
+ displayName: "Generic",
38569
+ componentId: "sc-1kh0w5j-1"
38570
+ })(["", ""], function (prop) {
38571
+ return prop.$css;
38572
+ });
38573
+ var isValueChild = function isValueChild(child) {
38574
+ var _child$type;
38575
+ return ['MultiValue', 'SingleValue'].includes((child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) || '');
39043
38576
  };
39044
38577
 
39045
38578
  /***/ }),
@@ -45482,6 +45015,248 @@ var getStyleProps = function getStyleProps(props, name, classNamesState) {
45482
45015
 
45483
45016
  /***/ }),
45484
45017
 
45018
+ /***/ "./src/util/virtualized_list.js":
45019
+ /*!**************************************!*\
45020
+ !*** ./src/util/virtualized_list.js ***!
45021
+ \**************************************/
45022
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
45023
+
45024
+ "use strict";
45025
+ __webpack_require__.r(__webpack_exports__);
45026
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45027
+ /* harmony export */ VirtualizedListFactory: () => (/* binding */ VirtualizedListFactory)
45028
+ /* harmony export */ });
45029
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
45030
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
45031
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
45032
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
45033
+ /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-select */ "./node_modules/react-select/dist/index-a301f526.esm.js");
45034
+ /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
45035
+ /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_2__);
45036
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
45037
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
45038
+ /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks */ "./src/hooks/index.js");
45039
+ /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
45040
+ /* harmony import */ var _getters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getters */ "./src/util/getters.js");
45041
+ // LICENSE_CODE ZON
45042
+
45043
+
45044
+ /*jslint react:true*/
45045
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45046
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45047
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45048
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
45049
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
45050
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45051
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
45052
+
45053
+
45054
+
45055
+
45056
+
45057
+
45058
+
45059
+
45060
+ var VirtualizedListFactory = function VirtualizedListFactory(_ref) {
45061
+ var _ref$optionHeight = _ref.optionHeight,
45062
+ optionHeight = _ref$optionHeight === void 0 ? 40 : _ref$optionHeight,
45063
+ defaultValue = _ref.defaultValue,
45064
+ valueGetter = _ref.valueGetter,
45065
+ formatOptionLabel = _ref.formatOptionLabel,
45066
+ Option = _ref.Option;
45067
+ var Comp = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(function (props) {
45068
+ var selectedValue = props.getValue() ? props.getValue()[0] : undefined;
45069
+ if (props.children && !props.children.length) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_select__WEBPACK_IMPORTED_MODULE_7__.c.NoOptionsMessage, props.children.props);
45070
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ListVirtualized, _extends({}, props, {
45071
+ optionHeight: optionHeight,
45072
+ selectedValue: selectedValue,
45073
+ defaultValue: defaultValue,
45074
+ valueGetter: valueGetter,
45075
+ formatOptionLabel: formatOptionLabel,
45076
+ Option: Option
45077
+ }));
45078
+ });
45079
+ Comp.displayName = 'VirtualizedListComp';
45080
+ return Comp;
45081
+ };
45082
+ var StyledList = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.List).withConfig({
45083
+ displayName: "StyledList",
45084
+ componentId: "sc-1142w0k-0"
45085
+ })(["", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
45086
+ var ListVirtualizedComponent = function ListVirtualizedComponent(props) {
45087
+ var listComponent;
45088
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
45089
+ _useState2 = _slicedToArray(_useState, 2),
45090
+ focusedItemIndex = _useState2[0],
45091
+ setFocusedItemIndex = _useState2[1];
45092
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
45093
+ _useState4 = _slicedToArray(_useState3, 2),
45094
+ queueScrollToIdx = _useState4[0],
45095
+ setQueueScrollToIdx = _useState4[1];
45096
+ var maxHeight = props.maxHeight,
45097
+ children = props.children,
45098
+ optionHeight = props.optionHeight,
45099
+ options = props.options,
45100
+ selectedValue = props.selectedValue,
45101
+ defaultValue = props.defaultValue,
45102
+ valueGetter = props.valueGetter,
45103
+ formatOptionLabel = props.formatOptionLabel,
45104
+ Option = props.Option;
45105
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
45106
+ // only scroll to index when we have something in the queue of focused
45107
+ // and not visible
45108
+ if (listComponent && queueScrollToIdx !== undefined && focusedItemIndex !== undefined) {
45109
+ listComponent.current.scrollToRow((0,_getters__WEBPACK_IMPORTED_MODULE_6__.getNextRowIndex)(focusedItemIndex, queueScrollToIdx, options));
45110
+ setQueueScrollToIdx(undefined);
45111
+ }
45112
+ }, [listComponent, queueScrollToIdx, focusedItemIndex, options]);
45113
+ var onOptionFocused = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref2) {
45114
+ var index = _ref2.index,
45115
+ isVisible = _ref2.isVisible;
45116
+ // enqueue the changes to the task queue so we do not interrupt rendering
45117
+ setTimeout(function () {
45118
+ if (index !== undefined && focusedItemIndex !== index && isVisible) setFocusedItemIndex(index);else if (index !== undefined && !isVisible && !queueScrollToIdx) setQueueScrollToIdx(index);
45119
+ }, 100);
45120
+ }, [setFocusedItemIndex, focusedItemIndex, setQueueScrollToIdx, queueScrollToIdx]);
45121
+ var height = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45122
+ return (0,_getters__WEBPACK_IMPORTED_MODULE_6__.getListHeight)({
45123
+ maxHeight: maxHeight,
45124
+ totalSize: children.length,
45125
+ optionHeight: optionHeight
45126
+ });
45127
+ }, [maxHeight, children.length, optionHeight]);
45128
+ var scrollToIndex = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45129
+ return (0,_getters__WEBPACK_IMPORTED_MODULE_6__.getScrollIndex)({
45130
+ children: options,
45131
+ selected: selectedValue || defaultValue,
45132
+ valueGetter: valueGetter
45133
+ });
45134
+ }, [options, selectedValue, defaultValue, valueGetter]);
45135
+ var rowRenderer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45136
+ return VirtualizedListRowRenderer({
45137
+ children: children,
45138
+ onOptionFocused: onOptionFocused,
45139
+ optionHeight: optionHeight,
45140
+ formatOptionLabel: formatOptionLabel,
45141
+ Option: Option
45142
+ });
45143
+ }, [children, onOptionFocused, optionHeight, formatOptionLabel, Option]);
45144
+ var list = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45145
+ return [];
45146
+ }, []);
45147
+ var isRowLoaded = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref3) {
45148
+ var index = _ref3.index;
45149
+ return !!list[index];
45150
+ }, [list]);
45151
+ var loadMoreRows = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useDebouncedCallback)(function (_ref4) {
45152
+ var startIndex = _ref4.startIndex,
45153
+ stopIndex = _ref4.stopIndex;
45154
+ for (var i = startIndex; i <= stopIndex; i++) list.push(children[i]);
45155
+ }, 100);
45156
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.AutoSizer, {
45157
+ disableHeight: true
45158
+ }, function (_ref5) {
45159
+ var width = _ref5.width;
45160
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.InfiniteLoader, {
45161
+ isRowLoaded: isRowLoaded,
45162
+ threshold: props.threshold,
45163
+ loadMoreRows: loadMoreRows,
45164
+ rowCount: props.children.length || 0,
45165
+ minimumBatchSize: props.minimumBatchSize
45166
+ }, function (_ref6) {
45167
+ var onRowsRendered = _ref6.onRowsRendered,
45168
+ registerChild = _ref6.registerChild;
45169
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledList, {
45170
+ ref: function ref(element) {
45171
+ registerChild(element);
45172
+ listComponent = {
45173
+ current: element
45174
+ };
45175
+ return element;
45176
+ },
45177
+ onRowsRendered: onRowsRendered,
45178
+ height: height,
45179
+ scrollToIndex: scrollToIndex,
45180
+ rowCount: props.children.length,
45181
+ rowHeight: props.optionHeight,
45182
+ rowRenderer: rowRenderer,
45183
+ width: width
45184
+ });
45185
+ });
45186
+ });
45187
+ };
45188
+ var ListVirtualized = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(ListVirtualizedComponent);
45189
+ ListVirtualized.propTypes = {
45190
+ maxHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
45191
+ // this prop is coming from react-select
45192
+ children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
45193
+ optionHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
45194
+ selectedValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
45195
+ defaultValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
45196
+ valueGetter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
45197
+ options: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
45198
+ minimumBatchSize: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
45199
+ };
45200
+ ListVirtualized.defaultProps = {
45201
+ valueGetter: function valueGetter(item) {
45202
+ return item && item.value;
45203
+ },
45204
+ maxHeight: 200,
45205
+ minimumBatchSize: 100
45206
+ };
45207
+ var VirtualizedListRowRenderer = function VirtualizedListRowRenderer(_ref7) {
45208
+ var children = _ref7.children,
45209
+ onOptionFocused = _ref7.onOptionFocused,
45210
+ optionHeight = _ref7.optionHeight,
45211
+ formatOptionLabel = _ref7.formatOptionLabel,
45212
+ Option = _ref7.Option;
45213
+ var Comp = function Comp(_ref8) {
45214
+ var key = _ref8.key,
45215
+ index = _ref8.index,
45216
+ style = _ref8.style,
45217
+ isVisible = _ref8.isVisible,
45218
+ isScrolling = _ref8.isScrolling;
45219
+ // reality is that we do not need to pass the list here.
45220
+ // we can work straight with the children.
45221
+ // since the actual behavior will be handled by the renderer
45222
+ var thisProps = children[index].props;
45223
+ var className = thisProps.cx({
45224
+ 'virtualized-item': true
45225
+ });
45226
+ if (thisProps.isFocused && !isScrolling) onOptionFocused({
45227
+ data: thisProps.data,
45228
+ index: index,
45229
+ isVisible: isVisible,
45230
+ isScrolling: isScrolling
45231
+ });
45232
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
45233
+ className: className,
45234
+ key: key,
45235
+ style: style
45236
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Option, {
45237
+ key: key,
45238
+ style: style,
45239
+ data: thisProps.data,
45240
+ isVisible: isVisible,
45241
+ isScrolling: isScrolling,
45242
+ optionHeight: optionHeight,
45243
+ isDisabled: thisProps.isDisabled,
45244
+ isFocused: thisProps.isFocused,
45245
+ isSelected: thisProps.isSelected,
45246
+ className: thisProps.className,
45247
+ cx: thisProps.cx,
45248
+ innerRef: thisProps.innerRef,
45249
+ innerProps: thisProps.innerProps,
45250
+ formatOptionLabel: formatOptionLabel,
45251
+ tag: "div"
45252
+ }, thisProps.children));
45253
+ };
45254
+ Comp.displayName = 'VirtualizedListRowRendererComp';
45255
+ return Comp;
45256
+ };
45257
+
45258
+ /***/ }),
45259
+
45485
45260
  /***/ "./src/util/with_user_styles.js":
45486
45261
  /*!**************************************!*\
45487
45262
  !*** ./src/util/with_user_styles.js ***!