22  <!-- Nav panel--> 
33  <div  class =" vc-nav-container" 
44    <!-- Nav header--> 
5-     <grid   :columns = " 3 "   ref = " headerGrid "   @rollover = " onHeaderRollover " 
5+     <div   class = " vc-nav-header " 
66      <!-- Move prev button--> 
77      <span 
88        role =" button" 
99        class =" vc-nav-arrow is-left" 
10-         tabindex =" -1 " 
10+         tabindex =" 0 " 
1111        @click =" movePrev" 
1212        @keydown =" e => onSpaceOrEnter(e, movePrev)" 
13-         ref =" prevButton" 
1413      >
1514        <slot  name =" nav-left-button" 
1615          <svg-icon  name =" left-arrow" width =" 20px" height =" 24px" 
2423        tabindex =" 0" 
2524        @click =" toggleMode" 
2625        @keydown =" e => onSpaceOrEnter(e, toggleMode)" 
27-         ref =" titleButton" 
2826      >
2927        {{ title }}
3028      </span >
3129      <!-- Move next button--> 
3230      <span 
3331        role =" button" 
3432        class =" vc-nav-arrow is-right" 
35-         tabindex =" -1 " 
33+         tabindex =" 0 " 
3634        @click =" moveNext" 
3735        @keydown =" e => onSpaceOrEnter(e, moveNext)" 
38-         ref =" nextButton" 
3936      >
4037        <slot  name =" nav-right-button" 
4138          <svg-icon  name =" right-arrow" width =" 20px" height =" 24px" 
4239        </slot >
4340      </span >
44-     </grid >
41+     </div >
4542    <!-- Navigation items--> 
46-     <grid 
47-       :rows =" 4" 
48-       :columns =" 3" 
49-       gap =" 2px 5px" 
50-       ref =" itemsGrid" 
51-       @rollover =" onItemsRollover" 
52-     >
43+     <div  class =" vc-nav-items" 
5344      <span 
5445        v-for =" item in activeItems" 
5546        :key =" item.label" 
5647        role =" button" 
5748        :aria-label =" item.ariaLabel" 
5849        :class =" getItemClasses(item)" 
59-         :tabindex =" item.isDisabled ? undefined : item.isActive ? 0 : -1 " 
50+         :tabindex =" item.isDisabled ? undefined : 0 " 
6051        @click =" item.click" 
6152        @keydown =" e => onSpaceOrEnter(e, item.click)" 
62-         ref =" items" 
6353      >
6454        {{ item.label }}
6555      </span >
66-     </grid >
56+     </div >
6757  </div >
6858</template >
6959
7060<script >
71- import  Grid  from  ' ./Grid' 
7261import  SvgIcon  from  ' ./SvgIcon' 
7362import  { childMixin  } from  ' ../utils/mixins' 
7463import  { head , last  } from  ' ../utils/_' 
@@ -79,7 +68,6 @@ const _yearGroupCount = 12;
7968export  default  {
8069  name:  ' CalendarNav'  
8170  components:  { 
82-     Grid, 
8371    SvgIcon, 
8472  }, 
8573  mixins:  [childMixin], 
@@ -160,18 +148,13 @@ export default {
160148  created () { 
161149    this .yearIndex  =  this .year ; 
162150  }, 
163-   mounted () { 
164-     this .$refs .itemsGrid .tryFocus (); 
165-   }, 
166151  methods:  { 
167152    getItemClasses ({ isActive, isCurrent, isDisabled }) { 
168153      const  classes  =  [' vc-nav-item'  
169154      if  (isActive) { 
170-         classes .push (' is-active' ,  ' vc-grid-focus '  
155+         classes .push (' is-active'  
171156      } else  if  (isCurrent) { 
172-         classes .push (' is-inactive-current'  
173-       } else  { 
174-         classes .push (' is-inactive'  
157+         classes .push (' is-current'  
175158      } 
176159      if  (isDisabled) { 
177160        classes .push (' is-disabled'  
@@ -187,7 +170,6 @@ export default {
187170    yearClick (year ) { 
188171      this .yearIndex  =  year; 
189172      this .monthMode  =  true ; 
190-       this .$refs .itemsGrid .tryFocus (); 
191173    }, 
192174    toggleMode () { 
193175      this .monthMode  =  ! this .monthMode ; 
@@ -216,40 +198,16 @@ export default {
216198    moveNextYearGroup () { 
217199      this .yearGroupIndex ++ ; 
218200    }, 
219-     onHeaderRollover (e ) { 
220-       switch  (e .direction ) { 
221-         case  ' vertical-trailing'  
222-           this .$refs .itemsGrid .tryFocus (); 
223-           break ; 
224-       } 
225-       e .handled  =  true ; 
226-     }, 
227-     onItemsRollover (e ) { 
228-       switch  (e .direction ) { 
229-         case  ' horizontal-leading'  
230-           this .movePrev (); 
231-           break ; 
232-         } 
233-         case  ' horizontal-trailing'  
234-           this .moveNext (); 
235-           break ; 
236-         } 
237-         case  ' vertical-leading'  
238-           this .$refs .headerGrid .tryFocus (); 
239-           e .handled  =  true ; 
240-           break ; 
241-         } 
242-         case  ' vertical-trailing'  
243-           e .handled  =  true ; 
244-           break ; 
245-         } 
246-       } 
247-     }, 
248201  }, 
249202}; 
250203script >
251204
252205<style  lang="postcss">
206+ .vc-nav-header  {
207+   display : flex; 
208+   justify-content : space-between; 
209+ } 
210+ 
253211.vc-nav-arrow  {
254212  display : flex; 
255213  justify-content : center; 
@@ -282,6 +240,7 @@ export default {
282240  border-width : 2 px ; 
283241  border-style : solid; 
284242  border-color : transparent; 
243+   user-select : none; 
285244  &:hover   { 
286245    background-color : var (--gray-900 ); 
287246  } 
@@ -290,6 +249,13 @@ export default {
290249  } 
291250} 
292251
252+ .vc-nav-items  {
253+   display : grid; 
254+   grid-template-columns : repeat (3 , 1 fr); 
255+   grid-row-gap : 2 px ; 
256+   grid-column-gap : 5 px ; 
257+ } 
258+ 
293259.vc-nav-item  {
294260  width : 48 px ; 
295261  text-align : center; 
@@ -301,6 +267,7 @@ export default {
301267  border-width : 2 px ; 
302268  border-style : solid; 
303269  border-radius : var (--rounded ); 
270+   user-select : none; 
304271  &:hover   { 
305272    color : var (--white ); 
306273    background-color : var (--gray-900 ); 
@@ -312,14 +279,10 @@ export default {
312279  & .is-active  { 
313280    color : var (--accent-900 ); 
314281    background : var (--accent-100 ); 
315-     border-color : transparent; 
316282    font-weight : var (--font-bold ); 
317283    box-shadow : var (--shadow ); 
318284  } 
319-   & .is-inactive  { 
320-     border-color : transparent; 
321-   } 
322-   &:is-inactive-current   { 
285+   &:is-current   { 
323286    color : var (--accent-100 ); 
324287    font-weight : var (--bold ); 
325288    border-color : var (--accent-100 ); 
@@ -361,7 +324,7 @@ export default {
361324      color : var (--white ); 
362325      background : var (--accent-500 ); 
363326    } 
364-     & .is-inactive- current  { 
327+     & .is-current  { 
365328      color : var (--accent-600 ); 
366329      border-color : var (--accent-500 ); 
367330    } 
0 commit comments