|
1 | 1 | <template>
|
2 | 2 | <div class="dp--header-wrap">
|
3 |
| - <template v-if="$slots['month-year']"> |
4 |
| - <div class="dp__month_year_wrap"> |
5 |
| - <slot |
6 |
| - name="month-year" |
7 |
| - v-bind="{ |
8 |
| - month, |
9 |
| - year, |
10 |
| - months, |
11 |
| - years, |
12 |
| - updateMonthYear, |
13 |
| - handleMonthYearChange, |
14 |
| - instance, |
15 |
| - isDisabled, |
16 |
| - }" |
17 |
| - /> |
18 |
| - </div> |
19 |
| - </template> |
20 |
| - <template v-else> |
21 |
| - <div v-if="$slots['top-extra']"> |
22 |
| - <slot name="top-extra" :value="internalModelValue" /> |
23 |
| - </div> |
24 |
| - <div class="dp__month_year_wrap"> |
25 |
| - <ArrowBtn |
26 |
| - v-if="showLeftIcon(defaultedMultiCalendars, instance) && !vertical" |
27 |
| - :aria-label="defaultedAriaLabels?.prevMonth" |
28 |
| - :disabled="isDisabled(false)" |
29 |
| - :class="defaultedUI?.navBtnPrev" |
30 |
| - el-name="action-prev" |
31 |
| - @activate="handleMonthYearChange(false, true)" |
32 |
| - @set-ref="setElRefs($event, 0)" |
33 |
| - > |
34 |
| - <slot v-if="$slots['arrow-left']" name="arrow-left" /> |
35 |
| - <ChevronLeftIcon v-if="!$slots['arrow-left']" /> |
36 |
| - </ArrowBtn> |
| 3 | + <div v-if="$slots['top-extra'] && !$slots['month-year']"> |
| 4 | + <slot name="top-extra" :value="internalModelValue" /> |
| 5 | + </div> |
| 6 | + <div class="dp__month_year_wrap"> |
| 7 | + <ArrowBtn |
| 8 | + v-if="showLeftIcon(defaultedMultiCalendars, instance) && !vertical" |
| 9 | + :aria-label="defaultedAriaLabels?.prevMonth" |
| 10 | + :disabled="isDisabled(false)" |
| 11 | + :class="defaultedUI?.navBtnPrev" |
| 12 | + el-name="action-prev" |
| 13 | + @activate="handleMonthYearChange(false, true)" |
| 14 | + @set-ref="setElRefs($event, 0)" |
| 15 | + > |
| 16 | + <slot v-if="$slots['arrow-left']" name="arrow-left" /> |
| 17 | + <ChevronLeftIcon v-if="!$slots['arrow-left']" /> |
| 18 | + </ArrowBtn> |
| 19 | + |
| 20 | + <template v-if="$slots['month-year']"> |
| 21 | + <div class="dp__month_year_wrap"> |
| 22 | + <slot |
| 23 | + name="month-year" |
| 24 | + v-bind="{ |
| 25 | + month, |
| 26 | + year, |
| 27 | + months, |
| 28 | + years, |
| 29 | + updateMonthYear, |
| 30 | + handleMonthYearChange, |
| 31 | + instance, |
| 32 | + isDisabled, |
| 33 | + }" |
| 34 | + /> |
| 35 | + </div> |
| 36 | + </template> |
| 37 | + <template v-else> |
37 | 38 | <div
|
38 | 39 | class="dp__month_year_wrap"
|
39 | 40 | :class="{
|
|
96 | 97 | </transition>
|
97 | 98 | </template>
|
98 | 99 | </div>
|
99 |
| - <ArrowBtn |
100 |
| - v-if="showLeftIcon(defaultedMultiCalendars, instance) && vertical" |
101 |
| - :aria-label="defaultedAriaLabels?.prevMonth" |
102 |
| - el-name="action-prev" |
103 |
| - :disabled="isDisabled(false)" |
104 |
| - :class="defaultedUI?.navBtnPrev" |
105 |
| - @activate="handleMonthYearChange(false, true)" |
106 |
| - > |
107 |
| - <slot v-if="$slots['arrow-up']" name="arrow-up" /> |
108 |
| - <ChevronUpIcon v-if="!$slots['arrow-up']" /> |
109 |
| - </ArrowBtn> |
110 |
| - <ArrowBtn |
111 |
| - v-if="showRightIcon(defaultedMultiCalendars, instance)" |
112 |
| - ref="rightIcon" |
113 |
| - el-name="action-next" |
114 |
| - :disabled="isDisabled(true)" |
115 |
| - :aria-label="defaultedAriaLabels?.nextMonth" |
116 |
| - :class="defaultedUI?.navBtnNext" |
117 |
| - @activate="handleMonthYearChange(true, true)" |
118 |
| - @set-ref="setElRefs($event, disableYearSelect ? 2 : 3)" |
119 |
| - > |
120 |
| - <slot |
121 |
| - v-if="$slots[vertical ? 'arrow-down' : 'arrow-right']" |
122 |
| - :name="vertical ? 'arrow-down' : 'arrow-right'" |
123 |
| - /> |
124 |
| - <component |
125 |
| - :is="vertical ? ChevronDownIcon : ChevronRightIcon" |
126 |
| - v-if="!$slots[vertical ? 'arrow-down' : 'arrow-right']" |
127 |
| - /> |
128 |
| - </ArrowBtn> |
129 |
| - </div> |
130 |
| - </template> |
| 100 | + </template> |
| 101 | + |
| 102 | + <ArrowBtn |
| 103 | + v-if="showLeftIcon(defaultedMultiCalendars, instance) && vertical" |
| 104 | + :aria-label="defaultedAriaLabels?.prevMonth" |
| 105 | + el-name="action-prev" |
| 106 | + :disabled="isDisabled(false)" |
| 107 | + :class="defaultedUI?.navBtnPrev" |
| 108 | + @activate="handleMonthYearChange(false, true)" |
| 109 | + > |
| 110 | + <slot v-if="$slots['arrow-up']" name="arrow-up" /> |
| 111 | + <ChevronUpIcon v-if="!$slots['arrow-up']" /> |
| 112 | + </ArrowBtn> |
| 113 | + <ArrowBtn |
| 114 | + v-if="showRightIcon(defaultedMultiCalendars, instance)" |
| 115 | + ref="rightIcon" |
| 116 | + el-name="action-next" |
| 117 | + :disabled="isDisabled(true)" |
| 118 | + :aria-label="defaultedAriaLabels?.nextMonth" |
| 119 | + :class="defaultedUI?.navBtnNext" |
| 120 | + @activate="handleMonthYearChange(true, true)" |
| 121 | + @set-ref="setElRefs($event, disableYearSelect ? 2 : 3)" |
| 122 | + > |
| 123 | + <slot |
| 124 | + v-if="$slots[vertical ? 'arrow-down' : 'arrow-right']" |
| 125 | + :name="vertical ? 'arrow-down' : 'arrow-right'" |
| 126 | + /> |
| 127 | + <component |
| 128 | + :is="vertical ? ChevronDownIcon : ChevronRightIcon" |
| 129 | + v-if="!$slots[vertical ? 'arrow-down' : 'arrow-right']" |
| 130 | + /> |
| 131 | + </ArrowBtn> |
| 132 | + </div> |
131 | 133 | </div>
|
132 | 134 | </template>
|
133 | 135 |
|
|
0 commit comments