@@ -56,19 +56,19 @@ const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`
56
56
const EVENT_LOAD_DATA_API = `load${ EVENT_KEY } ${ DATA_API_KEY } `
57
57
const EVENT_CLICK_DATA_API = `click${ EVENT_KEY } ${ DATA_API_KEY } `
58
58
59
- const CLASS_NAME_CALENDAR = 'calendar'
60
59
const CLASS_NAME_CALENDAR_CELL = 'calendar-cell'
61
60
const CLASS_NAME_CALENDAR_CELL_INNER = 'calendar-cell-inner'
62
61
const CLASS_NAME_CALENDAR_ROW = 'calendar-row'
62
+ const CLASS_NAME_CALENDARS = 'calendars'
63
63
64
64
const SELECTOR_BTN_DOUBLE_NEXT = '.btn-double-next'
65
65
const SELECTOR_BTN_DOUBLE_PREV = '.btn-double-prev'
66
66
const SELECTOR_BTN_MONTH = '.btn-month'
67
67
const SELECTOR_BTN_NEXT = '.btn-next'
68
68
const SELECTOR_BTN_PREV = '.btn-prev'
69
69
const SELECTOR_BTN_YEAR = '.btn-year'
70
+ const SELECTOR_CALENDAR = '.calendar'
70
71
const SELECTOR_CALENDAR_CELL = '.calendar-cell'
71
- const SELECTOR_CALENDAR_PANEL = '.calendar-panel'
72
72
const SELECTOR_CALENDAR_ROW = '.calendar-row'
73
73
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="calendar"]'
74
74
@@ -207,7 +207,7 @@ class Calendar extends BaseComponent {
207
207
const target = event . target . classList . contains ( CLASS_NAME_CALENDAR_CELL_INNER ) ? event . target . parentElement : event . target
208
208
const date = this . _getDate ( target )
209
209
const cloneDate = new Date ( date )
210
- const index = Manipulator . getDataAttribute ( target . closest ( SELECTOR_CALENDAR_PANEL ) , 'calendar-index' )
210
+ const index = Manipulator . getDataAttribute ( target . closest ( SELECTOR_CALENDAR ) , 'calendar-index' )
211
211
212
212
if ( isDateDisabled ( date , this . _config . minDate , this . _config . maxDate , this . _config . disabledDates ) ) {
213
213
return
@@ -305,7 +305,7 @@ class Calendar extends BaseComponent {
305
305
setTimeout ( ( ) => {
306
306
const _list = SelectorEngine . find (
307
307
'td[tabindex="0"], tr[tabindex="0"]' ,
308
- SelectorEngine . find ( '.calendar-panel ' , this . _element ) . pop ( )
308
+ SelectorEngine . find ( '.calendar' , this . _element ) . pop ( )
309
309
)
310
310
311
311
if ( _list . length && key === ARROW_RIGHT_KEY ) {
@@ -573,7 +573,7 @@ class Calendar extends BaseComponent {
573
573
const month = calendarDate . getMonth ( )
574
574
575
575
const calendarPanelEl = document . createElement ( 'div' )
576
- calendarPanelEl . classList . add ( 'calendar-panel ' )
576
+ calendarPanelEl . classList . add ( 'calendar' )
577
577
578
578
Manipulator . setDataAttribute ( calendarPanelEl , 'calendar-index' , order )
579
579
@@ -724,23 +724,19 @@ class Calendar extends BaseComponent {
724
724
}
725
725
726
726
_createCalendar ( ) {
727
- const calendarsEl = document . createElement ( 'div' )
728
- calendarsEl . classList . add ( 'calendars' )
729
-
730
727
if ( this . _config . selectionType && this . _view === 'days' ) {
731
- calendarsEl . classList . add ( `select-${ this . _config . selectionType } ` )
728
+ this . _element . classList . add ( `select-${ this . _config . selectionType } ` )
732
729
}
733
730
734
731
if ( this . _config . showWeekNumber ) {
735
- calendarsEl . classList . add ( 'show-week-numbers' )
732
+ this . _element . classList . add ( 'show-week-numbers' )
736
733
}
737
734
738
735
for ( const [ index , _ ] of Array . from ( { length : this . _config . calendars } ) . entries ( ) ) {
739
- calendarsEl . append ( this . _createCalendarPanel ( index ) )
736
+ this . _element . append ( this . _createCalendarPanel ( index ) )
740
737
}
741
738
742
- this . _element . classList . add ( CLASS_NAME_CALENDAR )
743
- this . _element . append ( calendarsEl )
739
+ this . _element . classList . add ( CLASS_NAME_CALENDARS )
744
740
}
745
741
746
742
_updateCalendar ( callback ) {
0 commit comments