pge-front-common 14.1.41 → 14.1.42

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.
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  import { SelectDefaultProps } from "./index.types";
3
- declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, maxMenuHeight, }: SelectDefaultProps) => React.JSX.Element;
3
+ declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, maxMenuHeight, noOptionsMessage, }: SelectDefaultProps) => React.JSX.Element;
4
4
  export default SelectDefault;
@@ -17,6 +17,7 @@ export interface SelectDefaultProps {
17
17
  formatOptionLabel?: ((data: any, formatOptionLabelMeta: FormatOptionLabelMeta<any>) => React.ReactNode) | undefined;
18
18
  isClearable?: boolean;
19
19
  maxMenuHeight?: number;
20
+ noOptionsMessage?: string;
20
21
  }
21
22
  export type OptionsProps = {
22
23
  label: string;
package/lib/index.d.ts CHANGED
@@ -703,6 +703,7 @@ interface SelectDefaultProps {
703
703
  formatOptionLabel?: ((data: any, formatOptionLabelMeta: FormatOptionLabelMeta<any>) => React.ReactNode) | undefined;
704
704
  isClearable?: boolean;
705
705
  maxMenuHeight?: number;
706
+ noOptionsMessage?: string;
706
707
  }
707
708
  type OptionsProps = {
708
709
  label: string;
@@ -710,7 +711,7 @@ type OptionsProps = {
710
711
  isDisabled?: boolean;
711
712
  };
712
713
 
713
- declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, maxMenuHeight, }: SelectDefaultProps) => React$1.JSX.Element;
714
+ declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, maxMenuHeight, noOptionsMessage, }: SelectDefaultProps) => React$1.JSX.Element;
714
715
 
715
716
  interface ModalProps$1 {
716
717
  isModalOpen: boolean;
package/lib/index.esm.js CHANGED
@@ -21768,9 +21768,9 @@ var selectColourStyles = function (isInvalid, isMobile, maxMenuHeight) { return
21768
21768
  menuList: function (styles) { return (__assign(__assign({}, styles), { maxHeight: maxMenuHeight ? "".concat(maxMenuHeight, "px") : "300px" })); },
21769
21769
  }); };
21770
21770
  var SelectDefault = function (_a) {
21771
- var name = _a.name, control = _a.control, optionsSelect = _a.optionsSelect, placeholder = _a.placeholder, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.hasError, hasError = _c === void 0 ? false : _c, handleChange = _a.handleChange, isRequired = _a.isRequired, value = _a.value, handleInputChange = _a.handleInputChange, formatOptionLabel = _a.formatOptionLabel, _d = _a.isClearable, isClearable = _d === void 0 ? true : _d, maxMenuHeight = _a.maxMenuHeight;
21772
- var _e = useController({ name: name, control: control }), _f = _e.field; _f.onChange; _f.value; var rest = __rest(_f, ["onChange", "value"]), error = _e.fieldState.error;
21773
- var _g = React.useState(typeof window !== "undefined" && window.innerWidth <= 768), isMobile = _g[0], setIsMobile = _g[1];
21771
+ var name = _a.name, control = _a.control, optionsSelect = _a.optionsSelect, placeholder = _a.placeholder, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.hasError, hasError = _c === void 0 ? false : _c, handleChange = _a.handleChange, isRequired = _a.isRequired, value = _a.value, handleInputChange = _a.handleInputChange, formatOptionLabel = _a.formatOptionLabel, _d = _a.isClearable, isClearable = _d === void 0 ? true : _d, maxMenuHeight = _a.maxMenuHeight, _e = _a.noOptionsMessage, noOptionsMessage = _e === void 0 ? "Nenhuma opção disponível" : _e;
21772
+ var _f = useController({ name: name, control: control }), _g = _f.field; _g.onChange; _g.value; var rest = __rest(_g, ["onChange", "value"]), error = _f.fieldState.error;
21773
+ var _h = React.useState(typeof window !== "undefined" && window.innerWidth <= 768), isMobile = _h[0], setIsMobile = _h[1];
21774
21774
  var CustomDropdownIndicator = function () {
21775
21775
  return (React.createElement("div", { className: styles$c.contentIcon },
21776
21776
  React.createElement(IconTriangleRecall, { className: styles$c.iconChefron })));
@@ -21792,7 +21792,7 @@ var SelectDefault = function (_a) {
21792
21792
  if (inputValue) {
21793
21793
  handleInputChange === null || handleInputChange === void 0 ? void 0 : handleInputChange(inputValue);
21794
21794
  }
21795
- }, placeholder: placeholder, styles: selectColourStyles(hasError || !!error, isMobile, maxMenuHeight), isClearable: isClearable, isSearchable: true, formatOptionLabel: formatOptionLabel, noOptionsMessage: function () { return "Nenhuma opção disponível"; }, components: { DropdownIndicator: CustomDropdownIndicator }, "aria-label": label || placeholder || "Campo para seleção", inputId: "".concat(name, "-input") }, rest))),
21795
+ }, placeholder: placeholder, styles: selectColourStyles(hasError || !!error, isMobile, maxMenuHeight), isClearable: isClearable, isSearchable: true, formatOptionLabel: formatOptionLabel, noOptionsMessage: function () { return noOptionsMessage || "Nenhuma opção disponível"; }, components: { DropdownIndicator: CustomDropdownIndicator }, "aria-label": label || placeholder || "Campo para seleção", inputId: "".concat(name, "-input") }, rest))),
21796
21796
  error && React.createElement("span", { className: styles$c.errorText }, error.message)));
21797
21797
  };
21798
21798