@@ -734,15 +734,10 @@ export const BCalendar = Vue.extend({
734734 return h ( )
735735 }
736736
737- const isRTL = this . isRTL
737+ const { isLive , isRTL, activeYMD , selectedYMD , safeId } = this
738738 const hideDecadeNav = ! this . showDecadeNav
739739 const todayYMD = formatYMD ( this . getToday ( ) )
740- const selectedYMD = this . selectedYMD
741- const activeYMD = this . activeYMD
742740 const highlightToday = ! this . noHighlightToday
743- const safeId = this . safeId
744- // Flag for making the `aria-live` regions live
745- const isLive = this . isLive
746741 // Pre-compute some IDs
747742 // This should be computed props
748743 const idValue = safeId ( )
@@ -757,7 +752,7 @@ export const BCalendar = Vue.extend({
757752 let $header = h (
758753 'output' ,
759754 {
760- staticClass : 'd-block text-center rounded border small p-1 mb-1 ' ,
755+ staticClass : 'form-control form-control-sm text-center ' ,
761756 class : { 'text-muted' : this . disabled , readonly : this . readonly || this . disabled } ,
762757 attrs : {
763758 id : idValue ,
@@ -784,20 +779,22 @@ export const BCalendar = Vue.extend({
784779 // We use `bdi` elements here in case the label doesn't match the locale
785780 // Although IE 11 does not deal with <BDI> at all (equivalent to a span)
786781 h ( 'bdi' , { staticClass : 'sr-only' } , ` (${ toString ( this . labelSelected ) } ) ` ) ,
787- h ( 'bdi' , { } , this . formatDateString ( this . selectedDate ) )
782+ h ( 'bdi' , this . formatDateString ( this . selectedDate ) )
788783 ]
789784 : this . labelNoDateSelected || '\u00a0' // ' '
790785 )
791786 $header = h (
792787 'header' ,
793788 {
794- class : this . hideHeader ? 'sr-only' : 'mb-1' ,
789+ staticClass : 'b-calendar-header' ,
790+ class : { 'sr-only' : this . hideHeader } ,
795791 attrs : { title : this . selectedDate ? this . labelSelectedDate || null : null }
796792 } ,
797793 [ $header ]
798794 )
799795
800796 // Content for the date navigation buttons
797+ // TODO: add slots for the nav button content
801798 const $prevDecadeIcon = h ( BIconChevronBarLeft , { props : { shiftV : 0.5 , flipH : isRTL } } )
802799 const $prevYearIcon = h ( BIconChevronDoubleLeft , { props : { shiftV : 0.5 , flipH : isRTL } } )
803800 const $prevMonthIcon = h ( BIconChevronLeft , { props : { shiftV : 0.5 , flipH : isRTL } } )
@@ -811,7 +808,7 @@ export const BCalendar = Vue.extend({
811808 return h (
812809 'button' ,
813810 {
814- staticClass : 'btn btn-sm btn-outline-secondary border-0 flex-fill p-1 mx-1 ' ,
811+ staticClass : 'btn btn-sm btn-outline-secondary border-0 flex-fill' ,
815812 class : { disabled : btnDisabled } ,
816813 attrs : {
817814 title : label || null ,
@@ -830,7 +827,7 @@ export const BCalendar = Vue.extend({
830827 const $nav = h (
831828 'div' ,
832829 {
833- staticClass : 'b-calendar-nav d-flex mx-n1 mb-1 ' ,
830+ staticClass : 'b-calendar-nav d-flex' ,
834831 attrs : {
835832 id : idNav ,
836833 role : 'group' ,
@@ -901,7 +898,7 @@ export const BCalendar = Vue.extend({
901898 'header' ,
902899 {
903900 key : 'grid-caption' ,
904- staticClass : 'text-center font-weight-bold p-1 m-0 ' ,
901+ staticClass : 'b-calendar-grid-caption text-center font-weight-bold' ,
905902 class : { 'text-muted' : this . disabled } ,
906903 attrs : {
907904 id : idGridCaption ,
@@ -915,7 +912,10 @@ export const BCalendar = Vue.extend({
915912 // Calendar weekday headings
916913 const $gridWeekDays = h (
917914 'div' ,
918- { staticClass : 'row no-gutters border-bottom' , attrs : { 'aria-hidden' : 'true' } } ,
915+ {
916+ staticClass : 'b-calendar-grid-weekdays row no-gutters border-bottom' ,
917+ attrs : { 'aria-hidden' : 'true' }
918+ } ,
919919 this . calendarHeadings . map ( ( d , idx ) => {
920920 return h (
921921 'small' ,
@@ -1019,7 +1019,7 @@ export const BCalendar = Vue.extend({
10191019 const $gridHelp = h (
10201020 'footer' ,
10211021 {
1022- staticClass : 'border-top small text-muted text-center bg-light' ,
1022+ staticClass : 'b-calendar-grid-help border-top small text-muted text-center bg-light' ,
10231023 attrs : {
10241024 id : idGridHelp
10251025 }
@@ -1031,7 +1031,7 @@ export const BCalendar = Vue.extend({
10311031 'div' ,
10321032 {
10331033 ref : 'grid' ,
1034- staticClass : 'form-control h-auto text-center p-0 mb-0 ' ,
1034+ staticClass : 'b-calendar-grid form-control h-auto text-center' ,
10351035 attrs : {
10361036 id : idGrid ,
10371037 role : 'application' ,
@@ -1057,13 +1057,12 @@ export const BCalendar = Vue.extend({
10571057
10581058 // Optional bottom slot
10591059 let $slot = this . normalizeSlot ( 'default' )
1060- $slot = $slot ? h ( 'footer' , { staticClass : 'mt-2 ' } , $slot ) : h ( )
1060+ $slot = $slot ? h ( 'footer' , { staticClass : 'b-calendar-footer ' } , $slot ) : h ( )
10611061
10621062 const $widget = h (
10631063 'div' ,
10641064 {
10651065 staticClass : 'b-calendar-inner' ,
1066- class : this . block ? 'd-block' : 'd-inline-block' ,
10671066 style : this . block ? { } : { width : this . width } ,
10681067 attrs : {
10691068 id : idWidget ,
@@ -1093,15 +1092,6 @@ export const BCalendar = Vue.extend({
10931092 )
10941093
10951094 // Wrap in an outer div that can be styled
1096- return h (
1097- 'div' ,
1098- {
1099- staticClass : 'b-calendar' ,
1100- // We use a style here rather than class `d-inline-block` so that users can
1101- // override the display value (`d-*` classes use the `!important` flag)
1102- style : this . block ? { } : { display : 'inline-block' }
1103- } ,
1104- [ $widget ]
1105- )
1095+ return h ( 'div' , { staticClass : 'b-calendar' , class : { 'd-block' : this . block } } , [ $widget ] )
11061096 }
11071097} )
0 commit comments