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.

LoginButton.vue 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!--
  2. - @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
  3. -
  4. - @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
  5. -
  6. - @license GNU AGPL version 3 or any later version
  7. -
  8. - This program is free software: you can redistribute it and/or modify
  9. - it under the terms of the GNU Affero General Public License as
  10. - published by the Free Software Foundation, either version 3 of the
  11. - License, or (at your option) any later version.
  12. -
  13. - This program is distributed in the hope that it will be useful,
  14. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. - GNU Affero General Public License for more details.
  17. -
  18. - You should have received a copy of the GNU Affero General Public License
  19. - along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. -->
  21. <template>
  22. <NcButton type="primary"
  23. native-type="submit"
  24. :wide="true"
  25. @click="$emit('click')">
  26. {{ !loading ? value : valueLoading }}
  27. <template #icon>
  28. <div v-if="loading" class="submit-wrapper__icon icon-loading-small-dark" />
  29. <ArrowRight v-else class="submit-wrapper__icon" />
  30. </template>
  31. </NcButton>
  32. </template>
  33. <script>
  34. import { translate as t } from '@nextcloud/l10n'
  35. import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
  36. import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
  37. export default {
  38. name: 'LoginButton',
  39. components: {
  40. ArrowRight,
  41. NcButton,
  42. },
  43. props: {
  44. value: {
  45. type: String,
  46. default: t('core', 'Log in'),
  47. },
  48. valueLoading: {
  49. type: String,
  50. default: t('core', 'Logging in …'),
  51. },
  52. loading: {
  53. type: Boolean,
  54. required: true,
  55. },
  56. invertedColors: {
  57. type: Boolean,
  58. default: false,
  59. },
  60. },
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .button-vue {
  65. margin-top: .5rem;
  66. }
  67. </style>