pge-front-common 14.1.21 → 14.1.23
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 }: SelectDefaultProps) => React.JSX.Element;
|
|
3
|
+
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, }: SelectDefaultProps) => React.JSX.Element;
|
|
4
4
|
export default SelectDefault;
|
|
@@ -15,6 +15,7 @@ export interface SelectDefaultProps {
|
|
|
15
15
|
hasError?: boolean;
|
|
16
16
|
control?: Control<any>;
|
|
17
17
|
formatOptionLabel?: ((data: any, formatOptionLabelMeta: FormatOptionLabelMeta<any>) => React.ReactNode) | undefined;
|
|
18
|
+
isClearable?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export type OptionsProps = {
|
|
20
21
|
label: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -690,6 +690,7 @@ interface SelectDefaultProps {
|
|
|
690
690
|
hasError?: boolean;
|
|
691
691
|
control?: Control<any>;
|
|
692
692
|
formatOptionLabel?: ((data: any, formatOptionLabelMeta: FormatOptionLabelMeta<any>) => React.ReactNode) | undefined;
|
|
693
|
+
isClearable?: boolean;
|
|
693
694
|
}
|
|
694
695
|
type OptionsProps = {
|
|
695
696
|
label: string;
|
|
@@ -697,7 +698,7 @@ type OptionsProps = {
|
|
|
697
698
|
isDisabled?: boolean;
|
|
698
699
|
};
|
|
699
700
|
|
|
700
|
-
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel }: SelectDefaultProps) => React$1.JSX.Element;
|
|
701
|
+
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, formatOptionLabel, isClearable, }: SelectDefaultProps) => React$1.JSX.Element;
|
|
701
702
|
|
|
702
703
|
interface ModalProps$1 {
|
|
703
704
|
isModalOpen: boolean;
|
package/lib/index.esm.js
CHANGED
|
@@ -845,7 +845,7 @@ var css_248z$u = ".header-module__separator_background___lYfCd {\r\n background
|
|
|
845
845
|
var styles$q = {"separator_background":"header-module__separator_background___lYfCd","container":"header-module__container___eaqPg","wrapperMenu":"header-module__wrapperMenu___m5rLa","iconLogo":"header-module__iconLogo___pcEoN","verticalDivider":"header-module__verticalDivider___4JMWc","containerHeaderIndex":"header-module__containerHeaderIndex___ueqa-","set_shadow":"header-module__set_shadow___UUN7Y","limitedWidth":"header-module__limitedWidth___fsCel","iconLogoCASC":"header-module__iconLogoCASC___3YUG6","iconLogoPGE":"header-module__iconLogoPGE___HK3gX","responsiveCASC":"header-module__responsiveCASC___KL8jM","limitedWidthBeneficios":"header-module__limitedWidthBeneficios___-Jcji","IconMenu":"header-module__IconMenu___7JWj-","wrapperUserButton":"header-module__wrapperUserButton___M-CBj"};
|
|
846
846
|
styleInject(css_248z$u);
|
|
847
847
|
|
|
848
|
-
var css_248z$t = ".dropdown-module__dropdown___EIaq- {\r\n position: absolute;\r\n border: 1px solid rgb(197, 197, 197);\r\n background: var(--header-bg-dropdown);\r\n padding: 8px 0;\r\n color: #0062cc;\r\n border-radius: 4px;\r\n z-index: 400;\r\n min-width:
|
|
848
|
+
var css_248z$t = ".dropdown-module__dropdown___EIaq- {\r\n position: absolute;\r\n border: 1px solid rgb(197, 197, 197);\r\n background: var(--header-bg-dropdown);\r\n padding: 8px 0;\r\n color: #0062cc;\r\n border-radius: 4px;\r\n z-index: 400;\r\n min-width: 306px;\r\n box-shadow: rgba(197, 164, 164, 0.35) 0px 5px 15px;\r\n cursor: pointer;\r\n margin-right: 5px;\r\n}\r\n\r\n.dropdown-module__primaryDropdown___I7kas {\r\n margin: 0;\r\n padding: 0.375rem 0.88rem 0.88rem 0.88rem;\r\n min-width: 304px;\r\n color: var(--header-font-dropdown);\r\n font-size: var(--font-size-16, 16px);\r\n font-weight: 600;\r\n text-align: left;\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n cursor: pointer;\r\n min-height: 56px;\r\n border: none;\r\n white-space: pre-wrap;\r\n\r\n -webkit-appearance: button;\r\n background-color: transparent;\r\n background-image: none;\r\n}\r\n\r\n@media (max-width: 480px) {\r\n .dropdown-module__primaryDropdown___I7kas {\r\n font-size: var(--font-size-14, 14);\r\n }\r\n}\r\n\r\n.dropdown-module__primaryDropdown___I7kas:hover {\r\n background-color: var(--header-hover-dropdown);\r\n width: 100%;\r\n}\r\n\r\n.dropdown-module__primaryDropdown__disabled___McFgs {\r\n color: #c3c3c3;\r\n}\r\n\r\n.dropdown-module__primaryDropdown__home___4Odwr {\r\n font-weight: 700;\r\n}\r\n\r\n.dropdown-module__primaryDropdown__submenu___eXCiN {\r\n font-size: var(--font-size-16, 16px);\r\n line-height: 24px;\r\n text-align: left;\r\n padding-left: 30px;\r\n font-weight: 400;\r\n}\r\n\r\n.dropdown-module__contentIcon___aqI89 {\r\n transition: transform 0.3s ease;\r\n display: flex;\r\n}\r\n\r\n.dropdown-module__colorIcon___7UTK3 {\r\n color: var(--header-menu-seta-color);\r\n}\r\n\r\n.dropdown-module__contentIcon___aqI89.dropdown-module__active___RRrmk {\r\n transform: rotate(0deg);\r\n}\r\n\r\n.dropdown-module__contentIcon___aqI89.dropdown-module__inactive___AQdLm {\r\n transform: rotate(180deg);\r\n}\r\n";
|
|
849
849
|
var styles$p = {"dropdown":"dropdown-module__dropdown___EIaq-","primaryDropdown":"dropdown-module__primaryDropdown___I7kas","primaryDropdown__disabled":"dropdown-module__primaryDropdown__disabled___McFgs","primaryDropdown__home":"dropdown-module__primaryDropdown__home___4Odwr","primaryDropdown__submenu":"dropdown-module__primaryDropdown__submenu___eXCiN","contentIcon":"dropdown-module__contentIcon___aqI89","colorIcon":"dropdown-module__colorIcon___7UTK3","active":"dropdown-module__active___RRrmk","inactive":"dropdown-module__inactive___AQdLm"};
|
|
850
850
|
styleInject(css_248z$t);
|
|
851
851
|
|
|
@@ -21666,9 +21666,9 @@ var selectColourStyles = function (isInvalid, isMobile) { return ({
|
|
|
21666
21666
|
},
|
|
21667
21667
|
}); };
|
|
21668
21668
|
var SelectDefault = function (_a) {
|
|
21669
|
-
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;
|
|
21670
|
-
var
|
|
21671
|
-
var
|
|
21669
|
+
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;
|
|
21670
|
+
var _e = useController({ name: name, control: control }), _f = _e.field; _f.onChange; _f.value; var rest = __rest(_f, ["onChange", "value"]), error = _e.fieldState.error;
|
|
21671
|
+
var _g = React.useState(typeof window !== "undefined" && window.innerWidth <= 768), isMobile = _g[0], setIsMobile = _g[1];
|
|
21672
21672
|
var CustomDropdownIndicator = function () {
|
|
21673
21673
|
return (React.createElement("div", { className: styles$7.contentIcon },
|
|
21674
21674
|
React.createElement(IconTriangleRecall, { className: styles$7.iconChefron })));
|
|
@@ -21690,7 +21690,7 @@ var SelectDefault = function (_a) {
|
|
|
21690
21690
|
if (inputValue) {
|
|
21691
21691
|
handleInputChange === null || handleInputChange === void 0 ? void 0 : handleInputChange(inputValue);
|
|
21692
21692
|
}
|
|
21693
|
-
}, placeholder: placeholder, styles: selectColourStyles(hasError || !!error, isMobile), isClearable:
|
|
21693
|
+
}, placeholder: placeholder, styles: selectColourStyles(hasError || !!error, isMobile), 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))),
|
|
21694
21694
|
error && React.createElement("span", { className: styles$7.errorText }, error.message)));
|
|
21695
21695
|
};
|
|
21696
21696
|
|