componenteshospitais 1.6.4 → 1.6.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 CHANGED
@@ -1577,8 +1577,8 @@ var Busca = function (_a) {
1577
1577
  var inputValue = e.target.value;
1578
1578
  onChange(inputValue);
1579
1579
  if (inputValue === '') {
1580
- setFilteredOptions([]);
1581
- setShowOptions(false);
1580
+ setFilteredOptions(options); // Mostra todas as opções se não houver entrada
1581
+ setShowOptions(true); // Exibe a lista de opções
1582
1582
  }
1583
1583
  else {
1584
1584
  var filtered = options.filter(function (option) {
@@ -1588,13 +1588,18 @@ var Busca = function (_a) {
1588
1588
  setShowOptions(true);
1589
1589
  }
1590
1590
  };
1591
+ var handleFocus = function (e) {
1592
+ // Ao focar no campo de entrada, mostrar todas as opções
1593
+ setFilteredOptions(options);
1594
+ setShowOptions(true);
1595
+ };
1591
1596
  var handleOptionClick = function (option) {
1592
1597
  onChange(option.description);
1593
1598
  setShowOptions(false);
1594
1599
  };
1595
1600
  return (React$2.createElement("div", { style: { position: 'relative' } },
1596
1601
  React$2.createElement("label", { htmlFor: "codigoCbhpm" }, label),
1597
- React$2.createElement("input", { type: "text", id: "codigoCbhpm", value: value, onChange: handleInputChange, placeholder: "Digite para buscar...", autoComplete: "off", style: { width: '100%', padding: '8px' } }),
1602
+ React$2.createElement("input", { type: "text", id: "codigoCbhpm", value: value, onChange: handleInputChange, onFocus: handleFocus, placeholder: "Digite para buscar...", autoComplete: "off", className: styles$5.inputPadrao, style: { width: '100%' } }),
1598
1603
  showOptions && filteredOptions.length > 0 && (React$2.createElement("ul", { style: {
1599
1604
  position: 'absolute',
1600
1605
  width: '100%',