@7shifts/sous-chef 3.69.0 → 3.70.0

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.
@@ -10162,27 +10162,6 @@ const useSelectFieldControllers = ({
10162
10162
  return controllers;
10163
10163
  };
10164
10164
 
10165
- /**
10166
- * This helper method helps to check if the user is scrolling inside the select options so,
10167
- * it does not close the menu when using the prop menuShouldScrollIntoView
10168
- **/
10169
- const isScrollingTheSelectMenu = element => {
10170
- if (!isReactSelectElement(element)) {
10171
- var _element$children;
10172
- // Checking in case it is a grouped options
10173
- return isReactSelectElement(element == null || (_element$children = element.children) == null ? void 0 : _element$children[0]);
10174
- }
10175
- return true;
10176
- };
10177
- const isReactSelectElement = element => {
10178
- var _element$children2;
10179
- const firstOption = element == null || (_element$children2 = element.children) == null ? void 0 : _element$children2[0];
10180
- if (!firstOption) {
10181
- return false;
10182
- }
10183
- return typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
10184
- };
10185
-
10186
10165
  var styles$v = {"custom-control":"_pXQqq"};
10187
10166
 
10188
10167
  const _excluded$d = ["children"];
@@ -10219,6 +10198,9 @@ function CustomOption(_ref) {
10219
10198
  const {
10220
10199
  UserCustomOption
10221
10200
  } = props.selectProps.componentsProps;
10201
+ if (!UserCustomOption) {
10202
+ return null;
10203
+ }
10222
10204
  return React__default.createElement(components.Option, _extends({}, props), React__default.createElement(UserCustomOption, _extends({}, props), children));
10223
10205
  }
10224
10206
 
@@ -10400,7 +10382,7 @@ function CustomMenu(_ref) {
10400
10382
  });
10401
10383
  };
10402
10384
  const onCreateButton = () => {
10403
- if (textFieldRef.current && textFieldRef.current.value.trim() !== '') {
10385
+ if (textFieldRef.current && textFieldRef.current.value.trim() !== '' && onCreate) {
10404
10386
  onCreate(textFieldRef.current.value);
10405
10387
  textFieldRef.current.value = '';
10406
10388
  setShowFooter(false);
@@ -10501,13 +10483,6 @@ const useSelectField = _ref => {
10501
10483
  dataProps
10502
10484
  } = getDataProps(rest);
10503
10485
  const selectProps = {
10504
- closeMenuOnScroll: e => {
10505
- if (!e.target) {
10506
- return false;
10507
- }
10508
- return !isScrollingTheSelectMenu(e.target);
10509
- },
10510
- // Used to pass props to the custom components inside `components`
10511
10486
  componentsProps: {
10512
10487
  testId,
10513
10488
  UserCustomOption,
@@ -11751,6 +11726,7 @@ const MultiSelectField = ({
11751
11726
  onBlur: controllers.onBlur,
11752
11727
  isMulti: true,
11753
11728
  closeMenuOnSelect: _closeOnSelect,
11729
+ // @ts-expect-error Used to pass props to the custom components inside `components`
11754
11730
  componentsProps: {
11755
11731
  testId,
11756
11732
  UserCustomOption,
@@ -11766,12 +11742,6 @@ const MultiSelectField = ({
11766
11742
  menuShouldScrollIntoView: _menuShouldScrollIntoView,
11767
11743
  menuPlacement: _menuShouldScrollIntoView ? 'bottom' : 'auto',
11768
11744
  menuPosition: _menuShouldScrollIntoView ? 'absolute' : 'fixed',
11769
- closeMenuOnScroll: e => {
11770
- if (!e.target) {
11771
- return false;
11772
- }
11773
- return !isScrollingTheSelectMenu(e.target);
11774
- },
11775
11745
  isSearchable: _isSearchable,
11776
11746
  menuIsOpen: isMenuInputFocus || undefined,
11777
11747
  isClearable: _isClearable
@@ -11835,7 +11805,7 @@ const AsyncSelectField = _ref => {
11835
11805
  options
11836
11806
  }) => {
11837
11807
  var _ref$current;
11838
- if (ref.current && inputValue !== (ref == null || (_ref$current = ref.current) == null ? void 0 : _ref$current['state']['inputValue'])) {
11808
+ if (ref.current && inputValue !== (ref == null || (_ref$current = ref.current) == null ? void 0 : _ref$current['inputRef']['value'])) {
11839
11809
  return;
11840
11810
  }
11841
11811
  if (!hasFirstLoadPerformed) {