antoniandre / vue-cal

A Vue.js full calendar, no dependency, no BS. :metal:
https://antoniandre.github.io/vue-cal/
MIT License
1.23k stars 235 forks source link

Alternative header layouts #581

Open EdnaldoNeimeg opened 4 weeks ago

EdnaldoNeimeg commented 4 weeks ago

First of all, sorry for my bad english.

I'm working in a scheduler app and I think that the default header layout is not optimized for good space usage.

image

I've made some changes that allow me to choose the header layout: (Here i'm using the default test page)

Default header (not changed)

image

Default header with title

<vue-cal
    v-model:selectedDate="selectedDate"
    class="ml2 mr1 vuecal--blue-theme"
    xsmall
    :events="events"
    editable-events
    cell-contextmenu
    today-button
    :time-from="7 * 60"
    :time-to="20 * 60"
    :special-hours="specialHours"
    :hide-view-selector="false"
    :cell-contextmenu="log"
  >
    <template #name>VueCal Test View</template>
  </vue-cal>

image

Defaultt header - reordered

<vue-cal
    ...
    :header-options="{
      order: ['title-bar','menu','name'],
    }"
  >
    <template #name>VueCal Test View</template>
  </vue-cal>

image

Alternative header - title at center

<vue-cal
    ...
    :header-options="{
      type:'row',
      order: ['title-bar','name', 'menu'],
    }"
  >
    <template #name>VueCal Test View</template>
  </vue-cal>

image

Alternative header - title at left

<vue-cal
    ...
    :header-options="{
      type:'row',
      order: ['name', 'title-bar', 'menu'],
    }"
  >
    <template #name>VueCal Test View</template>
  </vue-cal>

image

Alternative header responsivity

When the width is equal or below 1024px, the alternative header will change its layout to default header in order not to break its responsivity. (If you set the order of elements, the order will remain the same you set) image

I'm using these changes in my personal project: image

Please guys let me know what you think about these changes. If it's welcome, I can submit an PR.

EdnaldoNeimeg commented 4 weeks ago

@antoniandre