pge-front-common 14.1.40 → 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.
- package/lib/components/BasicSelect/index.d.ts +1 -1
- package/lib/components/BasicSelect/index.types.d.ts +1 -0
- package/lib/components/Select/index.d.ts +1 -1
- package/lib/components/Select/index.types.d.ts +1 -0
- package/lib/index.d.ts +4 -2
- package/lib/index.esm.js +6 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { SelectDefaultProps } from "./index.types";
|
|
3
|
-
export declare const BasicSelect: ({ name, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, }: SelectDefaultProps) => React.JSX.Element;
|
|
3
|
+
export declare const BasicSelect: ({ name, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, isClearable, }: SelectDefaultProps) => React.JSX.Element;
|
|
@@ -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
|
@@ -562,13 +562,14 @@ interface SelectDefaultProps$1 {
|
|
|
562
562
|
isRequired?: boolean;
|
|
563
563
|
inputRef?: unknown;
|
|
564
564
|
hasError?: boolean;
|
|
565
|
+
isClearable?: boolean;
|
|
565
566
|
}
|
|
566
567
|
type OptionsProps$1 = {
|
|
567
568
|
label: string;
|
|
568
569
|
value: string;
|
|
569
570
|
};
|
|
570
571
|
|
|
571
|
-
declare const BasicSelect: ({ name, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, }: SelectDefaultProps$1) => React$1.JSX.Element;
|
|
572
|
+
declare const BasicSelect: ({ name, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, isClearable, }: SelectDefaultProps$1) => React$1.JSX.Element;
|
|
572
573
|
|
|
573
574
|
interface Props$1 {
|
|
574
575
|
isOpen: boolean;
|
|
@@ -702,6 +703,7 @@ interface SelectDefaultProps {
|
|
|
702
703
|
formatOptionLabel?: ((data: any, formatOptionLabelMeta: FormatOptionLabelMeta<any>) => React.ReactNode) | undefined;
|
|
703
704
|
isClearable?: boolean;
|
|
704
705
|
maxMenuHeight?: number;
|
|
706
|
+
noOptionsMessage?: string;
|
|
705
707
|
}
|
|
706
708
|
type OptionsProps = {
|
|
707
709
|
label: string;
|
|
@@ -709,7 +711,7 @@ type OptionsProps = {
|
|
|
709
711
|
isDisabled?: boolean;
|
|
710
712
|
};
|
|
711
713
|
|
|
712
|
-
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;
|
|
713
715
|
|
|
714
716
|
interface ModalProps$1 {
|
|
715
717
|
isModalOpen: boolean;
|
package/lib/index.esm.js
CHANGED
|
@@ -8729,7 +8729,7 @@ var selectColourStyles$1 = function (isInvalid, isDarkMode, isMobile) { return (
|
|
|
8729
8729
|
menuList: function (base) { return (__assign(__assign({}, base), { backgroundColor: isDarkMode ? "#4B4B4C" : "#fff", padding: "0.5rem 0", borderRadius: "8px" })); },
|
|
8730
8730
|
}); };
|
|
8731
8731
|
var BasicSelect = function (_a) {
|
|
8732
|
-
var name = _a.name, 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;
|
|
8732
|
+
var name = _a.name, 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, _d = _a.isClearable, isClearable = _d === void 0 ? true : _d;
|
|
8733
8733
|
var isDarkMode = useDarkMode();
|
|
8734
8734
|
useIsMobile();
|
|
8735
8735
|
var CustomDropdownIndicator = function () { return (React.createElement("div", { className: styles$l.contentIcon },
|
|
@@ -8739,7 +8739,7 @@ var BasicSelect = function (_a) {
|
|
|
8739
8739
|
label,
|
|
8740
8740
|
isRequired ? React.createElement("span", { className: styles$l.errorRequired }, "*") : null)),
|
|
8741
8741
|
React.createElement("div", { className: styles$l.selectElement },
|
|
8742
|
-
React.createElement(StateManagedSelect$1, { inputId: name, isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange, placeholder: placeholder, styles: selectColourStyles$1(hasError, isDarkMode), isSearchable: true, isClearable:
|
|
8742
|
+
React.createElement(StateManagedSelect$1, { inputId: name, isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange, placeholder: placeholder, styles: selectColourStyles$1(hasError, isDarkMode), isSearchable: true, isClearable: isClearable, noOptionsMessage: function () { return "Nenhuma opção disponível"; }, components: {
|
|
8743
8743
|
DropdownIndicator: CustomDropdownIndicator,
|
|
8744
8744
|
ClearIndicator: CustomClearIndicator,
|
|
8745
8745
|
}, "aria-label": typeof label === "string"
|
|
@@ -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
|
|
21773
|
-
var
|
|
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
|
|