trotl-filter 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -22,6 +22,16 @@ function _interopNamespaceDefault(e) {
22
22
 
23
23
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
24
 
25
+ function _extends$1() {
26
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
27
+ for (var e = 1; e < arguments.length; e++) {
28
+ var t = arguments[e];
29
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
30
+ }
31
+ return n;
32
+ }, _extends$1.apply(null, arguments);
33
+ }
34
+
25
35
  function _typeof(o) {
26
36
  "@babel/helpers - typeof";
27
37
 
@@ -222,14 +232,14 @@ function useStateManager(_ref) {
222
232
  });
223
233
  }
224
234
 
225
- function _extends$1() {
226
- return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
235
+ function _extends() {
236
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
227
237
  for (var e = 1; e < arguments.length; e++) {
228
238
  var t = arguments[e];
229
239
  for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
230
240
  }
231
241
  return n;
232
- }, _extends$1.apply(null, arguments);
242
+ }, _extends.apply(null, arguments);
233
243
  }
234
244
 
235
245
  function _classCallCheck(a, n) {
@@ -3461,7 +3471,7 @@ var Menu = function Menu(props) {
3461
3471
  var children = props.children,
3462
3472
  innerRef = props.innerRef,
3463
3473
  innerProps = props.innerProps;
3464
- return jsx("div", _extends$1({}, getStyleProps(props, 'menu', {
3474
+ return jsx("div", _extends({}, getStyleProps(props, 'menu', {
3465
3475
  menu: true
3466
3476
  }), {
3467
3477
  ref: innerRef
@@ -3492,7 +3502,7 @@ var MenuList = function MenuList(props) {
3492
3502
  innerProps = props.innerProps,
3493
3503
  innerRef = props.innerRef,
3494
3504
  isMulti = props.isMulti;
3495
- return jsx("div", _extends$1({}, getStyleProps(props, 'menuList', {
3505
+ return jsx("div", _extends({}, getStyleProps(props, 'menuList', {
3496
3506
  'menu-list': true,
3497
3507
  'menu-list--is-multi': isMulti
3498
3508
  }), {
@@ -3522,7 +3532,7 @@ var NoOptionsMessage = function NoOptionsMessage(_ref6) {
3522
3532
  children = _ref6$children === void 0 ? 'No options' : _ref6$children,
3523
3533
  innerProps = _ref6.innerProps,
3524
3534
  restProps = _objectWithoutProperties(_ref6, _excluded$3);
3525
- return jsx("div", _extends$1({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3535
+ return jsx("div", _extends({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3526
3536
  children: children,
3527
3537
  innerProps: innerProps
3528
3538
  }), 'noOptionsMessage', {
@@ -3535,7 +3545,7 @@ var LoadingMessage = function LoadingMessage(_ref7) {
3535
3545
  children = _ref7$children === void 0 ? 'Loading...' : _ref7$children,
3536
3546
  innerProps = _ref7.innerProps,
3537
3547
  restProps = _objectWithoutProperties(_ref7, _excluded2$1);
3538
- return jsx("div", _extends$1({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3548
+ return jsx("div", _extends({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3539
3549
  children: children,
3540
3550
  innerProps: innerProps
3541
3551
  }), 'loadingMessage', {
@@ -3620,7 +3630,7 @@ var MenuPortal = function MenuPortal(props) {
3620
3630
  if (!appendTo && menuPosition !== 'fixed' || !computedPosition) return null;
3621
3631
 
3622
3632
  // same wrapper element whether fixed or portalled
3623
- var menuWrapper = jsx("div", _extends$1({
3633
+ var menuWrapper = jsx("div", _extends({
3624
3634
  ref: setMenuPortalElement
3625
3635
  }, getStyleProps(_objectSpread2(_objectSpread2({}, props), {}, {
3626
3636
  offset: computedPosition.offset,
@@ -3654,7 +3664,7 @@ var SelectContainer = function SelectContainer(props) {
3654
3664
  innerProps = props.innerProps,
3655
3665
  isDisabled = props.isDisabled,
3656
3666
  isRtl = props.isRtl;
3657
- return jsx("div", _extends$1({}, getStyleProps(props, 'container', {
3667
+ return jsx("div", _extends({}, getStyleProps(props, 'container', {
3658
3668
  '--is-disabled': isDisabled,
3659
3669
  '--is-rtl': isRtl
3660
3670
  }), innerProps), children);
@@ -3686,7 +3696,7 @@ var ValueContainer = function ValueContainer(props) {
3686
3696
  innerProps = props.innerProps,
3687
3697
  isMulti = props.isMulti,
3688
3698
  hasValue = props.hasValue;
3689
- return jsx("div", _extends$1({}, getStyleProps(props, 'valueContainer', {
3699
+ return jsx("div", _extends({}, getStyleProps(props, 'valueContainer', {
3690
3700
  'value-container': true,
3691
3701
  'value-container--is-multi': isMulti,
3692
3702
  'value-container--has-value': hasValue
@@ -3708,7 +3718,7 @@ var indicatorsContainerCSS = function indicatorsContainerCSS() {
3708
3718
  var IndicatorsContainer = function IndicatorsContainer(props) {
3709
3719
  var children = props.children,
3710
3720
  innerProps = props.innerProps;
3711
- return jsx("div", _extends$1({}, getStyleProps(props, 'indicatorsContainer', {
3721
+ return jsx("div", _extends({}, getStyleProps(props, 'indicatorsContainer', {
3712
3722
  indicators: true
3713
3723
  }), innerProps), children);
3714
3724
  };
@@ -3733,7 +3743,7 @@ var _ref2$2 = process.env.NODE_ENV === "production" ? {
3733
3743
  var Svg = function Svg(_ref) {
3734
3744
  var size = _ref.size,
3735
3745
  props = _objectWithoutProperties(_ref, _excluded$2);
3736
- return jsx("svg", _extends$1({
3746
+ return jsx("svg", _extends({
3737
3747
  height: size,
3738
3748
  width: size,
3739
3749
  viewBox: "0 0 20 20",
@@ -3743,14 +3753,14 @@ var Svg = function Svg(_ref) {
3743
3753
  }, props));
3744
3754
  };
3745
3755
  var CrossIcon = function CrossIcon(props) {
3746
- return jsx(Svg, _extends$1({
3756
+ return jsx(Svg, _extends({
3747
3757
  size: 20
3748
3758
  }, props), jsx("path", {
3749
3759
  d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
3750
3760
  }));
3751
3761
  };
3752
3762
  var DownChevron = function DownChevron(props) {
3753
- return jsx(Svg, _extends$1({
3763
+ return jsx(Svg, _extends({
3754
3764
  size: 20
3755
3765
  }, props), jsx("path", {
3756
3766
  d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
@@ -3782,7 +3792,7 @@ var dropdownIndicatorCSS = baseCSS;
3782
3792
  var DropdownIndicator = function DropdownIndicator(props) {
3783
3793
  var children = props.children,
3784
3794
  innerProps = props.innerProps;
3785
- return jsx("div", _extends$1({}, getStyleProps(props, 'dropdownIndicator', {
3795
+ return jsx("div", _extends({}, getStyleProps(props, 'dropdownIndicator', {
3786
3796
  indicator: true,
3787
3797
  'dropdown-indicator': true
3788
3798
  }), innerProps), children || jsx(DownChevron, null));
@@ -3791,7 +3801,7 @@ var clearIndicatorCSS = baseCSS;
3791
3801
  var ClearIndicator = function ClearIndicator(props) {
3792
3802
  var children = props.children,
3793
3803
  innerProps = props.innerProps;
3794
- return jsx("div", _extends$1({}, getStyleProps(props, 'clearIndicator', {
3804
+ return jsx("div", _extends({}, getStyleProps(props, 'clearIndicator', {
3795
3805
  indicator: true,
3796
3806
  'clear-indicator': true
3797
3807
  }), innerProps), children || jsx(CrossIcon, null));
@@ -3818,7 +3828,7 @@ var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4, unstyled) {
3818
3828
  };
3819
3829
  var IndicatorSeparator = function IndicatorSeparator(props) {
3820
3830
  var innerProps = props.innerProps;
3821
- return jsx("span", _extends$1({}, innerProps, getStyleProps(props, 'indicatorSeparator', {
3831
+ return jsx("span", _extends({}, innerProps, getStyleProps(props, 'indicatorSeparator', {
3822
3832
  'indicator-separator': true
3823
3833
  })));
3824
3834
  };
@@ -3871,7 +3881,7 @@ var LoadingIndicator = function LoadingIndicator(_ref7) {
3871
3881
  _ref7$size = _ref7.size,
3872
3882
  size = _ref7$size === void 0 ? 4 : _ref7$size,
3873
3883
  restProps = _objectWithoutProperties(_ref7, _excluded2);
3874
- return jsx("div", _extends$1({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3884
+ return jsx("div", _extends({}, getStyleProps(_objectSpread2(_objectSpread2({}, restProps), {}, {
3875
3885
  innerProps: innerProps,
3876
3886
  isRtl: isRtl,
3877
3887
  size: size
@@ -3927,7 +3937,7 @@ var Control = function Control(props) {
3927
3937
  innerRef = props.innerRef,
3928
3938
  innerProps = props.innerProps,
3929
3939
  menuIsOpen = props.menuIsOpen;
3930
- return jsx("div", _extends$1({
3940
+ return jsx("div", _extends({
3931
3941
  ref: innerRef
3932
3942
  }, getStyleProps(props, 'control', {
3933
3943
  control: true,
@@ -3959,9 +3969,9 @@ var Group = function Group(props) {
3959
3969
  label = props.label,
3960
3970
  theme = props.theme,
3961
3971
  selectProps = props.selectProps;
3962
- return jsx("div", _extends$1({}, getStyleProps(props, 'group', {
3972
+ return jsx("div", _extends({}, getStyleProps(props, 'group', {
3963
3973
  group: true
3964
- }), innerProps), jsx(Heading, _extends$1({}, headingProps, {
3974
+ }), innerProps), jsx(Heading, _extends({}, headingProps, {
3965
3975
  selectProps: selectProps,
3966
3976
  theme: theme,
3967
3977
  getStyles: getStyles,
@@ -3991,7 +4001,7 @@ var GroupHeading = function GroupHeading(props) {
3991
4001
  var _cleanCommonProps = cleanCommonProps(props);
3992
4002
  _cleanCommonProps.data;
3993
4003
  var innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$1);
3994
- return jsx("div", _extends$1({}, getStyleProps(props, 'groupHeading', {
4004
+ return jsx("div", _extends({}, getStyleProps(props, 'groupHeading', {
3995
4005
  'group-heading': true
3996
4006
  }), innerProps));
3997
4007
  };
@@ -4054,11 +4064,11 @@ var Input = function Input(props) {
4054
4064
  isHidden = _cleanCommonProps.isHidden,
4055
4065
  inputClassName = _cleanCommonProps.inputClassName,
4056
4066
  innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$5);
4057
- return jsx("div", _extends$1({}, getStyleProps(props, 'input', {
4067
+ return jsx("div", _extends({}, getStyleProps(props, 'input', {
4058
4068
  'input-container': true
4059
4069
  }), {
4060
4070
  "data-value": value || ''
4061
- }), jsx("input", _extends$1({
4071
+ }), jsx("input", _extends({
4062
4072
  className: cx({
4063
4073
  input: true
4064
4074
  }, inputClassName),
@@ -4131,7 +4141,7 @@ var MultiValueLabel = MultiValueGeneric;
4131
4141
  function MultiValueRemove(_ref5) {
4132
4142
  var children = _ref5.children,
4133
4143
  innerProps = _ref5.innerProps;
4134
- return jsx("div", _extends$1({
4144
+ return jsx("div", _extends({
4135
4145
  role: "button"
4136
4146
  }, innerProps), children || jsx(CrossIcon, {
4137
4147
  size: 14
@@ -4205,7 +4215,7 @@ var Option = function Option(props) {
4205
4215
  isSelected = props.isSelected,
4206
4216
  innerRef = props.innerRef,
4207
4217
  innerProps = props.innerProps;
4208
- return jsx("div", _extends$1({}, getStyleProps(props, 'option', {
4218
+ return jsx("div", _extends({}, getStyleProps(props, 'option', {
4209
4219
  option: true,
4210
4220
  'option--is-disabled': isDisabled,
4211
4221
  'option--is-focused': isFocused,
@@ -4233,7 +4243,7 @@ var placeholderCSS = function placeholderCSS(_ref, unstyled) {
4233
4243
  var Placeholder = function Placeholder(props) {
4234
4244
  var children = props.children,
4235
4245
  innerProps = props.innerProps;
4236
- return jsx("div", _extends$1({}, getStyleProps(props, 'placeholder', {
4246
+ return jsx("div", _extends({}, getStyleProps(props, 'placeholder', {
4237
4247
  placeholder: true
4238
4248
  }), innerProps), children);
4239
4249
  };
@@ -4261,7 +4271,7 @@ var SingleValue = function SingleValue(props) {
4261
4271
  var children = props.children,
4262
4272
  isDisabled = props.isDisabled,
4263
4273
  innerProps = props.innerProps;
4264
- return jsx("div", _extends$1({}, getStyleProps(props, 'singleValue', {
4274
+ return jsx("div", _extends({}, getStyleProps(props, 'singleValue', {
4265
4275
  'single-value': true,
4266
4276
  'single-value--is-disabled': isDisabled
4267
4277
  }), innerProps), children);
@@ -4362,7 +4372,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
4362
4372
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
4363
4373
  };
4364
4374
  var A11yText = function A11yText(props) {
4365
- return jsx("span", _extends$1({
4375
+ return jsx("span", _extends({
4366
4376
  css: _ref
4367
4377
  }, props));
4368
4378
  };
@@ -4879,7 +4889,7 @@ function DummyInput(_ref) {
4879
4889
  props = _objectWithoutProperties(_ref, _excluded);
4880
4890
  // Remove animation props not meant for HTML elements
4881
4891
  var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
4882
- return jsx("input", _extends$1({
4892
+ return jsx("input", _extends({
4883
4893
  ref: innerRef
4884
4894
  }, filteredProps, {
4885
4895
  css: /*#__PURE__*/css$2({
@@ -6461,7 +6471,7 @@ var Select = /*#__PURE__*/function (_Component) {
6461
6471
  });
6462
6472
  if (!isSearchable) {
6463
6473
  // use a dummy input to maintain focus/blur functionality
6464
- return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends$1({
6474
+ return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends({
6465
6475
  id: id,
6466
6476
  innerRef: this.getInputRef,
6467
6477
  onBlur: this.onInputBlur,
@@ -6474,7 +6484,7 @@ var Select = /*#__PURE__*/function (_Component) {
6474
6484
  value: ""
6475
6485
  }, ariaAttributes));
6476
6486
  }
6477
- return /*#__PURE__*/React__namespace.createElement(Input, _extends$1({}, commonProps, {
6487
+ return /*#__PURE__*/React__namespace.createElement(Input, _extends({}, commonProps, {
6478
6488
  autoCapitalize: "none",
6479
6489
  autoComplete: "off",
6480
6490
  autoCorrect: "off",
@@ -6515,7 +6525,7 @@ var Select = /*#__PURE__*/function (_Component) {
6515
6525
  focusedValue = _this$state5.focusedValue,
6516
6526
  isFocused = _this$state5.isFocused;
6517
6527
  if (!this.hasValue() || !controlShouldRenderValue) {
6518
- return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends$1({}, commonProps, {
6528
+ return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends({}, commonProps, {
6519
6529
  key: "placeholder",
6520
6530
  isDisabled: isDisabled,
6521
6531
  isFocused: isFocused,
@@ -6528,7 +6538,7 @@ var Select = /*#__PURE__*/function (_Component) {
6528
6538
  return selectValue.map(function (opt, index) {
6529
6539
  var isOptionFocused = opt === focusedValue;
6530
6540
  var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
6531
- return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends$1({}, commonProps, {
6541
+ return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends({}, commonProps, {
6532
6542
  components: {
6533
6543
  Container: MultiValueContainer,
6534
6544
  Label: MultiValueLabel,
@@ -6557,7 +6567,7 @@ var Select = /*#__PURE__*/function (_Component) {
6557
6567
  return null;
6558
6568
  }
6559
6569
  var singleValue = selectValue[0];
6560
- return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends$1({}, commonProps, {
6570
+ return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends({}, commonProps, {
6561
6571
  data: singleValue,
6562
6572
  isDisabled: isDisabled
6563
6573
  }), this.formatOptionLabel(singleValue, 'value'));
@@ -6580,7 +6590,7 @@ var Select = /*#__PURE__*/function (_Component) {
6580
6590
  onTouchEnd: this.onClearIndicatorTouchEnd,
6581
6591
  'aria-hidden': 'true'
6582
6592
  };
6583
- return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends$1({}, commonProps, {
6593
+ return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends({}, commonProps, {
6584
6594
  innerProps: innerProps,
6585
6595
  isFocused: isFocused
6586
6596
  }));
@@ -6599,7 +6609,7 @@ var Select = /*#__PURE__*/function (_Component) {
6599
6609
  var innerProps = {
6600
6610
  'aria-hidden': 'true'
6601
6611
  };
6602
- return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends$1({}, commonProps, {
6612
+ return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends({}, commonProps, {
6603
6613
  innerProps: innerProps,
6604
6614
  isDisabled: isDisabled,
6605
6615
  isFocused: isFocused
@@ -6617,7 +6627,7 @@ var Select = /*#__PURE__*/function (_Component) {
6617
6627
  var commonProps = this.commonProps;
6618
6628
  var isDisabled = this.props.isDisabled;
6619
6629
  var isFocused = this.state.isFocused;
6620
- return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends$1({}, commonProps, {
6630
+ return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends({}, commonProps, {
6621
6631
  isDisabled: isDisabled,
6622
6632
  isFocused: isFocused
6623
6633
  }));
@@ -6636,7 +6646,7 @@ var Select = /*#__PURE__*/function (_Component) {
6636
6646
  onTouchEnd: this.onDropdownIndicatorTouchEnd,
6637
6647
  'aria-hidden': 'true'
6638
6648
  };
6639
- return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends$1({}, commonProps, {
6649
+ return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends({}, commonProps, {
6640
6650
  innerProps: innerProps,
6641
6651
  isDisabled: isDisabled,
6642
6652
  isFocused: isFocused
@@ -6701,7 +6711,7 @@ var Select = /*#__PURE__*/function (_Component) {
6701
6711
  'aria-selected': _this4.state.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
6702
6712
  };
6703
6713
 
6704
- return /*#__PURE__*/React__namespace.createElement(Option, _extends$1({}, commonProps, {
6714
+ return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
6705
6715
  innerProps: innerProps,
6706
6716
  data: data,
6707
6717
  isDisabled: isDisabled,
@@ -6723,7 +6733,7 @@ var Select = /*#__PURE__*/function (_Component) {
6723
6733
  groupIndex = item.index;
6724
6734
  var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
6725
6735
  var headingId = "".concat(groupId, "-heading");
6726
- return /*#__PURE__*/React__namespace.createElement(Group, _extends$1({}, commonProps, {
6736
+ return /*#__PURE__*/React__namespace.createElement(Group, _extends({}, commonProps, {
6727
6737
  key: groupId,
6728
6738
  data: _data,
6729
6739
  options: options,
@@ -6760,12 +6770,12 @@ var Select = /*#__PURE__*/function (_Component) {
6760
6770
  menuPosition: menuPosition,
6761
6771
  menuShouldScrollIntoView: menuShouldScrollIntoView
6762
6772
  };
6763
- var menuElement = /*#__PURE__*/React__namespace.createElement(MenuPlacer, _extends$1({}, commonProps, menuPlacementProps), function (_ref4) {
6773
+ var menuElement = /*#__PURE__*/React__namespace.createElement(MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref4) {
6764
6774
  var ref = _ref4.ref,
6765
6775
  _ref4$placerProps = _ref4.placerProps,
6766
6776
  placement = _ref4$placerProps.placement,
6767
6777
  maxHeight = _ref4$placerProps.maxHeight;
6768
- return /*#__PURE__*/React__namespace.createElement(Menu, _extends$1({}, commonProps, menuPlacementProps, {
6778
+ return /*#__PURE__*/React__namespace.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {
6769
6779
  innerRef: ref,
6770
6780
  innerProps: {
6771
6781
  onMouseDown: _this4.onMenuMouseDown,
@@ -6779,7 +6789,7 @@ var Select = /*#__PURE__*/function (_Component) {
6779
6789
  onBottomArrive: onMenuScrollToBottom,
6780
6790
  lockEnabled: menuShouldBlockScroll
6781
6791
  }, function (scrollTargetRef) {
6782
- return /*#__PURE__*/React__namespace.createElement(MenuList, _extends$1({}, commonProps, {
6792
+ return /*#__PURE__*/React__namespace.createElement(MenuList, _extends({}, commonProps, {
6783
6793
  innerRef: function innerRef(instance) {
6784
6794
  _this4.getMenuListRef(instance);
6785
6795
  scrollTargetRef(instance);
@@ -6799,7 +6809,7 @@ var Select = /*#__PURE__*/function (_Component) {
6799
6809
  // positioning behaviour is almost identical for portalled and fixed,
6800
6810
  // so we use the same component. the actual portalling logic is forked
6801
6811
  // within the component based on `menuPosition`
6802
- return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends$1({}, commonProps, {
6812
+ return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends({}, commonProps, {
6803
6813
  appendTo: menuPortalTarget,
6804
6814
  controlElement: this.controlRef,
6805
6815
  menuPlacement: menuPlacement,
@@ -6869,7 +6879,7 @@ var Select = /*#__PURE__*/function (_Component) {
6869
6879
  isFocused = _this$state6.isFocused,
6870
6880
  selectValue = _this$state6.selectValue;
6871
6881
  var focusableOptions = this.getFocusableOptions();
6872
- return /*#__PURE__*/React__namespace.createElement(LiveRegion$1, _extends$1({}, commonProps, {
6882
+ return /*#__PURE__*/React__namespace.createElement(LiveRegion$1, _extends({}, commonProps, {
6873
6883
  id: this.getElementId('live-region'),
6874
6884
  ariaSelection: ariaSelection,
6875
6885
  focusedOption: focusedOption,
@@ -6895,7 +6905,7 @@ var Select = /*#__PURE__*/function (_Component) {
6895
6905
  menuIsOpen = _this$props14.menuIsOpen;
6896
6906
  var isFocused = this.state.isFocused;
6897
6907
  var commonProps = this.commonProps = this.getCommonProps();
6898
- return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends$1({}, commonProps, {
6908
+ return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends({}, commonProps, {
6899
6909
  className: className,
6900
6910
  innerProps: {
6901
6911
  id: id,
@@ -6903,7 +6913,7 @@ var Select = /*#__PURE__*/function (_Component) {
6903
6913
  },
6904
6914
  isDisabled: isDisabled,
6905
6915
  isFocused: isFocused
6906
- }), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends$1({}, commonProps, {
6916
+ }), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends({}, commonProps, {
6907
6917
  innerRef: this.getControlRef,
6908
6918
  innerProps: {
6909
6919
  onMouseDown: this.onControlMouseDown,
@@ -6912,9 +6922,9 @@ var Select = /*#__PURE__*/function (_Component) {
6912
6922
  isDisabled: isDisabled,
6913
6923
  isFocused: isFocused,
6914
6924
  menuIsOpen: menuIsOpen
6915
- }), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends$1({}, commonProps, {
6925
+ }), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends({}, commonProps, {
6916
6926
  isDisabled: isDisabled
6917
- }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends$1({}, commonProps, {
6927
+ }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends({}, commonProps, {
6918
6928
  isDisabled: isDisabled
6919
6929
  }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
6920
6930
  }
@@ -6986,7 +6996,7 @@ Select.defaultProps = defaultProps;
6986
6996
 
6987
6997
  var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
6988
6998
  var baseSelectProps = useStateManager(props);
6989
- return /*#__PURE__*/React__namespace.createElement(Select, _extends$1({
6999
+ return /*#__PURE__*/React__namespace.createElement(Select, _extends({
6990
7000
  ref: ref
6991
7001
  }, baseSelectProps));
6992
7002
  });
@@ -7001,7 +7011,9 @@ const MultiSelectDropdown = ({
7001
7011
  placeholder = "Select...",
7002
7012
  required = false,
7003
7013
  closeMenuOnSelect = false,
7004
- pushUrlParamObj = false // pushUrlParamObj={"ids"}
7014
+ pushUrlParamObj = false,
7015
+ // pushUrlParamObj={"ids"}
7016
+ addItem = undefined
7005
7017
  }) => {
7006
7018
  const containerRef = React.useRef(null);
7007
7019
  const [maxVisible, setMaxVisible] = React.useState(1);
@@ -7083,6 +7095,71 @@ const MultiSelectDropdown = ({
7083
7095
  }
7084
7096
  window.history.replaceState({}, "", url);
7085
7097
  };
7098
+
7099
+ // For custom input: track input value and show add button as inline option
7100
+ const [inputValue, setInputValue] = React.useState("");
7101
+ const inputExists = React.useMemo(() => {
7102
+ return options.some(opt => String(opt.label).toLowerCase() === inputValue.trim().toLowerCase());
7103
+ }, [inputValue, options]);
7104
+
7105
+ // Add special option for +Add if inputValue is non-empty and not in options
7106
+ const menuOptions = React.useMemo(() => {
7107
+ if (inputValue && !inputExists && typeof addItem === 'function') {
7108
+ return [...options, {
7109
+ label: `+ Add "${inputValue.trim()}"`,
7110
+ value: '__add_new__',
7111
+ __isAddNew: true
7112
+ }];
7113
+ }
7114
+ return options;
7115
+ }, [options, inputValue, inputExists, addItem]);
7116
+ const handleAddNew = () => {
7117
+ if (!inputValue.trim()) return;
7118
+ const newLabel = inputValue.trim();
7119
+ // Prevent duplicate by value or label (case-insensitive)
7120
+ const exists = options.some(opt => String(opt.value).toLowerCase() === newLabel.toLowerCase() || String(opt.label).toLowerCase() === newLabel.toLowerCase());
7121
+ if (exists) {
7122
+ setInputValue("");
7123
+ return;
7124
+ }
7125
+ const newOption = {
7126
+ label: newLabel,
7127
+ value: newLabel
7128
+ };
7129
+ if (typeof addItem === 'function') {
7130
+ addItem(newOption);
7131
+ // return;
7132
+ }
7133
+ if (isMulti) {
7134
+ onChange([...(selected || []), newOption.value]);
7135
+ if (pushUrlParamObj) setUrlParam([...(selected || []), newOption.value].join(","));
7136
+ } else {
7137
+ onChange([newOption.value]);
7138
+ if (pushUrlParamObj) setUrlParam(newOption.value);
7139
+ }
7140
+ setInputValue("");
7141
+ };
7142
+
7143
+ // Custom Option to handle +Add
7144
+ const Option = props => {
7145
+ if (props.data.__isAddNew) {
7146
+ return /*#__PURE__*/React.createElement("div", _extends$1({}, props.innerProps, {
7147
+ style: {
7148
+ padding: '8px 12px',
7149
+ cursor: 'pointer',
7150
+ color: '#1677ff',
7151
+ fontWeight: 500,
7152
+ background: props.isFocused ? '#e6f4ff' : '#fff'
7153
+ },
7154
+ onMouseDown: e => {
7155
+ e.preventDefault();
7156
+ handleAddNew();
7157
+ props.selectOption(props.data);
7158
+ }
7159
+ }), props.data.label);
7160
+ }
7161
+ return /*#__PURE__*/React.createElement(components.Option, props);
7162
+ };
7086
7163
  const handleChange = selectedItems => {
7087
7164
  if (isMulti) {
7088
7165
  const values = selectedItems ? selectedItems.map(item => item.value) : [];
@@ -7209,17 +7286,29 @@ const MultiSelectDropdown = ({
7209
7286
  className: showRequiredError ? "select-required-error" : ""
7210
7287
  }, /*#__PURE__*/React.createElement(StateManagedSelect$1, {
7211
7288
  isMulti: isMulti,
7212
- options: options,
7289
+ options: menuOptions,
7213
7290
  value: selectedOptions,
7214
- onChange: handleChange,
7291
+ onChange: (val, action) => {
7292
+ // If user selects the +Add option, handle it
7293
+ if (action && action.action === 'select-option' && val && val.length && val[val.length - 1]?.__isAddNew) {
7294
+ handleAddNew();
7295
+ return;
7296
+ }
7297
+ handleChange(val);
7298
+ },
7215
7299
  placeholder: placeholder,
7216
7300
  styles: selectStyle,
7217
7301
  components: {
7218
- MultiValue
7302
+ MultiValue,
7303
+ Option
7219
7304
  },
7220
7305
  menuPortalTarget: document.body,
7221
7306
  closeMenuOnSelect: closeMenuOnSelect,
7222
- "aria-required": required
7307
+ "aria-required": required,
7308
+ inputValue: inputValue,
7309
+ onInputChange: (val, action) => {
7310
+ if (action.action === "input-change") setInputValue(val);
7311
+ }
7223
7312
  }), showRequiredError && /*#__PURE__*/React.createElement("div", {
7224
7313
  className: "error-text"
7225
7314
  }, "This field is required."));
@@ -7238,7 +7327,9 @@ const DebounceSelect = ({
7238
7327
  objValue,
7239
7328
  style,
7240
7329
  isMulti = false,
7241
- pushUrlParamObj = false
7330
+ pushUrlParamObj = false,
7331
+ addItem = undefined,
7332
+ fetchAll = true
7242
7333
  }) => {
7243
7334
  const [input, setInput] = React.useState("");
7244
7335
  const [options, setOptions] = React.useState([]);
@@ -7307,8 +7398,9 @@ const DebounceSelect = ({
7307
7398
  clearTimeout(timeoutRef.current);
7308
7399
  timeoutRef.current = setTimeout(async () => {
7309
7400
  try {
7310
- // If input is '...', fetch all options
7311
- const query = input === "..." ? "" : input;
7401
+ // If fetchAll is true and input is '...', fetch all options
7402
+ // If fetchAll is false, '...' will be treated as regular search
7403
+ const query = fetchAll && input === "..." ? "" : input;
7312
7404
  const results = await fetchOptions(query);
7313
7405
  setOptions(results);
7314
7406
  } catch (err) {
@@ -7319,7 +7411,7 @@ const DebounceSelect = ({
7319
7411
  }
7320
7412
  }, debounceDelay);
7321
7413
  return () => clearTimeout(timeoutRef.current);
7322
- }, [input, fetchOptions, debounceDelay]);
7414
+ }, [input, fetchOptions, debounceDelay, fetchAll]);
7323
7415
  const setUrlParam = value => {
7324
7416
  const url = new URL(window.location);
7325
7417
  if (value === null || value === undefined || value === "") {
@@ -7364,6 +7456,37 @@ const DebounceSelect = ({
7364
7456
  setUrlParam(updated.length ? updated.map(item => item.value).join(",") : "");
7365
7457
  }
7366
7458
  };
7459
+
7460
+ // Check if input value exists in options
7461
+ const inputExists = input.trim() && options.some(opt => String(opt.label).toLowerCase() === input.trim().toLowerCase() || String(opt.value).toLowerCase() === input.trim().toLowerCase());
7462
+ const handleAddNew = () => {
7463
+ if (!input.trim()) return;
7464
+ const newOption = {
7465
+ label: input.trim(),
7466
+ value: input.trim()
7467
+ };
7468
+ if (typeof addItem === 'function') {
7469
+ addItem(newOption);
7470
+ }
7471
+ handleSelect(newOption.value, newOption.label);
7472
+ };
7473
+
7474
+ // Handle double-click to fetch all when fetchAll is false
7475
+ const handleDoubleClick = async () => {
7476
+ if (!fetchAll && !disabled) {
7477
+ setLoading(true);
7478
+ setOpen(true);
7479
+ try {
7480
+ const results = await fetchOptions("");
7481
+ setOptions(results);
7482
+ } catch (err) {
7483
+ console.error("Failed to fetch options", err);
7484
+ setOptions([]);
7485
+ } finally {
7486
+ setLoading(false);
7487
+ }
7488
+ }
7489
+ };
7367
7490
  return /*#__PURE__*/React.createElement("div", {
7368
7491
  style: {
7369
7492
  position: 'relative'
@@ -7396,6 +7519,7 @@ const DebounceSelect = ({
7396
7519
  placeholder: placeholder,
7397
7520
  onFocus: () => setOpen(true),
7398
7521
  onBlur: () => setTimeout(() => setOpen(false), 200),
7522
+ onDoubleClick: handleDoubleClick,
7399
7523
  disabled: disabled,
7400
7524
  style: style
7401
7525
  }), (input || !isMulti && selectedItems.length > 0) && !disabled && /*#__PURE__*/React.createElement("button", {
@@ -7426,28 +7550,32 @@ const DebounceSelect = ({
7426
7550
  className: "basic-input-dropdown-menu"
7427
7551
  }, loading ? /*#__PURE__*/React.createElement("div", {
7428
7552
  className: "loading-dropdown-item"
7429
- }, "Loading...") : options?.length > 0 ? options.map(({
7553
+ }, "Loading...") : options?.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map(({
7430
7554
  label,
7431
7555
  value
7432
7556
  }) => /*#__PURE__*/React.createElement("div", {
7433
7557
  key: value,
7434
7558
  className: "basic-input-dropdown-item",
7435
7559
  onMouseDown: () => handleSelect(value, label)
7436
- }, label)) : /*#__PURE__*/React.createElement("div", {
7560
+ }, label)), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React.createElement("div", {
7561
+ className: "basic-input-dropdown-item",
7562
+ style: {
7563
+ color: '#1677ff',
7564
+ fontWeight: 500
7565
+ },
7566
+ onMouseDown: handleAddNew
7567
+ }, "+ Add \"", input.trim(), "\"")) : input.trim() && !loading && typeof addItem === 'function' ? /*#__PURE__*/React.createElement("div", {
7568
+ className: "basic-input-dropdown-item",
7569
+ style: {
7570
+ color: '#1677ff',
7571
+ fontWeight: 500
7572
+ },
7573
+ onMouseDown: handleAddNew
7574
+ }, "+ Add \"", input.trim(), "\"") : /*#__PURE__*/React.createElement("div", {
7437
7575
  className: "no-results-dropdown-item"
7438
7576
  }, "No results")));
7439
7577
  };
7440
7578
 
7441
- function _extends() {
7442
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
7443
- for (var e = 1; e < arguments.length; e++) {
7444
- var t = arguments[e];
7445
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7446
- }
7447
- return n;
7448
- }, _extends.apply(null, arguments);
7449
- }
7450
-
7451
7579
  function SearchInput({
7452
7580
  pushUrlParamObj = null,
7453
7581
  ...props
@@ -7496,7 +7624,7 @@ function SearchInput({
7496
7624
  height: "34px",
7497
7625
  verticalAlign: "middle"
7498
7626
  }
7499
- }, /*#__PURE__*/React.createElement("input", _extends({
7627
+ }, /*#__PURE__*/React.createElement("input", _extends$1({
7500
7628
  className: "basic-input",
7501
7629
  value: value,
7502
7630
  style: {
@@ -9015,7 +9143,7 @@ function DateTimeInput({
9015
9143
  window.addEventListener('mousedown', onClick);
9016
9144
  return () => window.removeEventListener('mousedown', onClick);
9017
9145
  }, [open]);
9018
- return /*#__PURE__*/React.createElement("div", _extends({
9146
+ return /*#__PURE__*/React.createElement("div", _extends$1({
9019
9147
  className: `datetime-input-wrapper ${className}`,
9020
9148
  style: {
9021
9149
  position: 'relative',