componenteshospitais 2.0.5 → 2.0.6
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/dist/cjs/index.js +17 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +17 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/InputField.d.ts +3 -3
- package/dist/types/components/TextArea.d.ts +19 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/InputField.tsx +7 -22
- package/src/components/TextArea.tsx +68 -0
- package/src/index.tsx +2 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1504,7 +1504,7 @@ var InputField = function (_a) {
|
|
|
1504
1504
|
if (type === 'number' && e.target.value.length > appliedMaxLength) {
|
|
1505
1505
|
e.target.value = e.target.value.slice(0, appliedMaxLength);
|
|
1506
1506
|
}
|
|
1507
|
-
if (onChange) {
|
|
1507
|
+
if (onChange) { // Verificando se onChange foi passado antes de chamá-lo
|
|
1508
1508
|
onChange(e);
|
|
1509
1509
|
}
|
|
1510
1510
|
};
|
|
@@ -1517,9 +1517,7 @@ var InputField = function (_a) {
|
|
|
1517
1517
|
return (React$2.createElement(React$2.Fragment, null,
|
|
1518
1518
|
label && React$2.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
|
|
1519
1519
|
React$2.createElement("div", { className: styles$5.inputWrapper },
|
|
1520
|
-
maskType && type
|
|
1521
|
-
React$2.createElement(reactInputMask, { mask: mask, value: value, onChange: handleChange, disabled: disabled }, function (inputProps) { return (React$2.createElement("input", __assign({}, inputProps, { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, placeholder: placeholder, className: styles$5.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')) }, readOnly: readonly, required: required, checked: checked, onKeyPress: onKeyPress, onBlur: onBlur }))); })) : type === 'textarea' ? ( // Condição para renderizar textarea
|
|
1522
|
-
React$2.createElement("textarea", { id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')), resize: 'none', height: '6rem' }, readOnly: readonly, disabled: disabled, required: required, onKeyPress: onKeyPress, onBlur: onBlur })) : (React$2.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')) }, readOnly: readonly, disabled: disabled, required: required, checked: checked, maxLength: type === 'text' ? appliedMaxLength : undefined, onKeyPress: onKeyPress, onBlur: onBlur })),
|
|
1520
|
+
maskType ? (React$2.createElement(reactInputMask, { mask: mask, value: value, onChange: handleChange, disabled: disabled }, function (inputProps) { return (React$2.createElement("input", __assign({}, inputProps, { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, placeholder: placeholder, className: styles$5.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')) }, readOnly: readonly, required: required, checked: checked, onKeyPress: onKeyPress, onBlur: onBlur }))); })) : (React$2.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')) }, readOnly: readonly, disabled: disabled, required: required, checked: checked, maxLength: type === 'text' ? appliedMaxLength : undefined, onKeyPress: onKeyPress, onBlur: onBlur })),
|
|
1523
1521
|
type === 'password' && (React$2.createElement("div", { className: styles$5.passwordToggleIcon, onClick: togglePasswordVisibility }, isPasswordVisible ? React$2.createElement(FaEyeSlash, null) : React$2.createElement(FaEye, null))))));
|
|
1524
1522
|
};
|
|
1525
1523
|
|
|
@@ -17625,6 +17623,20 @@ var TableStandard = function (_a) {
|
|
|
17625
17623
|
React$2.createElement("div", { className: "".concat(empresaClass, " ").concat(styles.pagination) }, pageNumbers.map(function (number) { return (React$2.createElement("button", { key: number, onClick: function () { return setCurrentPage(number); }, className: "".concat(styles.pageButton, " ").concat(currentPage === number ? styles.activePage : '') }, number)); }))));
|
|
17626
17624
|
};
|
|
17627
17625
|
|
|
17626
|
+
var TextAreaField = function (_a) {
|
|
17627
|
+
var id = _a.id, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, maxLength = _a.maxLength, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel;
|
|
17628
|
+
var appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
|
|
17629
|
+
return (React$2.createElement(React$2.Fragment, null,
|
|
17630
|
+
label && React$2.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
|
|
17631
|
+
React$2.createElement("div", { className: styles$5.inputWrapper },
|
|
17632
|
+
React$2.createElement("textarea", { id: id, name: id, value: value, placeholder: placeholder, onChange: onChange, className: styles$5.inputPadrao, style: {
|
|
17633
|
+
width: largura ? "".concat(largura) : '',
|
|
17634
|
+
backgroundColor: disabled ? '#e5e5e5' : (corFundo ? corFundo : ''),
|
|
17635
|
+
resize: 'none',
|
|
17636
|
+
height: '6rem'
|
|
17637
|
+
}, readOnly: readonly, disabled: disabled, required: required, maxLength: appliedMaxLength, onKeyPress: onKeyPress, onBlur: onBlur }))));
|
|
17638
|
+
};
|
|
17639
|
+
|
|
17628
17640
|
exports.Busca = Busca;
|
|
17629
17641
|
exports.Button = Button;
|
|
17630
17642
|
exports.Card = Card;
|
|
@@ -17634,6 +17646,7 @@ exports.InputField = InputField;
|
|
|
17634
17646
|
exports.MenuPage = MenuPage;
|
|
17635
17647
|
exports.SelectField = SelectField;
|
|
17636
17648
|
exports.TableStandard = TableStandard;
|
|
17649
|
+
exports.TextArea = TextAreaField;
|
|
17637
17650
|
exports.TextPage = TextPage;
|
|
17638
17651
|
exports.TituloPagina = TituloPagina;
|
|
17639
17652
|
//# sourceMappingURL=index.js.map
|