@7shifts/sous-chef 3.28.0 → 3.28.1

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.
@@ -28,5 +28,5 @@ declare type Props<T> = {
28
28
  onCreate?: (option: string) => void;
29
29
  };
30
30
  /** Component to make possible choose from a predefined options. */
31
- declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView, testId, isSearchable, creatableButton, onCreate }: Props<T>) => JSX.Element;
31
+ declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, testId, isSearchable, creatableButton, onCreate }: Props<T>) => JSX.Element;
32
32
  export default MultiSelectField;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { Props } from './SelectField';
3
- export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable }: Props<T>) => {
3
+ export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable }: Props<T>) => {
4
4
  selectProps: Pick<import("react-select").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>>, import("react").ReactText> & import("react-select/src/stateManager").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>> & import("react-select").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>>;
5
5
  fieldProps: {
6
6
  caption: import("react").ReactNode;
@@ -0,0 +1 @@
1
+ export declare const useShouldScrollMenuIntoView: (menuShouldScrollIntoView?: boolean | undefined) => boolean;
package/dist/index.css CHANGED
@@ -1687,6 +1687,7 @@ h5._3CIA3 {
1687
1687
  -webkit-hyphens: auto;
1688
1688
  -ms-hyphens: auto;
1689
1689
  hyphens: auto;
1690
+ background: none;
1690
1691
  }
1691
1692
  ._SpJZY:first-of-type {
1692
1693
  border-left: 1px solid var(--color-grey-200);
package/dist/index.js CHANGED
@@ -8058,6 +8058,21 @@ function CustomMenu(_ref) {
8058
8058
  }, getLocalizedString('default.CREATE'))))));
8059
8059
  }
8060
8060
 
8061
+ var useShouldScrollMenuIntoView = function useShouldScrollMenuIntoView(menuShouldScrollIntoView) {
8062
+ var _useModalContext = useModalContext(),
8063
+ isModalMounted = _useModalContext.isModalMounted;
8064
+
8065
+ if (menuShouldScrollIntoView !== undefined) {
8066
+ return menuShouldScrollIntoView;
8067
+ }
8068
+
8069
+ if (isModalMounted) {
8070
+ return false;
8071
+ }
8072
+
8073
+ return true;
8074
+ };
8075
+
8061
8076
  var useSelectField = function useSelectField(_ref) {
8062
8077
  var _ref$asToolbarFilter = _ref.asToolbarFilter,
8063
8078
  asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
@@ -8068,8 +8083,7 @@ var useSelectField = function useSelectField(_ref) {
8068
8083
  _ref$isClearable = _ref.isClearable,
8069
8084
  isClearable = _ref$isClearable === void 0 ? false : _ref$isClearable,
8070
8085
  label = _ref.label,
8071
- _ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
8072
- menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll,
8086
+ menuShouldScrollIntoViewProp = _ref.menuShouldScrollIntoView,
8073
8087
  name = _ref.name,
8074
8088
  noOptionsMessage = _ref.noOptionsMessage,
8075
8089
  options = _ref.options,
@@ -8085,6 +8099,7 @@ var useSelectField = function useSelectField(_ref) {
8085
8099
  onCreate = _ref.onCreate,
8086
8100
  _ref$isSearchable = _ref.isSearchable,
8087
8101
  isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable;
8102
+ var menuShouldScrollIntoView = useShouldScrollMenuIntoView(menuShouldScrollIntoViewProp);
8088
8103
 
8089
8104
  var _useState = React.useState(false),
8090
8105
  isMenuInputFocus = _useState[0],
@@ -9263,13 +9278,13 @@ var MultiSelectField = function MultiSelectField(_ref) {
9263
9278
  disabled = _ref.disabled,
9264
9279
  _ref$closeOnSelect = _ref.closeOnSelect,
9265
9280
  closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
9266
- _ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
9267
- menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll,
9281
+ menuShouldScrollIntoViewProp = _ref.menuShouldScrollIntoView,
9268
9282
  testId = _ref.testId,
9269
9283
  _ref$isSearchable = _ref.isSearchable,
9270
9284
  isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
9271
9285
  creatableButton = _ref.creatableButton,
9272
9286
  onCreate = _ref.onCreate;
9287
+ var menuShouldScrollIntoView = useShouldScrollMenuIntoView(menuShouldScrollIntoViewProp);
9273
9288
 
9274
9289
  var _useState = React.useState(false),
9275
9290
  isMenuInputFocus = _useState[0],
@@ -10209,7 +10224,7 @@ var getDateWithStartTime = function getDateWithStartTime(startTime) {
10209
10224
  return baseDate;
10210
10225
  }
10211
10226
 
10212
- var _parseTime$split = parseTime(startTime, 'g:i').split(':'),
10227
+ var _parseTime$split = parseTime(startTime, 'H:i').split(':'),
10213
10228
  hours = _parseTime$split[0],
10214
10229
  minutes = _parseTime$split[1];
10215
10230