componenteshospitais 1.5.3 → 1.5.5

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 CHANGED
@@ -1479,6 +1479,18 @@ styleInject(css_248z$3);
1479
1479
 
1480
1480
  var SelectField = function (_a) {
1481
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;
1482
+ var _b = React$2.useState(options), filteredOptions = _b[0], setFilteredOptions = _b[1];
1483
+ var _c = React$2.useState(''), inputValue = _c[0], setInputValue = _c[1];
1484
+ React$2.useEffect(function () {
1485
+ var filterOptions = options.filter(function (option) {
1486
+ return option.description.toLowerCase().includes(inputValue.toLowerCase()) ||
1487
+ option.value.toString().includes(inputValue);
1488
+ });
1489
+ setFilteredOptions(filterOptions);
1490
+ }, [inputValue, options]);
1491
+ var handleInputChange = function (e) {
1492
+ setInputValue(e.target.value);
1493
+ };
1482
1494
  var handleSelectChange = function (e) {
1483
1495
  if (multiple) {
1484
1496
  var selectedOptions = Array.from(e.target.selectedOptions, function (option) { return option.value; });
@@ -1490,9 +1502,11 @@ var SelectField = function (_a) {
1490
1502
  };
1491
1503
  return (React$2.createElement(React$2.Fragment, null,
1492
1504
  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 },
1494
- optionDefault && !multiple && (React$2.createElement("option", { value: "" }, "Selecione...")),
1495
- options.map(function (option) { return (React$2.createElement("option", { key: option.value, value: option.value }, option.description)); }))));
1505
+ React$2.createElement("div", { className: styles$3.selectContainer, style: { width: largura ? largura : '' } },
1506
+ React$2.createElement("input", { type: "text", value: inputValue, onChange: handleInputChange, placeholder: "Digite para filtrar...", className: styles$3.inputSobreposto, disabled: disabled }),
1507
+ React$2.createElement("select", { id: id, name: name, className: styles$3.selectPadrao, value: value, onChange: handleSelectChange, disabled: disabled, multiple: multiple },
1508
+ optionDefault && !multiple && (React$2.createElement("option", { value: "" }, "Selecione...")),
1509
+ filteredOptions.map(function (option) { return (React$2.createElement("option", { key: option.value, value: option.value }, option.description)); })))));
1496
1510
  };
1497
1511
 
1498
1512
  var css_248z$2 = ".busca-module_search__xf4qJ{align-items:center;display:flex;flex-direction:column;justify-content:center;margin:2rem 0;width:100%}.busca-module_searchContainer__jhcnm{align-items:center;display:flex;max-width:600px;position:relative;width:100%}.busca-module_searchIcon__FPl1-{height:20px;left:10px;position:absolute;width:20px}.busca-module_searchInput__GjG8B{background-color:var(--lightGray);border:none;border-radius:50px;box-sizing:border-box;color:var(--gray);height:100%;outline:none;padding:10px 15px 10px 35px;width:100%;z-index:1001}.busca-module_suggestionsWrapper__vbmxG{background:#fff;border-bottom-left-radius:20px;border-bottom-right-radius:20px;box-shadow:0 4px 6px rgba(0,0,0,.1);color:var(--blue);width:45%;z-index:1000}.busca-module_suggestions__pYBV1{border-bottom-left-radius:20px;border-bottom-right-radius:20px;max-height:500px;overflow-y:auto}.busca-module_suggestion__V-d8T{cursor:pointer;padding:10px}.busca-module_suggestion__V-d8T:hover{background-color:var(--blue);color:#fff}.busca-module_suggestion__V-d8T:not(:first-child){border-top:1px solid var(--lightGray);padding-top:8px}@media (max-width:768px){.busca-module_searchInput__GjG8B{padding:10px 15px 10px 30px}.busca-module_suggestionsWrapper__vbmxG{top:35px}}@media (max-width:500px){.busca-module_searchContainer__jhcnm{width:90%}.busca-module_searchInput__GjG8B{padding:10px;width:100%}}";
@@ -17538,7 +17552,7 @@ var TableStandard = function (_a) {
17538
17552
  onActionClick(row[idColumn]);
17539
17553
  }, className: styles.actionButton, title: 'Editar' },
17540
17554
  React$2.createElement(FaPen, null))),
17541
- showDownloadButton && shouldShowDownloadButton(row.id) && (React$2.createElement("button", { onClick: function (e) {
17555
+ showDownloadButton && shouldShowDownloadButton(row[idColumn]) && (React$2.createElement("button", { onClick: function (e) {
17542
17556
  e.stopPropagation();
17543
17557
  if (onDownloadClick)
17544
17558
  onDownloadClick(row[idColumn]);