@luminati-io/uikit 3.2.6 → 3.2.8

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']),
@@ -38491,6 +38262,7 @@ var Option = function Option(props) {
38491
38262
  innerProps = props.innerProps;
38492
38263
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledItem, _extends({
38493
38264
  ref: innerRef,
38265
+ "data-option": true,
38494
38266
  type: "item",
38495
38267
  className: cx({
38496
38268
  option: true,
@@ -38500,6 +38272,7 @@ var Option = function Option(props) {
38500
38272
  }, className)
38501
38273
  }, lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(innerProps, 'onMouseMove', 'onMouseOver'), {
38502
38274
  text: children,
38275
+ description: data.description,
38503
38276
  tooltip: data.tooltip,
38504
38277
  disabled: isDisabled,
38505
38278
  selected: isSelected,
@@ -38768,278 +38541,39 @@ var ValueContainerComponent = function ValueContainerComponent(props) {
38768
38541
  }, /*#__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
38542
  key: "more-badge",
38770
38543
  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;
38544
+ inputProps: props,
38545
+ count: hiddenCount
38546
+ }), childsToRender));
38547
+ };
38548
+ var ValueContainer = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(ValueContainerComponent);
38549
+ var MoreOpt = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
38550
+ var count = props.count,
38551
+ inputProps = props.inputProps;
38552
+ var multiValueProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValue', {
38553
+ 'multi-value': true,
38554
+ 'multi-value--more': true
38555
+ });
38556
+ var multiValueLabelProps = (0,_util_getters__WEBPACK_IMPORTED_MODULE_3__.getStyleProps)(inputProps, 'multiValueLabel', {
38557
+ 'multi-value__label': true
38558
+ });
38559
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, _extends({
38560
+ ref: ref
38561
+ }, multiValueProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Generic, multiValueLabelProps, "+".concat(count), "\xA0"));
38562
+ });
38563
+ MoreOpt.displayName = 'MoreOpt';
38564
+ var OptsWrapper = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38565
+ displayName: "OptsWrapper",
38566
+ componentId: "sc-1kh0w5j-0"
38567
+ })(["flex:1;"]);
38568
+ var Generic = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
38569
+ displayName: "Generic",
38570
+ componentId: "sc-1kh0w5j-1"
38571
+ })(["", ""], function (prop) {
38572
+ return prop.$css;
38573
+ });
38574
+ var isValueChild = function isValueChild(child) {
38575
+ var _child$type;
38576
+ 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
38577
  };
39044
38578
 
39045
38579
  /***/ }),
@@ -45482,6 +45016,248 @@ var getStyleProps = function getStyleProps(props, name, classNamesState) {
45482
45016
 
45483
45017
  /***/ }),
45484
45018
 
45019
+ /***/ "./src/util/virtualized_list.js":
45020
+ /*!**************************************!*\
45021
+ !*** ./src/util/virtualized_list.js ***!
45022
+ \**************************************/
45023
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
45024
+
45025
+ "use strict";
45026
+ __webpack_require__.r(__webpack_exports__);
45027
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45028
+ /* harmony export */ VirtualizedListFactory: () => (/* binding */ VirtualizedListFactory)
45029
+ /* harmony export */ });
45030
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
45031
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
45032
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
45033
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
45034
+ /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-select */ "./node_modules/react-select/dist/index-a301f526.esm.js");
45035
+ /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
45036
+ /* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_2__);
45037
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
45038
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
45039
+ /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks */ "./src/hooks/index.js");
45040
+ /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
45041
+ /* harmony import */ var _getters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getters */ "./src/util/getters.js");
45042
+ // LICENSE_CODE ZON
45043
+
45044
+
45045
+ /*jslint react:true*/
45046
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45047
+ 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."); }
45048
+ 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); }
45049
+ 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; }
45050
+ 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; } }
45051
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45052
+ 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); }
45053
+
45054
+
45055
+
45056
+
45057
+
45058
+
45059
+
45060
+
45061
+ var VirtualizedListFactory = function VirtualizedListFactory(_ref) {
45062
+ var _ref$optionHeight = _ref.optionHeight,
45063
+ optionHeight = _ref$optionHeight === void 0 ? 40 : _ref$optionHeight,
45064
+ defaultValue = _ref.defaultValue,
45065
+ valueGetter = _ref.valueGetter,
45066
+ formatOptionLabel = _ref.formatOptionLabel,
45067
+ Option = _ref.Option;
45068
+ var Comp = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(function (props) {
45069
+ var selectedValue = props.getValue() ? props.getValue()[0] : undefined;
45070
+ 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);
45071
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ListVirtualized, _extends({}, props, {
45072
+ optionHeight: optionHeight,
45073
+ selectedValue: selectedValue,
45074
+ defaultValue: defaultValue,
45075
+ valueGetter: valueGetter,
45076
+ formatOptionLabel: formatOptionLabel,
45077
+ Option: Option
45078
+ }));
45079
+ });
45080
+ Comp.displayName = 'VirtualizedListComp';
45081
+ return Comp;
45082
+ };
45083
+ var StyledList = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.List).withConfig({
45084
+ displayName: "StyledList",
45085
+ componentId: "sc-1142w0k-0"
45086
+ })(["", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
45087
+ var ListVirtualizedComponent = function ListVirtualizedComponent(props) {
45088
+ var listComponent;
45089
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
45090
+ _useState2 = _slicedToArray(_useState, 2),
45091
+ focusedItemIndex = _useState2[0],
45092
+ setFocusedItemIndex = _useState2[1];
45093
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(undefined),
45094
+ _useState4 = _slicedToArray(_useState3, 2),
45095
+ queueScrollToIdx = _useState4[0],
45096
+ setQueueScrollToIdx = _useState4[1];
45097
+ var maxHeight = props.maxHeight,
45098
+ children = props.children,
45099
+ optionHeight = props.optionHeight,
45100
+ options = props.options,
45101
+ selectedValue = props.selectedValue,
45102
+ defaultValue = props.defaultValue,
45103
+ valueGetter = props.valueGetter,
45104
+ formatOptionLabel = props.formatOptionLabel,
45105
+ Option = props.Option;
45106
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
45107
+ // only scroll to index when we have something in the queue of focused
45108
+ // and not visible
45109
+ if (listComponent && queueScrollToIdx !== undefined && focusedItemIndex !== undefined) {
45110
+ listComponent.current.scrollToRow((0,_getters__WEBPACK_IMPORTED_MODULE_6__.getNextRowIndex)(focusedItemIndex, queueScrollToIdx, options));
45111
+ setQueueScrollToIdx(undefined);
45112
+ }
45113
+ }, [listComponent, queueScrollToIdx, focusedItemIndex, options]);
45114
+ var onOptionFocused = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref2) {
45115
+ var index = _ref2.index,
45116
+ isVisible = _ref2.isVisible;
45117
+ // enqueue the changes to the task queue so we do not interrupt rendering
45118
+ setTimeout(function () {
45119
+ if (index !== undefined && focusedItemIndex !== index && isVisible) setFocusedItemIndex(index);else if (index !== undefined && !isVisible && !queueScrollToIdx) setQueueScrollToIdx(index);
45120
+ }, 100);
45121
+ }, [setFocusedItemIndex, focusedItemIndex, setQueueScrollToIdx, queueScrollToIdx]);
45122
+ var height = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45123
+ return (0,_getters__WEBPACK_IMPORTED_MODULE_6__.getListHeight)({
45124
+ maxHeight: maxHeight,
45125
+ totalSize: children.length,
45126
+ optionHeight: optionHeight
45127
+ });
45128
+ }, [maxHeight, children.length, optionHeight]);
45129
+ var scrollToIndex = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45130
+ return (0,_getters__WEBPACK_IMPORTED_MODULE_6__.getScrollIndex)({
45131
+ children: options,
45132
+ selected: selectedValue || defaultValue,
45133
+ valueGetter: valueGetter
45134
+ });
45135
+ }, [options, selectedValue, defaultValue, valueGetter]);
45136
+ var rowRenderer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45137
+ return VirtualizedListRowRenderer({
45138
+ children: children,
45139
+ onOptionFocused: onOptionFocused,
45140
+ optionHeight: optionHeight,
45141
+ formatOptionLabel: formatOptionLabel,
45142
+ Option: Option
45143
+ });
45144
+ }, [children, onOptionFocused, optionHeight, formatOptionLabel, Option]);
45145
+ var list = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
45146
+ return [];
45147
+ }, []);
45148
+ var isRowLoaded = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_ref3) {
45149
+ var index = _ref3.index;
45150
+ return !!list[index];
45151
+ }, [list]);
45152
+ var loadMoreRows = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useDebouncedCallback)(function (_ref4) {
45153
+ var startIndex = _ref4.startIndex,
45154
+ stopIndex = _ref4.stopIndex;
45155
+ for (var i = startIndex; i <= stopIndex; i++) list.push(children[i]);
45156
+ }, 100);
45157
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.AutoSizer, {
45158
+ disableHeight: true
45159
+ }, function (_ref5) {
45160
+ var width = _ref5.width;
45161
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_2__.InfiniteLoader, {
45162
+ isRowLoaded: isRowLoaded,
45163
+ threshold: props.threshold,
45164
+ loadMoreRows: loadMoreRows,
45165
+ rowCount: props.children.length || 0,
45166
+ minimumBatchSize: props.minimumBatchSize
45167
+ }, function (_ref6) {
45168
+ var onRowsRendered = _ref6.onRowsRendered,
45169
+ registerChild = _ref6.registerChild;
45170
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledList, {
45171
+ ref: function ref(element) {
45172
+ registerChild(element);
45173
+ listComponent = {
45174
+ current: element
45175
+ };
45176
+ return element;
45177
+ },
45178
+ onRowsRendered: onRowsRendered,
45179
+ height: height,
45180
+ scrollToIndex: scrollToIndex,
45181
+ rowCount: props.children.length,
45182
+ rowHeight: props.optionHeight,
45183
+ rowRenderer: rowRenderer,
45184
+ width: width
45185
+ });
45186
+ });
45187
+ });
45188
+ };
45189
+ var ListVirtualized = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(ListVirtualizedComponent);
45190
+ ListVirtualized.propTypes = {
45191
+ maxHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
45192
+ // this prop is coming from react-select
45193
+ children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
45194
+ optionHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
45195
+ selectedValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
45196
+ defaultValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
45197
+ valueGetter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
45198
+ options: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
45199
+ minimumBatchSize: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
45200
+ };
45201
+ ListVirtualized.defaultProps = {
45202
+ valueGetter: function valueGetter(item) {
45203
+ return item && item.value;
45204
+ },
45205
+ maxHeight: 200,
45206
+ minimumBatchSize: 100
45207
+ };
45208
+ var VirtualizedListRowRenderer = function VirtualizedListRowRenderer(_ref7) {
45209
+ var children = _ref7.children,
45210
+ onOptionFocused = _ref7.onOptionFocused,
45211
+ optionHeight = _ref7.optionHeight,
45212
+ formatOptionLabel = _ref7.formatOptionLabel,
45213
+ Option = _ref7.Option;
45214
+ var Comp = function Comp(_ref8) {
45215
+ var key = _ref8.key,
45216
+ index = _ref8.index,
45217
+ style = _ref8.style,
45218
+ isVisible = _ref8.isVisible,
45219
+ isScrolling = _ref8.isScrolling;
45220
+ // reality is that we do not need to pass the list here.
45221
+ // we can work straight with the children.
45222
+ // since the actual behavior will be handled by the renderer
45223
+ var thisProps = children[index].props;
45224
+ var className = thisProps.cx({
45225
+ 'virtualized-item': true
45226
+ });
45227
+ if (thisProps.isFocused && !isScrolling) onOptionFocused({
45228
+ data: thisProps.data,
45229
+ index: index,
45230
+ isVisible: isVisible,
45231
+ isScrolling: isScrolling
45232
+ });
45233
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
45234
+ className: className,
45235
+ key: key,
45236
+ style: style
45237
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Option, {
45238
+ key: key,
45239
+ style: style,
45240
+ data: thisProps.data,
45241
+ isVisible: isVisible,
45242
+ isScrolling: isScrolling,
45243
+ optionHeight: optionHeight,
45244
+ isDisabled: thisProps.isDisabled,
45245
+ isFocused: thisProps.isFocused,
45246
+ isSelected: thisProps.isSelected,
45247
+ className: thisProps.className,
45248
+ cx: thisProps.cx,
45249
+ innerRef: thisProps.innerRef,
45250
+ innerProps: thisProps.innerProps,
45251
+ formatOptionLabel: formatOptionLabel,
45252
+ tag: "div"
45253
+ }, thisProps.children));
45254
+ };
45255
+ Comp.displayName = 'VirtualizedListRowRendererComp';
45256
+ return Comp;
45257
+ };
45258
+
45259
+ /***/ }),
45260
+
45485
45261
  /***/ "./src/util/with_user_styles.js":
45486
45262
  /*!**************************************!*\
45487
45263
  !*** ./src/util/with_user_styles.js ***!