NodeViewHeaderRef.vue 2.3 KB

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