NodeViewHeaderRef.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div
  3. class="node-view-header-ref" :class="'node-view-header-' + mode"
  4. >
  5. <div class="node-view-header-wrapper w-100">
  6. <div class="nav-container">
  7. <node-view-child-list
  8. v-if="mode === 'view' && node.children && node.children.length"
  9. :children="node.children"
  10. @open-child="$parent.$emit('open-child', $event)"
  11. />
  12. <button-close v-if="mode === 'view'" @click="onClose()" />
  13. </div>
  14. <node-view-title
  15. :node="node" tag="h4"
  16. block edition url
  17. class="mr-auto"
  18. />
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import { trim, toCommaList } from '@/helpers/common'
  24. import { NodeViewChildList, NodeViewTitle } from '@/components/nodes'
  25. export default {
  26. name: 'NodeViewHeaderRef',
  27. components: {
  28. NodeViewChildList,
  29. NodeViewTitle
  30. },
  31. props: {
  32. node: { type: Object, required: true },
  33. mode: { type: String, required: true }
  34. },
  35. methods: {
  36. trim,
  37. toCommaList,
  38. onClose () {
  39. this.$parent.$emit('close-node', this.node.id)
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .node-view-header {
  46. &-ref {
  47. font-family: $font-family-text;
  48. }
  49. .nav-container {
  50. position: relative;
  51. display: flex;
  52. float: right;
  53. @include media-breakpoint-up($layout-bp) {
  54. right: -13px;
  55. }
  56. }
  57. // ╭─╴╭─┐┌─╮┌─╮
  58. // │ ├─┤├┬╯│ │
  59. // ╰─╴╵ ╵╵ ╰└─╯
  60. &-card {
  61. h4 {
  62. font-size: 1.1rem;
  63. .edition {
  64. font-size: 0.65rem;
  65. }
  66. @include media-breakpoint-up($size-bp) {
  67. font-size: 2rem;
  68. .edition {
  69. font-size: 1.15rem;
  70. }
  71. }
  72. }
  73. }
  74. // ╷ ╷╶┬╴┌─╴╷╷╷
  75. // │╭╯ │ ├─╴│││
  76. // ╰╯ ╶┴╴╰─╴╰╯╯
  77. &-view {
  78. h4 {
  79. font-size: 1.25rem;
  80. .edition {
  81. font-size: 0.75rem;
  82. }
  83. @include media-breakpoint-up($size-bp) {
  84. font-size: 2.625rem;
  85. .edition {
  86. font-size: 1.5rem;
  87. }
  88. }
  89. }
  90. .node-view-child-list {
  91. display: none;
  92. @include media-breakpoint-up($layout-bp) {
  93. display: block;
  94. }
  95. }
  96. }
  97. }
  98. </style>