pge-front-common 14.1.40 → 14.1.41
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,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;
|
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;
|
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"
|