SharingEntrySimple.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!--
  2. - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
  3. -
  4. - @author John Molakvoæ <skjnldsv@protonmail.com>
  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. -->
  22. <template>
  23. <li class="sharing-entry">
  24. <slot name="avatar" />
  25. <div v-tooltip="tooltip" class="sharing-entry__desc">
  26. <h5>{{ title }}</h5>
  27. <p v-if="subtitle">
  28. {{ subtitle }}
  29. </p>
  30. </div>
  31. <Actions v-if="$slots['default']" menu-align="right" class="sharing-entry__actions">
  32. <slot />
  33. </Actions>
  34. </li>
  35. </template>
  36. <script>
  37. import Actions from 'nextcloud-vue/dist/Components/Actions'
  38. import Tooltip from 'nextcloud-vue/dist/Directives/Tooltip'
  39. export default {
  40. name: 'SharingEntrySimple',
  41. components: {
  42. Actions
  43. },
  44. directives: {
  45. Tooltip
  46. },
  47. props: {
  48. title: {
  49. type: String,
  50. default: '',
  51. required: true
  52. },
  53. tooltip: {
  54. type: String,
  55. default: ''
  56. },
  57. subtitle: {
  58. type: String,
  59. default: ''
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .sharing-entry {
  66. display: flex;
  67. align-items: center;
  68. height: 44px;
  69. &__desc {
  70. padding: 8px;
  71. line-height: 1.2em;
  72. position: relative;
  73. flex: 1 1;
  74. min-width: 0;
  75. h5 {
  76. white-space: nowrap;
  77. text-overflow: ellipsis;
  78. overflow: hidden;
  79. max-width: inherit;
  80. }
  81. p {
  82. color: var(--color-text-maxcontrast);
  83. }
  84. }
  85. &__actions {
  86. margin-left: auto !important;
  87. }
  88. }
  89. </style>