logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

autosuggest.vue (1093B)


  1. <!-- FIXME THIS NEEDS TO BE REFACTORED TO USE POPOVER -->
  2. <template>
  3. <div
  4. v-click-outside="onClickOutside"
  5. class="autosuggest"
  6. >
  7. <input
  8. v-model="term"
  9. :placeholder="placeholder"
  10. class="input autosuggest-input"
  11. @click="onInputClick"
  12. >
  13. <div
  14. v-if="resultsVisible && filtered.length > 0"
  15. class="panel autosuggest-results"
  16. >
  17. <slot
  18. v-for="item in filtered"
  19. :item="item"
  20. />
  21. </div>
  22. </div>
  23. </template>
  24. <script src="./autosuggest.js"></script>
  25. <style lang="scss">
  26. .autosuggest {
  27. position: relative;
  28. &-input {
  29. display: block;
  30. width: 100%;
  31. }
  32. &-results {
  33. position: absolute;
  34. left: 0;
  35. top: 100%;
  36. right: 0;
  37. max-height: 400px;
  38. background-color: var(--bg);
  39. border-style: solid;
  40. border-width: 1px;
  41. border-color: var(--border);
  42. border-radius: var(--roundness);
  43. border-top-left-radius: 0;
  44. border-top-right-radius: 0;
  45. box-shadow: 1px 1px 4px rgb(0 0 0 / 60%);
  46. box-shadow: var(--shadow);
  47. overflow-y: auto;
  48. z-index: 1;
  49. }
  50. }
  51. </style>