@7shifts/sous-chef 3.8.0 → 3.9.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.
@@ -22,7 +22,9 @@ declare type Props<T> = {
22
22
  /** When the user opens the menu, if this prop is `true`, it will scroll the page into to the menu view (if its content falls under a scroll). It is recomended to disable this behaviour when using the `MultiSelectField` inside a modal. */
23
23
  menuShouldScrollIntoView?: boolean;
24
24
  testId?: string;
25
+ /** This is to allow disable the seach functionality. Use it just in some edge-cases, for example in touch devices when the user clicks on the field it opens a virtual keyboard to search, sometimes that virtual keyboard taks much space then passing `isSearchable={false}` prevents opening it. */
26
+ isSearchable?: boolean;
25
27
  };
26
28
  /** Component to make possible choose from a predefined options. */
27
- declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView, testId }: Props<T>) => JSX.Element;
29
+ 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 }: Props<T>) => JSX.Element;
28
30
  export default MultiSelectField;
@@ -30,6 +30,8 @@ export declare type Props<T> = {
30
30
  testId?: string;
31
31
  creatableButton?: React.ReactNode;
32
32
  onCreate?: (option: string) => void;
33
+ /** This is to allow disable the seach functionality. Use it just in some edge-cases, for example in touch devices when the user clicks on the field it opens a virtual keyboard to search, sometimes that virtual keyboard taks much space then passing `isSearchable={false}` prevents opening it. */
34
+ isSearchable?: boolean;
33
35
  };
34
36
  /** Component to make possible choose from a predefined options. */
35
37
  declare const SelectField: <T extends unknown>(props: Props<T>) => JSX.Element;
@@ -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 }: Props<T>) => {
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>) => {
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;
package/dist/index.css CHANGED
@@ -840,7 +840,10 @@ Just for future references:
840
840
  position: relative;
841
841
  border-bottom: 1px solid var(--color-grey-200);
842
842
  padding: 16px;
843
- word-break: break-all;
843
+ word-break: break-word;
844
+ -webkit-hyphens: auto;
845
+ -ms-hyphens: auto;
846
+ hyphens: auto;
844
847
  }
845
848
  ._2Ybjx:first-of-type {
846
849
  border-left: 1px solid var(--color-grey-200);
package/dist/index.js CHANGED
@@ -7401,7 +7401,9 @@ var MultiSelectField = function MultiSelectField(_ref) {
7401
7401
  closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
7402
7402
  _ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
7403
7403
  menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll,
7404
- testId = _ref.testId;
7404
+ testId = _ref.testId,
7405
+ _ref$isSearchable = _ref.isSearchable,
7406
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable;
7405
7407
  var controllers = useMultiSelectFieldControllers({
7406
7408
  name: name,
7407
7409
  id: inputId,
@@ -7454,7 +7456,8 @@ var MultiSelectField = function MultiSelectField(_ref) {
7454
7456
  }
7455
7457
 
7456
7458
  return !isScrollingTheSelectMenu(e.target);
7457
- }
7459
+ },
7460
+ isSearchable: isSearchable
7458
7461
  }));
7459
7462
  };
7460
7463
 
@@ -7615,7 +7618,9 @@ var useSelectField = function useSelectField(_ref) {
7615
7618
  SelectedOptionPrefix = _ref.SelectedOptionPrefix,
7616
7619
  testId = _ref.testId,
7617
7620
  creatableButton = _ref.creatableButton,
7618
- onCreate = _ref.onCreate;
7621
+ onCreate = _ref.onCreate,
7622
+ _ref$isSearchable = _ref.isSearchable,
7623
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable;
7619
7624
 
7620
7625
  var _useState = React.useState(false),
7621
7626
  isMenuInputFocus = _useState[0],
@@ -7678,7 +7683,8 @@ var useSelectField = function useSelectField(_ref) {
7678
7683
  }),
7679
7684
  value: controllers.value,
7680
7685
  defaultValue: defaultValue,
7681
- menuIsOpen: isMenuInputFocus || undefined
7686
+ menuIsOpen: isMenuInputFocus || undefined,
7687
+ isSearchable: isSearchable
7682
7688
  };
7683
7689
  var fieldProps = {
7684
7690
  caption: caption,