SideView.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <b-sidebar
  3. class="side-view no-events-container"
  4. v-bind="$attrs" v-on="$listeners"
  5. no-header
  6. :id="id"
  7. :body-class="{ paddings: !noCross }"
  8. :visible="visible"
  9. >
  10. <template #default="{ hide, visible: visible2 }">
  11. <div v-if="!noCross" class="btn-close-wrapper">
  12. <button-close @click="hide()" />
  13. </div>
  14. <slot name="default" v-bind="{ hide, visible: visible2 }" />
  15. </template>
  16. </b-sidebar>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'SideView',
  21. props: {
  22. id: { type: String, required: true },
  23. noCross: { type: Boolean, default: false },
  24. visible: { type: Boolean, default: false }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .side-view {
  30. position: absolute;
  31. height: 100%;
  32. ::v-deep {
  33. .b-sidebar {
  34. position: absolute;
  35. width: auto;
  36. @media (orientation: portrait) {
  37. width: 100%;
  38. }
  39. @media (orientation: landscape) {
  40. max-width: 50%;
  41. &:not(.b-sidebar-right) {
  42. border-right: $line;
  43. }
  44. &.b-sidebar-right {
  45. border-left: $line;
  46. }
  47. }
  48. }
  49. .b-sidebar-body.paddings {
  50. padding: $node-view-spacer-sm-y $node-view-spacer-sm-x;
  51. @include media-breakpoint-up($layout-bp) {
  52. padding: $node-view-spacer-y $node-view-spacer-x;
  53. }
  54. }
  55. }
  56. .btn-close-wrapper {
  57. position: sticky;
  58. z-index: 2;
  59. height: 1.75rem;
  60. width: 1.75rem;
  61. top: 0;
  62. right: 0;
  63. float: right;
  64. margin-top: -1rem;
  65. .btn-close {
  66. position: absolute;
  67. padding: 0.5rem;
  68. width: 2.25rem;
  69. height: 2.25rem;
  70. top: -.5rem;
  71. right: -.5rem;
  72. background-color: $white;
  73. }
  74. }
  75. }
  76. </style>