componenteshospitais 1.5.9 → 1.5.10
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 +63 -60
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +63 -60
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/Busca.d.ts +1 -0
- package/dist/types/components/InputField.d.ts +2 -0
- package/dist/types/components/SelectField.d.ts +2 -0
- package/package.json +2 -1
- package/src/components/Busca.tsx +4 -2
- package/src/components/InputField.tsx +6 -2
- package/src/components/SelectField.tsx +5 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1423,7 +1423,7 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1423
1423
|
});
|
|
1424
1424
|
|
|
1425
1425
|
var InputField = function (_a) {
|
|
1426
|
-
var type = _a.type, 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, maskType = _a.maskType, onKeyPress = _a.onKeyPress;
|
|
1426
|
+
var type = _a.type, 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, maskType = _a.maskType, onKeyPress = _a.onKeyPress, corFundo = _a.corFundo, corLabel = _a.corLabel;
|
|
1427
1427
|
var appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
|
|
1428
1428
|
var handleChange = function (e) {
|
|
1429
1429
|
if (type === 'number' && e.target.value.length > appliedMaxLength) {
|
|
@@ -1437,8 +1437,8 @@ var InputField = function (_a) {
|
|
|
1437
1437
|
maskType === 'date' ? '99/99/9999' :
|
|
1438
1438
|
maskType === 'cep' ? '99999-999' : '';
|
|
1439
1439
|
return (React$2.createElement(React$2.Fragment, null,
|
|
1440
|
-
label && React$2.createElement("label", { htmlFor: id }, label),
|
|
1441
|
-
maskType ? (React$2.createElement(reactInputMask, { mask: mask, value: value, onChange: handleChange, disabled: disabled }, function (inputProps) { return (React$2.createElement("input", __assign({}, inputProps, { type: type, id: id, name: id, placeholder: placeholder, className: styles$6.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: disabled ? '#e5e5e5' : '' }, readOnly: readonly, required: required, onKeyPress: onKeyPress }))); })) : (React$2.createElement("input", { type: type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$6.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: disabled ? '#e5e5e5' : '' }, readOnly: readonly, disabled: disabled, required: required, maxLength: type === 'text' ? appliedMaxLength : undefined, onKeyPress: onKeyPress }))));
|
|
1440
|
+
label && React$2.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
|
|
1441
|
+
maskType ? (React$2.createElement(reactInputMask, { mask: mask, value: value, onChange: handleChange, disabled: disabled }, function (inputProps) { return (React$2.createElement("input", __assign({}, inputProps, { type: type, id: id, name: id, placeholder: placeholder, className: styles$6.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')) }, readOnly: readonly, required: required, onKeyPress: onKeyPress }))); })) : (React$2.createElement("input", { type: type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$6.inputPadrao, style: { width: largura ? "".concat(largura) : '', backgroundColor: disabled ? '#e5e5e5' : '' }, readOnly: readonly, disabled: disabled, required: required, maxLength: type === 'text' ? appliedMaxLength : undefined, onKeyPress: onKeyPress }))));
|
|
1442
1442
|
};
|
|
1443
1443
|
|
|
1444
1444
|
var css_248z$5 = ".textPage-module_container__GBEF6{align-items:center;display:flex;flex-direction:column;justify-content:center;padding:20px}.textPage-module_content__CpD68{display:flex;text-align:justify}.textPage-module_imageCabecalho__J6YFH{border-radius:8px}.textPage-module_imageCabecalho__J6YFH img{border-radius:8px;height:100%;object-fit:cover;width:100%}.textPage-module_contentWithLateralImage__-f5pQ{flex-direction:row}.textPage-module_imageLateral__Dy9Kx{align-self:flex-start;height:230px;margin-right:20px;margin-top:15px;width:300px}.textPage-module_imageLateral__Dy9Kx img{border-radius:8px;height:100%;object-fit:cover;width:100%}.textPage-module_text__3pwuU{color:#5d5d5d;flex:2;line-height:1.8;text-align:justify}.textPage-module_text__3pwuU p{line-height:1.6;margin:10px 0}.textPage-module_text__3pwuU .textPage-module_coordenacao__UypV-,.textPage-module_text__3pwuU .textPage-module_direcao__x5psb{font-weight:700;margin-top:20px}";
|
|
@@ -1478,7 +1478,7 @@ var styles$3 = {"selectPadrao":"select-module_selectPadrao__poGiL"};
|
|
|
1478
1478
|
styleInject(css_248z$3);
|
|
1479
1479
|
|
|
1480
1480
|
var SelectField = function (_a) {
|
|
1481
|
-
var id = _a.id, name = _a.name, options = _a.options, value = _a.value, onChange = _a.onChange, label = _a.label, optionDefault = _a.optionDefault, largura = _a.largura, disabled = _a.disabled, multiple = _a.multiple;
|
|
1481
|
+
var id = _a.id, name = _a.name, options = _a.options, value = _a.value, onChange = _a.onChange, label = _a.label, optionDefault = _a.optionDefault, largura = _a.largura, disabled = _a.disabled, multiple = _a.multiple, corFundo = _a.corFundo, corLabel = _a.corLabel;
|
|
1482
1482
|
var handleSelectChange = function (e) {
|
|
1483
1483
|
if (multiple) {
|
|
1484
1484
|
var selectedOptions = Array.from(e.target.selectedOptions, function (option) { return option.value; });
|
|
@@ -1489,8 +1489,8 @@ var SelectField = function (_a) {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
};
|
|
1491
1491
|
return (React$2.createElement(React$2.Fragment, null,
|
|
1492
|
-
label && React$2.createElement("label", { htmlFor: id }, label),
|
|
1493
|
-
React$2.createElement("select", { id: id, name: name, className: styles$3.selectPadrao, value: value, onChange: handleSelectChange, style: { width: largura ? "".concat(largura) : '' }, disabled: disabled, multiple: multiple },
|
|
1492
|
+
label && React$2.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
|
|
1493
|
+
React$2.createElement("select", { id: id, name: name, className: styles$3.selectPadrao, value: value, onChange: handleSelectChange, style: { width: largura ? "".concat(largura) : '', backgroundColor: corFundo ? corFundo : '' }, disabled: disabled, multiple: multiple },
|
|
1494
1494
|
optionDefault && !multiple && (React$2.createElement("option", { value: "" }, "Selecione...")),
|
|
1495
1495
|
options.map(function (option) { return (React$2.createElement("option", { key: option.value, value: option.value }, option.description)); }))));
|
|
1496
1496
|
};
|
|
@@ -1499,60 +1499,6 @@ var css_248z$2 = ".busca-module_search__xf4qJ{align-items:center;display:flex;fl
|
|
|
1499
1499
|
var styles$2 = {"search":"busca-module_search__xf4qJ","searchContainer":"busca-module_searchContainer__jhcnm","searchIcon":"busca-module_searchIcon__FPl1-","searchInput":"busca-module_searchInput__GjG8B","suggestionsWrapper":"busca-module_suggestionsWrapper__vbmxG","suggestions":"busca-module_suggestions__pYBV1","suggestion":"busca-module_suggestion__V-d8T"};
|
|
1500
1500
|
styleInject(css_248z$2);
|
|
1501
1501
|
|
|
1502
|
-
var Busca = function (_a) {
|
|
1503
|
-
var allItems = _a.allItems; _a.placeholder; var onItemClick = _a.onItemClick;
|
|
1504
|
-
var _c = React$2.useState(''), searchValue = _c[0], setSearchValue = _c[1];
|
|
1505
|
-
var _d = React$2.useState(allItems), filteredItems = _d[0], setFilteredItems = _d[1];
|
|
1506
|
-
var _e = React$2.useState(false), isInputFocused = _e[0], setIsInputFocused = _e[1];
|
|
1507
|
-
var handleSearchChange = function (event) {
|
|
1508
|
-
var value = event.target.value;
|
|
1509
|
-
setSearchValue(value);
|
|
1510
|
-
if (value.length > 0) {
|
|
1511
|
-
var filtered = allItems.filter(function (item) {
|
|
1512
|
-
return item.id.toLowerCase().includes(value.toLowerCase());
|
|
1513
|
-
});
|
|
1514
|
-
setFilteredItems(filtered);
|
|
1515
|
-
}
|
|
1516
|
-
else {
|
|
1517
|
-
setFilteredItems(allItems);
|
|
1518
|
-
}
|
|
1519
|
-
};
|
|
1520
|
-
var handleInputFocus = function () {
|
|
1521
|
-
setIsInputFocused(true);
|
|
1522
|
-
};
|
|
1523
|
-
var handleInputBlur = function () {
|
|
1524
|
-
setTimeout(function () { return setIsInputFocused(false); }, 100);
|
|
1525
|
-
};
|
|
1526
|
-
return (React$2.createElement("div", { className: styles$2.search },
|
|
1527
|
-
React$2.createElement("div", { className: styles$2.searchContainer },
|
|
1528
|
-
React$2.createElement("input", { type: "text", className: styles$2.searchInput, placeholder: "Pesquisar...", value: searchValue, onChange: handleSearchChange, onFocus: handleInputFocus, onBlur: handleInputBlur })),
|
|
1529
|
-
isInputFocused && filteredItems.length > 0 && (React$2.createElement("div", { className: styles$2.suggestionsWrapper },
|
|
1530
|
-
React$2.createElement("div", { className: styles$2.suggestions }, filteredItems.map(function (item, index) { return (React$2.createElement("div", { key: index, className: styles$2.suggestion, onClick: function () { return onItemClick(item.path); } }, item.id)); }))))));
|
|
1531
|
-
};
|
|
1532
|
-
|
|
1533
|
-
var css_248z$1 = ".checkboxGroup-module_checkboxGroup__JFRoY{border:1px solid #ccc;border-radius:.5rem;box-sizing:border-box;display:grid;font-style:italic;gap:.5rem;grid-auto-rows:auto;grid-template-columns:repeat(auto-fill,minmax(275px,1fr));padding:.8rem 0 .8rem 1rem;width:100%}.checkboxGroup-module_title__238QG{margin-bottom:10px}.checkboxGroup-module_checkboxLabel__tIciT{align-items:center;cursor:pointer;display:flex;font-style:italic}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]{cursor:pointer;margin-right:.5rem}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]:focus{outline:none}";
|
|
1534
|
-
var styles$1 = {"checkboxGroup":"checkboxGroup-module_checkboxGroup__JFRoY","title":"checkboxGroup-module_title__238QG","checkboxLabel":"checkboxGroup-module_checkboxLabel__tIciT"};
|
|
1535
|
-
styleInject(css_248z$1);
|
|
1536
|
-
|
|
1537
|
-
var CheckboxGroup = function (_a) {
|
|
1538
|
-
_a.id; var name = _a.name, options = _a.options, selectedValues = _a.selectedValues, onChange = _a.onChange, label = _a.label;
|
|
1539
|
-
var handleCheckboxChange = function (value) {
|
|
1540
|
-
var updatedValues;
|
|
1541
|
-
if (selectedValues.includes(value)) {
|
|
1542
|
-
updatedValues = selectedValues.filter(function (item) { return item !== value; });
|
|
1543
|
-
}
|
|
1544
|
-
else {
|
|
1545
|
-
updatedValues = __spreadArray(__spreadArray([], selectedValues, true), [value], false);
|
|
1546
|
-
}
|
|
1547
|
-
onChange(updatedValues);
|
|
1548
|
-
};
|
|
1549
|
-
return (React$2.createElement("div", { className: styles$1.checkboxGroup },
|
|
1550
|
-
label && React$2.createElement("label", { className: styles$1.title }, label),
|
|
1551
|
-
options.map(function (option) { return (React$2.createElement("label", { key: option.value, className: styles$1.checkboxLabel },
|
|
1552
|
-
React$2.createElement("input", { type: "checkbox", name: name, value: option.value, checked: selectedValues.includes(option.value), onChange: function () { return handleCheckboxChange(option.value); } }),
|
|
1553
|
-
option.description)); })));
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
1502
|
var DefaultContext = {
|
|
1557
1503
|
color: undefined,
|
|
1558
1504
|
size: undefined,
|
|
@@ -1615,8 +1561,65 @@ function FaDownload (props) {
|
|
|
1615
1561
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},"child":[]}]})(props);
|
|
1616
1562
|
}function FaPen (props) {
|
|
1617
1563
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"},"child":[]}]})(props);
|
|
1564
|
+
}function FaSearch (props) {
|
|
1565
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},"child":[]}]})(props);
|
|
1618
1566
|
}
|
|
1619
1567
|
|
|
1568
|
+
var Busca = function (_a) {
|
|
1569
|
+
var allItems = _a.allItems; _a.placeholder; var onItemClick = _a.onItemClick, iconBusca = _a.iconBusca;
|
|
1570
|
+
var _c = React$2.useState(''), searchValue = _c[0], setSearchValue = _c[1];
|
|
1571
|
+
var _d = React$2.useState(allItems), filteredItems = _d[0], setFilteredItems = _d[1];
|
|
1572
|
+
var _e = React$2.useState(false), isInputFocused = _e[0], setIsInputFocused = _e[1];
|
|
1573
|
+
var handleSearchChange = function (event) {
|
|
1574
|
+
var value = event.target.value;
|
|
1575
|
+
setSearchValue(value);
|
|
1576
|
+
if (value.length > 0) {
|
|
1577
|
+
var filtered = allItems.filter(function (item) {
|
|
1578
|
+
return item.id.toLowerCase().includes(value.toLowerCase());
|
|
1579
|
+
});
|
|
1580
|
+
setFilteredItems(filtered);
|
|
1581
|
+
}
|
|
1582
|
+
else {
|
|
1583
|
+
setFilteredItems(allItems);
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
var handleInputFocus = function () {
|
|
1587
|
+
setIsInputFocused(true);
|
|
1588
|
+
};
|
|
1589
|
+
var handleInputBlur = function () {
|
|
1590
|
+
setTimeout(function () { return setIsInputFocused(false); }, 100);
|
|
1591
|
+
};
|
|
1592
|
+
return (React$2.createElement("div", { className: styles$2.search },
|
|
1593
|
+
React$2.createElement("div", { className: styles$2.searchContainer },
|
|
1594
|
+
iconBusca && React$2.createElement(FaSearch, null),
|
|
1595
|
+
React$2.createElement("input", { type: "text", className: styles$2.searchInput, placeholder: "Pesquisar...", value: searchValue, onChange: handleSearchChange, onFocus: handleInputFocus, onBlur: handleInputBlur })),
|
|
1596
|
+
isInputFocused && filteredItems.length > 0 && (React$2.createElement("div", { className: styles$2.suggestionsWrapper },
|
|
1597
|
+
React$2.createElement("div", { className: styles$2.suggestions }, filteredItems.map(function (item, index) { return (React$2.createElement("div", { key: index, className: styles$2.suggestion, onClick: function () { return onItemClick(item.path); } }, item.id)); }))))));
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
var css_248z$1 = ".checkboxGroup-module_checkboxGroup__JFRoY{border:1px solid #ccc;border-radius:.5rem;box-sizing:border-box;display:grid;font-style:italic;gap:.5rem;grid-auto-rows:auto;grid-template-columns:repeat(auto-fill,minmax(275px,1fr));padding:.8rem 0 .8rem 1rem;width:100%}.checkboxGroup-module_title__238QG{margin-bottom:10px}.checkboxGroup-module_checkboxLabel__tIciT{align-items:center;cursor:pointer;display:flex;font-style:italic}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]{cursor:pointer;margin-right:.5rem}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]:focus{outline:none}";
|
|
1601
|
+
var styles$1 = {"checkboxGroup":"checkboxGroup-module_checkboxGroup__JFRoY","title":"checkboxGroup-module_title__238QG","checkboxLabel":"checkboxGroup-module_checkboxLabel__tIciT"};
|
|
1602
|
+
styleInject(css_248z$1);
|
|
1603
|
+
|
|
1604
|
+
var CheckboxGroup = function (_a) {
|
|
1605
|
+
_a.id; var name = _a.name, options = _a.options, selectedValues = _a.selectedValues, onChange = _a.onChange, label = _a.label;
|
|
1606
|
+
var handleCheckboxChange = function (value) {
|
|
1607
|
+
var updatedValues;
|
|
1608
|
+
if (selectedValues.includes(value)) {
|
|
1609
|
+
updatedValues = selectedValues.filter(function (item) { return item !== value; });
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
updatedValues = __spreadArray(__spreadArray([], selectedValues, true), [value], false);
|
|
1613
|
+
}
|
|
1614
|
+
onChange(updatedValues);
|
|
1615
|
+
};
|
|
1616
|
+
return (React$2.createElement("div", { className: styles$1.checkboxGroup },
|
|
1617
|
+
label && React$2.createElement("label", { className: styles$1.title }, label),
|
|
1618
|
+
options.map(function (option) { return (React$2.createElement("label", { key: option.value, className: styles$1.checkboxLabel },
|
|
1619
|
+
React$2.createElement("input", { type: "checkbox", name: name, value: option.value, checked: selectedValues.includes(option.value), onChange: function () { return handleCheckboxChange(option.value); } }),
|
|
1620
|
+
option.description)); })));
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1620
1623
|
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
1621
1624
|
/* vim: set ts=2: */
|
|
1622
1625
|
/*exported XLSX */
|