You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CustomMessageInput.vue 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!--
  2. - @copyright Copyright (c) 2020 Georg Ehrke <oc.list@georgehrke.com>
  3. - @author Georg Ehrke <oc.list@georgehrke.com>
  4. -
  5. - @license GNU AGPL version 3 or any later version
  6. -
  7. - This program is free software: you can redistribute it and/or modify
  8. - it under the terms of the GNU Affero General Public License as
  9. - published by the Free Software Foundation, either version 3 of the
  10. - License, or (at your option) any later version.
  11. -
  12. - This program is distributed in the hope that it will be useful,
  13. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. - GNU Affero General Public License for more details.
  16. -
  17. - You should have received a copy of the GNU Affero General Public License
  18. - along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. -
  20. -->
  21. <template>
  22. <form
  23. class="custom-input__form"
  24. @submit.prevent>
  25. <input
  26. :placeholder="$t('user_status', 'What\'s your status?')"
  27. type="text"
  28. :value="message"
  29. @change="change">
  30. </form>
  31. </template>
  32. <script>
  33. export default {
  34. name: 'CustomMessageInput',
  35. props: {
  36. message: {
  37. type: String,
  38. required: true,
  39. default: () => '',
  40. },
  41. },
  42. methods: {
  43. /**
  44. * Notifies the parent component about a changed input
  45. *
  46. * @param {Event} event The Change Event
  47. */
  48. change(event) {
  49. this.$emit('change', event.target.value)
  50. },
  51. },
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .custom-input__form {
  56. flex-grow: 1;
  57. input {
  58. width: 100%;
  59. border-radius: 0 var(--border-radius) var(--border-radius) 0;
  60. }
  61. }
  62. </style>