Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

30 строки
685 B

  1. import './search-input.scss';
  2. import {createElement} from "../../_global/scripts/helpers";
  3. export const createSearchInput = ({
  4. typeahead = false,
  5. placeholder = 'Hier Ihr Thema finden',
  6. value = null,
  7. api = null,
  8. autocomplete = false,
  9. id = 'search-term',
  10. }) => {
  11. const input = createElement('input', typeahead ? ['search-field', 'typeahead'] : ['search-field']);
  12. input.id = id;
  13. input.type = 'search';
  14. if (!autocomplete) {
  15. input.autocomplete = 'off';
  16. }
  17. if (value) {
  18. input.value = value;
  19. }
  20. if (placeholder) {
  21. input.placeholder = placeholder;
  22. }
  23. if (api) {
  24. input.dataset.api = api;
  25. input.classList.add('typeahead');
  26. }
  27. return input;
  28. }