UNPKG

angular-mydatepicker

Version:
1 lines 90.2 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/forms"),require("@angular/core")):"function"==typeof define&&define.amd?define("angular-mydatepicker",["exports","@angular/common","@angular/forms","@angular/core"],t):t(e["angular-mydatepicker"]={},e.ng.common,e.ng.forms,e.ng.core)}(this,function(e,t,a,d){"use strict";function S(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],i=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var i,n,o=a.call(e),r=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)r.push(i.value)}catch(s){n={error:s}}finally{try{i&&!i.done&&(a=o["return"])&&a.call(o)}finally{if(n)throw n.error}}return r}var h={enter:13,esc:27,space:32,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40,tab:9,shift:16};h[h.enter]="enter",h[h.esc]="esc",h[h.space]="space",h[h.leftArrow]="leftArrow",h[h.upArrow]="upArrow",h[h.rightArrow]="rightArrow",h[h.downArrow]="downArrow",h[h.tab]="tab",h[h.shift]="shift";var i={enter:"Enter",esc:"Escape|Esc",space:" |Spacebar",leftArrow:"ArrowLeft|Left",upArrow:"ArrowUp|Up",rightArrow:"ArrowRight|Right",downArrow:"ArrowDown|Down",tab:"Tab",shift:"Shift"},M="d",n="dd",k="m",o="mm",T="mmm",x="yyyy",O="##",V="st",B="nd",E="rd",s="_",l="su",A="mo",c="tu",y="we",I="th",u="fr",p="sa",m="0",R="",D="click",g="keyup",f="blur",b="disabled",v="body",w="value",C="options",F="defaultMonth",L="locale",N="object",Y="px",H="style",P="innerHTML",W="opts",J="yearsDuration",z="years",K="visibleMonth",j="selectMonth",G="selectYear",U="prevViewDisabled",Q="nextViewDisabled",Z="dates",_="weekDays",q="selectedDate",X="selectedDateRange",$="months",ee="animationend",te="myDpAnimation",ae=["Fade","ScaleTop","ScaleCenter","Rotate","FlipDiagonal","Own"],ie="tabindex",ne="table tbody tr td:not(.myDpDaycellWeekNbr)",oe=(re.prototype.isDateValid=function(e,t,a){var i,n=t.dateFormat,o=t.minYear,r=t.maxYear,s=t.monthLabels,l=this.resetDate(),d=[31,28,31,30,31,30,31,31,30,31,30,31],h=-1!==n.indexOf(T),c=n.match(/[^(d#my)]{1,}/g);if(!e||e===R)return l;var c=this.getDateValue(e,n,c),y=0,u=0,p=0;try{for(var m=S(c),D=m.next();!D.done;D=m.next()){var g=D.value;if(-1!=g.format.indexOf(O)){var f=parseInt(g.value.replace(/\D/g,"")),b=g.value.replace(/[0-9]/g,"");if(this.getOrdinal(f)!==b)return l;g.value=g.value.replace(V,R).replace(B,R).replace(E,R).replace(I,R),g.format=g.format.replace(O,R)}var v=g.value,A=g.format;if(v&&/^\d+$/.test(v)&&0===Number(v))return l;-1!==A.indexOf(x)?y=this.getNumberByValue(g):-1!==A.indexOf(k)?u=h?this.getMonthNumberByMonthName(g,s):this.getNumberByValue(g):-1!==A.indexOf(M)&&(p=this.getNumberByValue(g))}}catch(C){w={error:C}}finally{try{D&&!D.done&&(i=m["return"])&&i.call(m)}finally{if(w)throw w.error}}var w=a.validateDisabledDates,a=a.selectedValue,y=0===y&&a?a.year:y,u=0===u&&a?a.month:u,p=0===p&&a?a.day:p,a=this.getToday();if(0!==y||0===u&&0===p||(y=a.year),0!==u||0===y&&0===p||(u=a.month),0!==p||0===y&&0===u||(p=a.day),-1===u||-1===p||-1===y)return l;if(y<o||r<y||u<1||12<u)return l;r={year:y,month:u,day:p};return w&&this.isDisabledDate(r,t).disabled?l:((y%400==0||y%100!=0&&y%4==0)&&(d[1]=29),p<1||p>d[u-1]?l:r)},re.prototype.isDateValidDateRange=function(e,t,a){var i,n,o={begin:this.resetDate(),end:this.resetDate()};return e&&e.length&&((i=e.split(t.dateRangeDatesDelimiter))&&2===i.length&&(e=(n=r(i,2))[0],i=n[1],(n=a.selectedValue)&&(a.selectedValue=n.begin),e=this.isDateValid(e,t,a),this.isInitializedDate(e)&&(n&&(a.selectedValue=n.end),a=this.isDateValid(i,t,a),this.isInitializedDate(a)&&this.isDateSameOrEarlier(e,a)&&(o={begin:e,end:a})))),o},re.prototype.getDateValue=function(e,t,a){var i,n=R;if(a)try{for(var o=S(a),r=o.next();!r.done;r=o.next()){var s=r.value;-1===n.indexOf(s)&&(n+=s)}}catch(u){l={error:u}}finally{try{r&&!r.done&&(i=o["return"])&&i.call(o)}finally{if(l)throw l.error}}for(var l=new RegExp("["+n+"]"),d=e.split(l),h=t.split(l),c=[],y=0;y<h.length;y++)-1!==h[y].indexOf(x)&&c.push({value:d[y],format:h[y]}),-1!==h[y].indexOf(k)&&c.push({value:d[y],format:h[y]}),-1!==h[y].indexOf(M)&&c.push({value:d[y],format:h[y]});return c},re.prototype.getMonthNumberByMonthName=function(e,t){if(e.value)for(var a=1;a<=12;a++)if(e.value.toLowerCase()===t[a].toLowerCase())return a;return-1},re.prototype.getNumberByValue=function(e){if(!/^\d+$/.test(e.value))return-1;var t=Number(e.value);return t=1===e.format.length&&1!==e.value.length&&t<10||1===e.format.length&&2!==e.value.length&&10<=t||2===e.format.length&&2<e.value.length?-1:t},re.prototype.parseDefaultMonth=function(e){var t={monthTxt:R,monthNbr:0,year:0};return e!==R&&(e=e.split(e.match(/[^0-9]/)[0]),t.monthNbr=2===e[0].length?Number(e[0]):Number(e[1]),t.year=2===e[0].length?Number(e[1]):Number(e[0])),t},re.prototype.isDisabledDate=function(e,t){var a,i,n,o,r=t.minYear,s=t.maxYear,l=t.disableUntil,d=t.disableSince,h=t.disableWeekends,c=t.disableDates,y=t.disableDateRanges,u=t.disableWeekdays,t=t.enableDates;if(this.dateMatchToDates(e,t))return this.getDisabledValue(!1,R);if(e.year<r&&12===e.month||e.year>s&&1===e.month)return this.getDisabledValue(!0,R);if(c.find(function(e){return e.dates}))try{for(var p=S(c),m=p.next();!m.done;m=p.next()){var D=m.value;if(this.dateMatchToDates(e,D.dates))return this.getDisabledValue(!0,D.styleClass)}}catch(A){a={error:A}}finally{try{m&&!m.done&&(i=p["return"])&&i.call(p)}finally{if(a)throw a.error}}else if(this.dateMatchToDates(e,c))return this.getDisabledValue(!0,R);if(this.isDisabledByDisableUntil(e,l))return this.getDisabledValue(!0,R);if(this.isDisabledByDisableSince(e,d))return this.getDisabledValue(!0,R);if(h){h=this.getDayNumber(e);if(0===h||6===h)return this.getDisabledValue(!0,R)}var g=this.getDayNumber(e);if(0<u.length)try{for(var f=S(u),b=f.next();!b.done;b=f.next()){var v=b.value;if(g===this.getWeekdayIndex(v))return this.getDisabledValue(!0,R)}}catch(w){n={error:w}}finally{try{b&&!b.done&&(o=f["return"])&&o.call(f)}finally{if(n)throw n.error}}return this.isDisabledByDisableDateRange(e,e,y)?this.getDisabledValue(!0,R):this.getDisabledValue(!1,R)},re.prototype.getDisabledValue=function(e,t){return{disabled:e,styleClass:t}},re.prototype.dateMatchToDates=function(e,t){var a,i;try{for(var n=S(t),o=n.next();!o.done;o=n.next()){var r=o.value;if(!(0!==r.year&&r.year!==e.year||0!==r.month&&r.month!==e.month||r.day!==e.day))return!0}}catch(s){a={error:s}}finally{try{o&&!o.done&&(i=n["return"])&&i.call(n)}finally{if(a)throw a.error}}return!1},re.prototype.isDisabledMonth=function(e,t,a){var i=a.disableUntil,n=a.disableSince,o=a.disableDateRanges,r=a.enableDates,a={year:e,month:t,day:this.datesInMonth(t,e)},t={year:e,month:t,day:1};return!this.isDatesEnabled(t,a,r)&&(!!this.isDisabledByDisableUntil(a,i)||(!!this.isDisabledByDisableSince(t,n)||!!this.isDisabledByDisableDateRange(t,a,o)))},re.prototype.isDisabledYear=function(e,t){var a=t.disableUntil,i=t.disableSince,n=t.disableDateRanges,o=t.enableDates,r=t.minYear,s=t.maxYear,l={year:e,month:12,day:31},t={year:e,month:1,day:1};return!this.isDatesEnabled(t,l,o)&&(!!this.isDisabledByDisableUntil(l,a)||(!!this.isDisabledByDisableSince(t,i)||(!!this.isDisabledByDisableDateRange(t,l,n)||(e<r||s<e))))},re.prototype.isDisabledByDisableUntil=function(e,t){return this.isInitializedDate(t)&&this.getTimeInMilliseconds(e)<=this.getTimeInMilliseconds(t)},re.prototype.isDisabledByDisableSince=function(e,t){return this.isInitializedDate(t)&&this.getTimeInMilliseconds(e)>=this.getTimeInMilliseconds(t)},re.prototype.isPastDatesEnabled=function(e,t){var a,i;try{for(var n=S(t),o=n.next();!o.done;o=n.next()){var r=o.value;if(this.getTimeInMilliseconds(r)<=this.getTimeInMilliseconds(e))return!0}}catch(s){a={error:s}}finally{try{o&&!o.done&&(i=n["return"])&&i.call(n)}finally{if(a)throw a.error}}return!1},re.prototype.isFutureDatesEnabled=function(e,t){var a,i;try{for(var n=S(t),o=n.next();!o.done;o=n.next()){var r=o.value;if(this.getTimeInMilliseconds(r)>=this.getTimeInMilliseconds(e))return!0}}catch(s){a={error:s}}finally{try{o&&!o.done&&(i=n["return"])&&i.call(n)}finally{if(a)throw a.error}}return!1},re.prototype.isDatesEnabled=function(e,t,a){var i,n;try{for(var o=S(a),r=o.next();!r.done;r=o.next()){var s=r.value;if(this.getTimeInMilliseconds(s)>=this.getTimeInMilliseconds(e)&&this.getTimeInMilliseconds(s)<=this.getTimeInMilliseconds(t))return!0}}catch(l){i={error:l}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return!1},re.prototype.isDisabledByDisableDateRange=function(e,t,a){var i,n,o=this.getTimeInMilliseconds(e),r=this.getTimeInMilliseconds(t);try{for(var s=S(a),l=s.next();!l.done;l=s.next()){var d=l.value;if(this.isInitializedDate(d.begin)&&this.isInitializedDate(d.end)&&o>=this.getTimeInMilliseconds(d.begin)&&r<=this.getTimeInMilliseconds(d.end))return!0}}catch(h){i={error:h}}finally{try{l&&!l.done&&(n=s["return"])&&n.call(s)}finally{if(i)throw i.error}}return!1},re.prototype.isMarkedDate=function(e,t){var a,i=t.markDates,t=t.markWeekends;try{for(var n=S(i),o=n.next();!o.done;o=n.next()){var r=o.value;if(this.dateMatchToDates(e,r.dates))return this.getMarkedValue(!0,r.color,r.styleClass)}}catch(l){s={error:l}}finally{try{o&&!o.done&&(a=n["return"])&&a.call(n)}finally{if(s)throw s.error}}if(t&&t.marked){var s=this.getDayNumber(e);if(0===s||6===s)return this.getMarkedValue(!0,t.color,R)}return this.getMarkedValue(!1,R,R)},re.prototype.getMarkedValue=function(e,t,a){return{marked:e,color:t||R,styleClass:a||R}},re.prototype.isHighlightedDate=function(e,t){var a=t.sunHighlight,i=t.satHighlight,n=t.highlightDates,t=this.getDayNumber(e);return!!(a&&0===t||i&&6===t)||!!this.dateMatchToDates(e,n)},re.prototype.getWeekNumber=function(e){e=new Date(e.year,e.month-1,e.day,0,0,0,0);return e.setDate(e.getDate()+(0===e.getDay()?-3:4-e.getDay())),Math.round((e.getTime()-new Date(e.getFullYear(),0,4).getTime())/864e5/7)+1},re.prototype.getDateModel=function(e,t,a,i,n,o){void 0===o&&(o=R);var r=null,s=null;return e?r={date:e,jsDate:this.myDateToJsDate(e),formatted:o.length?o:this.formatDate(e,a,i),epoc:this.getEpocTime(e)}:s={beginDate:t.begin,beginJsDate:this.myDateToJsDate(t.begin),beginEpoc:this.getEpocTime(t.begin),endDate:t.end,endJsDate:this.myDateToJsDate(t.end),endEpoc:this.getEpocTime(t.end),formatted:this.formatDate(t.begin,a,i)+n+this.formatDate(t.end,a,i)},{isRange:null===e,singleDate:r,dateRange:s}},re.prototype.formatDate=function(e,t,a){var i=t.replace(x,String(e.year)),i=-1!==t.indexOf(T)?i.replace(T,a[e.month]):-1!==t.indexOf(o)?i.replace(o,this.preZero(e.month)):i.replace(k,String(e.month));return i=-1!==t.indexOf(n)?i.replace(n,this.preZero(e.day)):i.replace(M,String(e.day)),i=-1!==t.indexOf(O)?i.replace(O,this.getOrdinal(e.day)):i},re.prototype.getOrdinal=function(e){if(3<e&&e<21)return I;switch(e%10){case 1:return V;case 2:return B;case 3:return E;default:return I}},re.prototype.getFormattedDate=function(e){return(e.isRange?e.dateRange:e.singleDate).formatted},re.prototype.preZero=function(e){return e<10?m+e:String(e)},re.prototype.isInitializedDate=function(e){return 0!==e.year&&0!==e.month&&0!==e.day},re.prototype.isDateEarlier=function(e,t){return this.getTimeInMilliseconds(e)<this.getTimeInMilliseconds(t)},re.prototype.isDateSameOrEarlier=function(e,t){return this.getTimeInMilliseconds(e)<=this.getTimeInMilliseconds(t)},re.prototype.isDateSame=function(e,t){return this.getTimeInMilliseconds(e)===this.getTimeInMilliseconds(t)},re.prototype.isDateRangeBeginOrEndSame=function(e,t){t=this.getTimeInMilliseconds(t);return this.getTimeInMilliseconds(e.begin)===t||this.getTimeInMilliseconds(e.end)===t},re.prototype.isDateRangeBegin=function(e,t){t=this.getTimeInMilliseconds(t);return this.getTimeInMilliseconds(e.begin)===t},re.prototype.isDateRangeEnd=function(e,t){t=this.getTimeInMilliseconds(t);return this.getTimeInMilliseconds(e.end)===t},re.prototype.isDateInRange=function(e,t){return!(!this.isInitializedDate(t.begin)||!this.isInitializedDate(t.end))&&(this.isDateSameOrEarlier(t.begin,e)&&this.isDateSameOrEarlier(e,t.end))},re.prototype.resetDate=function(){return{year:0,month:0,day:0}},re.prototype.getTimeInMilliseconds=function(e){return this.myDateToJsDate(e).getTime()},re.prototype.getToday=function(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},re.prototype.getDayNumber=function(e){return new Date(e.year,e.month-1,e.day,0,0,0,0).getDay()},re.prototype.getWeekdayIndex=function(e){return this.weekDays.indexOf(e)},re.prototype.getEpocTime=function(e){return Math.round(this.getTimeInMilliseconds(e)/1e3)},re.prototype.jsDateToMyDate=function(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},re.prototype.myDateToJsDate=function(e){var t=e.year,a=e.month,e=e.day;return new Date(t,a-1,e,0,0,0,0)},re.prototype.datesInMonth=function(e,t){return new Date(t,e,0).getDate()},re.prototype.datesInPrevMonth=function(e,t){e=this.getJsDate(t,e,1);return e.setMonth(e.getMonth()-1),this.datesInMonth(e.getMonth()+1,e.getFullYear())},re.prototype.getJsDate=function(e,t,a){return new Date(e,t-1,a,0,0,0,0)},re.prototype.getSelectedValue=function(e,t){return e?t?{begin:e.beginDate,end:e.endDate}:e.date:null},re.prototype.getKeyCodeFromEvent=function(e){e=e.key||e.keyCode||e.which;return this.checkKeyName(e,i.enter)||e===h.enter?h.enter:this.checkKeyName(e,i.esc)||e===h.esc?h.esc:this.checkKeyName(e,i.space)||e===h.space?h.space:this.checkKeyName(e,i.leftArrow)||e===h.leftArrow?h.leftArrow:this.checkKeyName(e,i.upArrow)||e===h.upArrow?h.upArrow:this.checkKeyName(e,i.rightArrow)||e===h.rightArrow?h.rightArrow:this.checkKeyName(e,i.downArrow)||e===h.downArrow?h.downArrow:this.checkKeyName(e,i.tab)||e===h.tab?h.tab:this.checkKeyName(e,i.shift)||e===h.shift?h.shift:null},re.prototype.checkKeyName=function(e,t){return-1!==t.split("|").indexOf(e)},re.decorators=[{type:d.Injectable}],re);function re(){this.weekDays=[l,A,c,y,I,u,p]}var se={prev:1,curr:2,next:3};se[se.prev]="prev",se[se.curr]="curr",se[se.next]="next";var le={Date:1,Month:2,Year:3};le[le.Date]="Date",le[le.Month]="Month",le[le.Year]="Year";var de={None:0,Fade:1,ScaleTop:2,ScaleCenter:3,Rotate:4,FlipDiagonal:5,Own:6};de[de.None]="None",de[de.Fade]="Fade",de[de.ScaleTop]="ScaleTop",de[de.ScaleCenter]="ScaleCenter",de[de.Rotate]="Rotate",de[de.FlipDiagonal]="FlipDiagonal",de[de.Own]="Own";var he={PrevBtnClick:1,NextBtnClick:2,MonthBtnClick:3,YearBtnClick:4};he[he.PrevBtnClick]="PrevBtnClick",he[he.NextBtnClick]="NextBtnClick",he[he.MonthBtnClick]="MonthBtnClick",he[he.YearBtnClick]="YearBtnClick";var ce=(ye.prototype.ngAfterViewInit=function(){var e=this.opts,t=e.stylesData,a=e.calendarAnimation,i=e.inline;t.styles.length&&(e=this.renderer.createElement(H),this.renderer.appendChild(e,this.renderer.createText(t.styles)),this.renderer.appendChild(this.styleEl.nativeElement,e)),a["in"]!==de.None&&this.setCalendarAnimation(a,!0),i||this.focusToSelector()},ye.prototype.ngOnDestroy=function(){this.clickListener()},ye.prototype.initializeComponent=function(e,t,a,i,n,o,r,s,l,d){this.opts=e,this.selectorPos=n,this.dateChanged=o,this.calendarViewChanged=r,this.rangeDateSelection=s,this.viewActivated=l,this.closedByEsc=d;var l=e.defaultView,d=e.firstDayOfWeek,h=e.dayLabels;if(this.weekDays.length=0,this.dayIdx=this.weekDayOpts.indexOf(d),-1!==this.dayIdx)for(var c=this.dayIdx,y=0;y<this.weekDayOpts.length;y++)this.weekDays.push(h[this.weekDayOpts[c]]),c=this.weekDayOpts[c]===p?0:c+1;this.initializeView(t,a,i),this.setCalendarVisibleMonth(),this.setDefaultView(l)},ye.prototype.initializeView=function(e,t,a){var i=this.opts.dateRange,n=this.utilService.getToday();this.selectedMonth={monthNbr:n.month,year:n.year};var o=e.defMonth,r=e.overrideSelection;o&&o.length&&(this.selectedMonth=this.utilService.parseDefaultMonth(o));n=null;i?(n={validateDisabledDates:!1,selectedValue:this.utilService.getSelectedValue(t,i)},o=(e=this.utilService.isDateValidDateRange(a,this.opts,n)).begin,e=e.end,this.utilService.isInitializedDate(o)&&this.utilService.isInitializedDate(e)&&(this.selectedDateRange={begin:o,end:e},r||(this.selectedMonth={monthNbr:o.month,year:o.year}))):(n={validateDisabledDates:!1,selectedValue:this.utilService.getSelectedValue(t,i)},n=this.utilService.isDateValid(a,this.opts,n),this.utilService.isInitializedDate(n)&&(this.selectedDate=n,r||(this.selectedMonth={monthNbr:n.month,year:n.year})))},ye.prototype.refreshComponent=function(e,t,a,i){e=(this.opts=e).defaultView;this.initializeView(t,a,i),this.setCalendarVisibleMonth(),this.setDefaultView(e)},ye.prototype.headerAction=function(e){var t=this.opts,a=t.monthSelector,t=t.yearSelector;e===he.PrevBtnClick?this.prevViewDisabled||this.onPrevNavigateBtnClicked():e===he.NextBtnClick?this.nextViewDisabled||this.onNextNavigateBtnClicked():e===he.MonthBtnClick?a&&this.onMonthViewBtnClicked():e===he.YearBtnClick&&t&&this.onYearViewBtnClicked()},ye.prototype.setDefaultView=function(e){e===le.Month?this.monthViewBtnClicked():e===le.Year&&this.yearViewBtnClicked()},ye.prototype.setCalendarAnimation=function(e,t){var a=this.selectorEl.nativeElement,i=this.renderer,n=te+ae[e["in"]-1];t?i.addClass(a,n+"In"):(e=te+ae[e.out-1],i.removeClass(a,n+"In"),i.addClass(a,e+"Out"))},ye.prototype.resetDateValue=function(){this.opts.dateRange?(this.selectedDateRange.begin=this.utilService.resetDate(),this.selectedDateRange.end=this.utilService.resetDate()):this.selectedDate=this.utilService.resetDate()},ye.prototype.clearDate=function(){var e=this.utilService.getToday(),t=e.month,e=e.year;this.selectedMonth={monthNbr:t,year:e},this.resetDateValue(),this.setCalendarVisibleMonth(),this.resetMonthYearSelect()},ye.prototype.resetMonthYearSelect=function(){this.selectMonth=!1,this.selectYear=!1},ye.prototype.onMonthViewBtnClicked=function(){this.viewChanged=!0,this.monthViewBtnClicked()},ye.prototype.monthViewBtnClicked=function(){var e,t;this.selectMonth=!this.selectMonth,this.selectYear=!1,this.cdr.detectChanges(),this.selectMonth?this.generateMonths():(e=(t=this.selectedMonth).year,t=t.monthNbr,this.visibleMonth={monthTxt:this.opts.monthLabels[t],monthNbr:t,year:e},this.generateCalendar(t,e,!0))},ye.prototype.onMonthCellClicked=function(e){this.viewChanged=!0;var t=this.visibleMonth,a=t.year,t=t.monthNbr,t=e.nbr!==t;this.visibleMonth={monthTxt:this.opts.monthLabels[e.nbr],monthNbr:e.nbr,year:a},this.selectedMonth.year=a,this.generateCalendar(e.nbr,a,t),this.selectMonth=!1,this.focusToSelector()},ye.prototype.onMonthCellKeyDown=function(e){var t=this.getSourceRowAndColumnFromEvent(e),a=t.sourceRow,i=t.sourceCol,t=this.getTargetFocusRowAndColumn(e,a,i,3,2),e=t.moveFocus,a=t.targetRow,i=t.targetCol,t=t.direction;e&&this.focusCellElement(k,a,i,t,2)},ye.prototype.onYearViewBtnClicked=function(){this.viewChanged=!0,this.yearViewBtnClicked()},ye.prototype.yearViewBtnClicked=function(){var e,t;this.selectYear=!this.selectYear,this.selectMonth=!1,this.cdr.detectChanges(),this.selectYear?this.generateYears(this.visibleMonth.year):(e=(t=this.selectedMonth).year,t=t.monthNbr,this.visibleMonth={monthTxt:this.opts.monthLabels[t],monthNbr:t,year:e},this.generateCalendar(t,e,!0))},ye.prototype.onYearCellClicked=function(e){this.viewChanged=!0;var t=this.visibleMonth,a=t.year,i=t.monthNbr,t=t.monthTxt,a=e.year!==a;this.visibleMonth={monthTxt:t,monthNbr:i,year:e.year},this.selectedMonth.year=e.year,this.generateCalendar(i,e.year,a),this.selectYear=!1,this.focusToSelector()},ye.prototype.onYearCellKeyDown=function(e){var t=this.getSourceRowAndColumnFromEvent(e),a=t.sourceRow,i=t.sourceCol,t=this.getTargetFocusRowAndColumn(e,a,i,4,4),e=t.moveFocus,a=t.targetRow,i=t.targetCol,t=t.direction;e&&this.focusCellElement("y",a,i,t,4)},ye.prototype.generateMonths=function(){var e=this.utilService.getToday();this.months.length=0;for(var t=this.visibleMonth,a=t.year,i=t.monthNbr,t=this.opts,n=t.rtl,o=t.monthLabels,r=0,s=1;s<=12;s+=3){for(var l=[],d=n?2:0,h=s;h<s+3;h++){var c=this.utilService.isDisabledMonth(a,h,this.opts);l.push({nbr:h,year:a,name:o[h],currMonth:h===e.month&&a===e.year,selected:h===i&&a===this.selectedMonth.year,disabled:c,row:r,col:n?d--:d++})}r++,this.months.push(l)}this.setMonthViewHeaderBtnDisabledState(a)},ye.prototype.generateYears=function(e){var t=this.opts,a=t.minYear,i=t.maxYear,n=t.rtl,o=i<e+25?i-24:e<a?a:e-12,r=this.visibleMonth.year;this.years.length=0;for(var s=this.utilService.getToday(),l=0,d=o;d<o+25;d+=5){for(var h=[],c=n?4:0,y=d;y<d+5;y++){var u=this.utilService.isDisabledYear(y,this.opts);h.push({year:y,currYear:y===s.year,selected:y===r,disabled:u,row:l,col:n?c--:c++})}l++,this.years.push(h)}a=this.getYearValueByRowAndCol(0,0),e=a+24;this.yearsDuration=(n?e:a)+" - "+(n?a:e),this.setYearViewHeaderBtnDisabledState(a,e)},ye.prototype.onTodayFooterClicked=function(){var e=this.utilService.getToday();this.selectDate(e)},ye.prototype.getYearValueByRowAndCol=function(e,t){var a=this.years;return(a&&0!==a.length?a[e][t]:this.utilService.getToday()).year},ye.prototype.setCalendarVisibleMonth=function(){var e=this.selectedMonth,t=e.year,e=e.monthNbr;this.visibleMonth={monthTxt:this.opts.monthLabels[e],monthNbr:e,year:t},this.generateCalendar(e,t,!0)},ye.prototype.onViewActivated=function(e){this.viewActivated(e)},ye.prototype.onPrevNavigateBtnClicked=function(){this.selectMonth||this.selectYear?this.selectMonth?(this.visibleMonth.year--,this.generateMonths()):this.selectYear&&this.generateYears(this.getYearValueByRowAndCol(2,2)-25):this.setDateViewMonth(!1)},ye.prototype.onNextNavigateBtnClicked=function(){this.selectMonth||this.selectYear?this.selectMonth?(this.visibleMonth.year++,this.generateMonths()):this.selectYear&&this.generateYears(this.getYearValueByRowAndCol(2,2)+25):this.setDateViewMonth(!0)},ye.prototype.setDateViewMonth=function(e){var t=e?1:-1,a=this.visibleMonth,e=a.year,a=a.monthNbr,a=this.utilService.getJsDate(e,a,1);a.setMonth(a.getMonth()+t);t=a.getFullYear(),a=a.getMonth()+1;this.visibleMonth={monthTxt:this.opts.monthLabels[a],monthNbr:a,year:t},this.generateCalendar(a,t,!0)},ye.prototype.onCloseSelector=function(e){this.utilService.getKeyCodeFromEvent(e)===h.esc&&this.closedByEsc()},ye.prototype.onDayCellClicked=function(e){this.selectDate(e.dateObj),this.resetMonthYearSelect()},ye.prototype.onDayCellKeyDown=function(e){var t=this.getSourceRowAndColumnFromEvent(e),a=t.sourceRow,i=t.sourceCol,t=this.getTargetFocusRowAndColumn(e,a,i,5,6),e=t.moveFocus,a=t.targetRow,i=t.targetCol,t=t.direction;e&&this.focusCellElement(M,a,i,t,6)},ye.prototype.getSourceRowAndColumnFromEvent=function(e){var t=0,a=0;return e.target&&e.target.id&&(e=e.target.id.split(s),t=Number(e[1]),a=Number(e[2])),{sourceRow:t,sourceCol:a}},ye.prototype.getTargetFocusRowAndColumn=function(e,t,a,i,n){var o=!0,r=t,s=a,l=!1,e=this.utilService.getKeyCodeFromEvent(e);return e===h.upArrow&&0<t?r--:e===h.downArrow&&t<i?(r++,l=!0):e===h.leftArrow&&0<a?s--:e===h.rightArrow&&a<n?(s++,l=!0):o=!1,{moveFocus:o,targetRow:r,targetCol:s,direction:l}},ye.prototype.focusCellElement=function(e,t,a,i,n){var o=this.selectorEl.nativeElement.querySelector("."+(e+s+t+s+a));o.getAttribute(ie)!==m?(e=this.getCalendarElements(),a=t*(n+1)+a,(i?e.slice(a).find(function(e){return e.getAttribute(ie)===m}):e.slice(0,a).reverse().find(function(e){return e.getAttribute(ie)===m}))||this.selectorEl.nativeElement):o.focus()},ye.prototype.focusToSelector=function(){this.selectorEl.nativeElement.focus()},ye.prototype.getCalendarElements=function(){return Array.from(this.selectorEl.nativeElement.querySelectorAll(ne))},ye.prototype.selectDate=function(e){var t=this.opts,a=t.dateRange,i=t.dateFormat,n=t.monthLabels,o=t.dateRangeDatesDelimiter,r=t.closeSelectorOnDateSelect;a?(t=this.utilService.isInitializedDate(this.selectedDateRange.begin),a=this.utilService.isInitializedDate(this.selectedDateRange.end),t&&a?(this.selectedDateRange.begin=e,this.selectedDateRange.end=this.utilService.resetDate(),this.rangeDateSelection({isBegin:!0,date:e,jsDate:this.utilService.myDateToJsDate(e),dateFormat:i,formatted:this.utilService.formatDate(e,i,n),epoc:this.utilService.getEpocTime(e)})):!t||this.utilService.isDateEarlier(e,this.selectedDateRange.begin)?(this.selectedDateRange.begin=e,this.rangeDateSelection({isBegin:!0,date:e,jsDate:this.utilService.myDateToJsDate(e),dateFormat:i,formatted:this.utilService.formatDate(e,i,n),epoc:this.utilService.getEpocTime(e)})):(this.selectedDateRange.end=e,this.rangeDateSelection({isBegin:!1,date:e,jsDate:this.utilService.myDateToJsDate(e),dateFormat:i,formatted:this.utilService.formatDate(e,i,n),epoc:this.utilService.getEpocTime(e)}),this.dateChanged(this.utilService.getDateModel(null,this.selectedDateRange,i,n,o),r))):(this.selectedDate=e,this.dateChanged(this.utilService.getDateModel(this.selectedDate,null,i,n,o),r))},ye.prototype.monthStartIdx=function(e,t){var a=new Date;a.setDate(1),a.setMonth(t-1),a.setFullYear(e);a=a.getDay()+this.sundayIdx();return 7<=a?a-7:a},ye.prototype.isCurrDay=function(e,t,a,i){return e===i.day&&t===i.month&&a===i.year},ye.prototype.getDayNumber=function(e){var t=e.year,a=e.month,e=e.day;return this.utilService.getJsDate(t,a,e).getDay()},ye.prototype.getWeekday=function(e){return this.weekDayOpts[this.getDayNumber(e)]},ye.prototype.sundayIdx=function(){return 0<this.dayIdx?7-this.dayIdx:0},ye.prototype.generateCalendar=function(e,t,a){this.dates.length=0;for(var i=this.utilService.getToday(),n=this.monthStartIdx(t,e),o=this.utilService.datesInMonth(e,t),r=this.utilService.datesInPrevMonth(e,t),s=1,l=e,d=se.prev,h=this.opts,c=h.rtl,y=h.showWeekNumbers,u=h.firstDayOfWeek,p=1;p<7;p++){var m=c?6:0,D=[];if(1===p){for(var g=r-n+1;g<=r;g++){var f={year:1===e?t-1:t,month:1===e?12:e-1,day:g};D.push({dateObj:f,cmo:d,currDay:this.isCurrDay(g,l-1,t,i),disabledDate:this.utilService.isDisabledDate(f,this.opts),markedDate:this.utilService.isMarkedDate(f,this.opts),highlight:this.utilService.isHighlightedDate(f,this.opts),row:p-1,col:c?m--:m++})}for(var d=se.curr,b=7-D.length,g=0;g<b;g++){f={year:t,month:e,day:s};D.push({dateObj:f,cmo:d,currDay:this.isCurrDay(s,e,t,i),disabledDate:this.utilService.isDisabledDate(f,this.opts),markedDate:this.utilService.isMarkedDate(f,this.opts),highlight:this.utilService.isHighlightedDate(f,this.opts),row:p-1,col:c?m--:m++}),s++}}else for(g=1;g<8;g++){o<s&&(d=se.next,l=e+(s=1));f={year:d===se.next&&12===e?t+1:t,month:d===se.curr?e:d===se.next&&e<12?e+1:1,day:s};D.push({dateObj:f,cmo:d,currDay:this.isCurrDay(s,l,t,i),disabledDate:this.utilService.isDisabledDate(f,this.opts),markedDate:this.utilService.isMarkedDate(f,this.opts),highlight:this.utilService.isHighlightedDate(f,this.opts),row:p-1,col:c?m--:m++}),s++}var v=y&&u===A?this.utilService.getWeekNumber(D[0].dateObj):0;this.dates.push({week:D,weekNbr:v})}this.setDateViewHeaderBtnDisabledState(e,t),a&&this.calendarViewChanged({year:t,month:e,first:{number:1,weekday:this.getWeekday({year:t,month:e,day:1})},last:{number:o,weekday:this.getWeekday({year:t,month:e,day:o})}})},ye.prototype.setDateViewHeaderBtnDisabledState=function(e,t){var a=!1,i=!1,n=this.opts,o=n.disableHeaderButtons,r=n.disableUntil,s=n.disableSince,l=n.enableDates,d=n.minYear,h=n.maxYear,c=n.rtl;o&&(n={year:1===e?t-1:t,month:1===e?12:e-1,day:this.utilService.datesInMonth(1===e?12:e-1,1===e?t-1:t)},o={year:12===e?t+1:t,month:12===e?1:e+1,day:1},a=this.utilService.isDisabledByDisableUntil(n,r)&&!this.utilService.isPastDatesEnabled(n,l),i=this.utilService.isDisabledByDisableSince(o,s)&&!this.utilService.isFutureDatesEnabled(o,l)),this.prevViewDisabled=1===e&&t===d||a,this.nextViewDisabled=12===e&&t===h||i,c&&this.swapHeaderBtnDisabled()},ye.prototype.setMonthViewHeaderBtnDisabledState=function(e){var t=!1,a=!1,i=this.opts,n=i.disableHeaderButtons,o=i.disableUntil,r=i.disableSince,s=i.enableDates,l=i.minYear,d=i.maxYear,h=i.rtl;n&&(i={year:e+1,month:1,day:1},t=this.utilService.isDisabledByDisableUntil(n={year:e-1,month:12,day:31},o)&&!this.utilService.isPastDatesEnabled(n,s),a=this.utilService.isDisabledByDisableSince(i,r)&&!this.utilService.isFutureDatesEnabled(i,s)),this.prevViewDisabled=e===l||t,this.nextViewDisabled=e===d||a,h&&this.swapHeaderBtnDisabled()},ye.prototype.setYearViewHeaderBtnDisabledState=function(e,t){var a=!1,i=!1,n=this.opts,o=n.disableHeaderButtons,r=n.disableUntil,s=n.disableSince,l=n.enableDates,d=n.minYear,h=n.maxYear,c=n.rtl;o&&(n={year:t+1,month:1,day:1},a=this.utilService.isDisabledByDisableUntil(o={year:e-1,month:12,day:31},r)&&!this.utilService.isPastDatesEnabled(o,l),i=this.utilService.isDisabledByDisableSince(n,s)&&!this.utilService.isFutureDatesEnabled(n,l)),this.prevViewDisabled=e<=d||a,this.nextViewDisabled=h<=t||i,c&&this.swapHeaderBtnDisabled()},ye.prototype.swapHeaderBtnDisabled=function(){var e=r([this.nextViewDisabled,this.prevViewDisabled],2);this.prevViewDisabled=e[0],this.nextViewDisabled=e[1]},ye.decorators=[{type:d.Component,args:[{selector:"lib-angular-mydatepicker-calendar",template:'<span #styleEl></span>\n<div class="ng-mydp {{opts.stylesData?.selector || \'\'}}">\n <div class="myDpSelector" #selectorEl \n [libAngularMyDatePickerCalendar]="{inline: opts.inline, selectorWidth: opts.selectorWidth, selectorHeight: opts.selectorHeight, selectorPos: selectorPos}" \n [ngClass]="{\'myDpSelectorArrow\': opts.showSelectorArrow, \'myDpSelectorArrowLeft\': opts.showSelectorArrow && !opts.alignSelectorRight, \n \'myDpSelectorArrowRight\': opts.showSelectorArrow&&opts.alignSelectorRight, \'myDpSelectorAbsolute\': !opts.inline, \'myDpSelectorPosInitial\': opts.inline}" \n (keyup)="onCloseSelector($event)" tabindex="0">\n\n <lib-selection-bar [opts]="opts" [yearsDuration]="yearsDuration" [visibleMonth]="visibleMonth" [selectMonth]="selectMonth" [selectYear]="selectYear"\n [prevViewDisabled]="prevViewDisabled" [nextViewDisabled]="nextViewDisabled"\n (prevNavigateBtnClicked)="onPrevNavigateBtnClicked()" (nextNavigateBtnClicked)="onNextNavigateBtnClicked()"\n (monthViewBtnClicked)="onMonthViewBtnClicked()" (yearViewBtnClicked)="onYearViewBtnClicked()"></lib-selection-bar>\n\n <lib-day-view *ngIf="!selectMonth && !selectYear" [opts]="opts" [dates]="dates" [weekDays]="weekDays"\n [selectedDate]="selectedDate" [selectedDateRange]="selectedDateRange" [viewChanged]="viewChanged"\n (dayCellClicked)="onDayCellClicked($event)"\n (dayCellKeyDown)="onDayCellKeyDown($event)"\n (viewActivated)="onViewActivated($event)"></lib-day-view>\n\n <lib-month-view *ngIf="selectMonth" [opts]="opts" [months]="months" [viewChanged]="viewChanged"\n (monthCellClicked)="onMonthCellClicked($event)"\n (monthCellKeyDown)="onMonthCellKeyDown($event)"\n (viewActivated)="onViewActivated($event)"></lib-month-view>\n\n <lib-year-view *ngIf="selectYear" [opts]="opts" [years]="years" [viewChanged]="viewChanged"\n (yearCellClicked)="onYearCellClicked($event)"\n (yearCellKeyDown)="onYearCellKeyDown($event)"\n (viewActivated)="onViewActivated($event)"></lib-year-view>\n\n <lib-footer-bar *ngIf="opts.showFooterToday" [opts]="opts"\n (footerBarTxtClicked)="onTodayFooterClicked()"></lib-footer-bar>\n </div>\n</div>\n',providers:[oe],encapsulation:d.ViewEncapsulation.None,styles:['.ng-mydp{position:static}.ng-myrtl{direction:rtl}.ng-mydp *{box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;padding:0;margin:0}.ng-mydp table{display:table;border-spacing:0}.ng-mydp table td,.ng-mydp table th{padding:0;margin:0;vertical-align:middle;border:none}.myDpSelector{padding:4px;border:1px solid #ccc;background-color:#fff;border-radius:4px;z-index:100000}.myDpViewChangeAnimation{-webkit-animation:.2s linear myDpViewChangeAnimation;animation:.2s linear myDpViewChangeAnimation}@-webkit-keyframes myDpViewChangeAnimation{0%{transform:scale(.75);opacity:.1}100%{transform:scale(1);opacity:1}}@keyframes myDpViewChangeAnimation{0%{transform:scale(.75);opacity:.1}100%{transform:scale(1);opacity:1}}.myDpAnimationFadeIn{-webkit-animation:.5s linear myDpAnimationFadeIn;animation:.5s linear myDpAnimationFadeIn}@-webkit-keyframes myDpAnimationFadeIn{0%{transform:translateY(-50px);opacity:0}100%{transform:translateY(0);opacity:1}}@keyframes myDpAnimationFadeIn{0%{transform:translateY(-50px);opacity:0}100%{transform:translateY(0);opacity:1}}.myDpAnimationFadeOut{-webkit-animation:.3s linear forwards myDpAnimationFadeOut;animation:.3s linear forwards myDpAnimationFadeOut}@-webkit-keyframes myDpAnimationFadeOut{0%{transform:translateY(0);opacity:1}100%{transform:translateY(-50px);opacity:0}}@keyframes myDpAnimationFadeOut{0%{transform:translateY(0);opacity:1}100%{transform:translateY(-50px);opacity:0}}.myDpAnimationScaleTopIn{-webkit-animation:.3s linear myDpAnimationScaleTopIn;animation:.3s linear myDpAnimationScaleTopIn}@-webkit-keyframes myDpAnimationScaleTopIn{0%{transform:scaleY(0);transform-origin:100% 0}100%{transform:scaleY(1);transform-origin:100% 0}}@keyframes myDpAnimationScaleTopIn{0%{transform:scaleY(0);transform-origin:100% 0}100%{transform:scaleY(1);transform-origin:100% 0}}.myDpAnimationScaleTopOut{-webkit-animation:.3s linear forwards myDpAnimationScaleTopOut;animation:.3s linear forwards myDpAnimationScaleTopOut}@-webkit-keyframes myDpAnimationScaleTopOut{0%{transform:scaleY(1);transform-origin:100% 0;opacity:1}100%{transform:scaleY(0);transform-origin:100% 0;opacity:0}}@keyframes myDpAnimationScaleTopOut{0%{transform:scaleY(1);transform-origin:100% 0;opacity:1}100%{transform:scaleY(0);transform-origin:100% 0;opacity:0}}.myDpAnimationScaleCenterIn{-webkit-animation:.3s linear myDpAnimationScaleCenterIn;animation:.3s linear myDpAnimationScaleCenterIn}@-webkit-keyframes myDpAnimationScaleCenterIn{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes myDpAnimationScaleCenterIn{0%{transform:scale(0)}100%{transform:scale(1)}}.myDpAnimationScaleCenterOut{-webkit-animation:.3s linear forwards myDpAnimationScaleCenterOut;animation:.3s linear forwards myDpAnimationScaleCenterOut}@-webkit-keyframes myDpAnimationScaleCenterOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}@keyframes myDpAnimationScaleCenterOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.myDpAnimationRotateIn{-webkit-animation:.3s linear myDpAnimationRotateIn;animation:.3s linear myDpAnimationRotateIn}@-webkit-keyframes myDpAnimationRotateIn{0%{transform:scale(.3) rotate(-45deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}@keyframes myDpAnimationRotateIn{0%{transform:scale(.3) rotate(-45deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}.myDpAnimationRotateOut{-webkit-animation:.3s linear forwards myDpAnimationRotateOut;animation:.3s linear forwards myDpAnimationRotateOut}@-webkit-keyframes myDpAnimationRotateOut{0%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(.3) rotate(-45deg);opacity:0}}@keyframes myDpAnimationRotateOut{0%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(.3) rotate(-45deg);opacity:0}}.myDpAnimationFlipDiagonalIn{-webkit-animation:.3s linear myDpAnimationFlipDiagonalIn;animation:.3s linear myDpAnimationFlipDiagonalIn}@-webkit-keyframes myDpAnimationFlipDiagonalIn{0%{transform:rotate3d(1,1,0,-78deg)}100%{transform:rotate3d(1,1,0,0deg)}}@keyframes myDpAnimationFlipDiagonalIn{0%{transform:rotate3d(1,1,0,-78deg)}100%{transform:rotate3d(1,1,0,0deg)}}.myDpAnimationFlipDiagonalOut{-webkit-animation:.3s linear forwards myDpAnimationFlipDiagonalOut;animation:.3s linear forwards myDpAnimationFlipDiagonalOut}@-webkit-keyframes myDpAnimationFlipDiagonalOut{0%{transform:rotate3d(1,1,0,0deg);opacity:1}100%{transform:rotate3d(1,1,0,78deg);opacity:0}}@keyframes myDpAnimationFlipDiagonalOut{0%{transform:rotate3d(1,1,0,0deg);opacity:1}100%{transform:rotate3d(1,1,0,78deg);opacity:0}}.myDpSelectorAbsolute{position:absolute}.myDpSelectorPosInitial{position:initial}.myDpSelector:focus{box-shadow:-1px 1px 6px 0 #add8e6;outline:0}.myDpSelectorArrow{background:#fff}.myDpSelectorArrow:after,.myDpSelectorArrow:before{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute}.myDpSelectorArrow:after{border-color:rgba(250,250,250,0);border-bottom-color:#fafafa;border-width:10px;margin-left:-10px}.myDpSelectorArrow:before{border-color:rgba(204,204,204,0);border-bottom-color:#ccc;border-width:11px;margin-left:-11px}.myDpSelectorArrow:focus:before{border-bottom-color:#add8e6}.myDpSelectorArrowLeft:after,.myDpSelectorArrowLeft:before{left:24px}.myDpSelectorArrowRight:after,.myDpSelectorArrowRight:before{left:86%}::-ms-clear{display:none}.myDpCalTable,.myDpFooterBar,.myDpMonthTable,.myDpYearTable{border-radius:0 0 4px 4px}.myDpCalTable.myDpNoFooter tbody tr:nth-child(6) td:first-child,.myDpMonthTable.myDpNoFooter tbody tr:nth-child(4) td:first-child,.myDpYearTable.myDpNoFooter tbody tr:nth-child(5) td:first-child{border-bottom-left-radius:4px}.myDpCalTable.myDpNoFooter tbody tr:nth-child(6) td:last-child,.myDpMonthTable.myDpNoFooter tbody tr:nth-child(4) td:last-child,.myDpYearTable.myDpNoFooter tbody tr:nth-child(5) td:last-child{border-bottom-right-radius:4px}.myDpCalTable,.myDpMonthTable,.myDpYearTable{table-layout:fixed;width:100%;background-color:#fff;font-size:14px}.myDpFooter{height:calc(100% - 60px)}.myDpNoFooter{height:calc(100% - 30px)}.myDpCalTable,.myDpDaycell,.myDpMonthTable,.myDpMonthcell,.myDpWeekDayTitle,.myDpYearTable,.myDpYearcell{border-collapse:collapse;color:#333;line-height:1.1}.myDpDaycell,.myDpMonthcell,.myDpYearcell{padding:4px;text-align:center;outline:0}.myDpDaycell{background-color:#fff;position:relative}.myDpWeekDayTitle{background-color:transparent;color:#333;font-size:13px;font-weight:400;vertical-align:middle;max-width:36px;overflow:hidden;white-space:nowrap;height:23px;text-align:center}.myDpWeekDayTitleWeekNbr{width:20px}.myDpMonthcell{background-color:#fff;overflow:hidden;white-space:nowrap}.myDpYearcell{background-color:#fff;width:20%}.myDpMonthNbr{font-size:10px;display:block}.myDpDaycellWeekNbr{font-size:9px;cursor:default;text-align:center;color:#333}.myDpNextMonth,.myDpPrevMonth{color:#999}.myDpMonthYearSelBar{display:flex;height:30px;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px}.myDpPrevBtn{margin-left:10px}.myDpNextBtn{margin-left:auto;margin-right:10px}.myDpMonthYearText{width:100%;line-height:30px;text-align:center}.myDpFooterBar{display:flex;align-items:center;justify-content:center;height:30px;background-color:#fff}.myDpHeaderBtn{background:0 0;padding:0;border:none;line-height:30px;height:28px;margin-top:1px;color:#000;outline:0;cursor:default}.myDpFooterBtn{margin:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.myDpMonthBtn,.myDpYearBtn{font-size:16px}.myDpMonthBtn{margin-right:6px}.myDpHighlight{color:#c30000}.myDpDimDay{opacity:.5}.myDpCurrMonth{background-color:#fff;font-weight:400}.myDpMarkDate{position:absolute;top:2px;left:2px;border-right:8px solid transparent}.myDpMarkCurrDay,.myDpMarkCurrMonth,.myDpMarkCurrYear{border-bottom:2px solid #333}.myDpHeaderLabelBtnNotEdit{cursor:default}.myDpHeaderBtn::-moz-focus-inner,.myDpNextBtn::-moz-focus-inner,.myDpPrevBtn::-moz-focus-inner{border:0}.myDpFooterBtn:focus,.myDpHeaderBtn:focus,.myDpMonthLabel:focus,.myDpYearLabel:focus{color:#66afe9;outline:0}.myDpDaycell:focus,.myDpMonthcell:focus,.myDpYearcell:focus{box-shadow:inset 0 0 0 1px #66afe9}.myDpTableSingleDay:hover,.myDpTableSingleMonth:hover,.myDpTableSingleYear:hover{background-color:#ddd}.myDpDaycell,.myDpMonthLabel,.myDpMonthcell,.myDpYearLabel,.myDpYearcell{cursor:pointer}.myDpFooterBtn:hover,.myDpHeaderBtnEnabled:hover,.myDpMonthLabel:hover,.myDpYearLabel:hover{color:#777}.myDpHeaderBtnEnabled{cursor:pointer}.myDpHeaderBtnDisabled{cursor:not-allowed;opacity:.65}.myDpDisabled{cursor:default;color:#777;background:repeating-linear-gradient(-45deg,#ccc 7px,#ccc 8px,transparent 7px,transparent 14px)}.myDpRangeColor{background-color:#dbeaff}.myDpRangeBegin,.myDpRangeEnd,.myDpSelectedDay,.myDpSelectedMonth,.myDpSelectedYear{border:none;background-color:#8ebfff}@font-face{font-family:angular-mydatepicker;src:url(data:application/octet-stream;base64,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) format(\'woff\');font-weight:400;font-style:normal}.myDpIcon{font-family:angular-mydatepicker;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#222;font-size:20px}.myDpIconLeftArrow:before{content:"\\e800"}.myDpIconRightArrow:before{content:"\\e801"}']}]}],ye.ctorParameters=function(){return[{type:d.ElementRef},{type:d.Renderer2},{type:d.ChangeDetectorRef},{type:oe}]},ye.propDecorators={selectorEl:[{type:d.ViewChild,args:["selectorEl"]}],styleEl:[{type:d.ViewChild,args:["styleEl"]}],position:[{type:d.HostBinding,args:["style.position"]}]},ye);function ye(e,t,a,i){var n=this;this.elem=e,this.renderer=t,this.cdr=a,this.utilService=i,this.position="static",this.visibleMonth={monthTxt:R,monthNbr:0,year:0},this.selectedMonth={monthNbr:0,year:0},this.selectedDate={year:0,month:0,day:0},this.selectedDateRange={begin:{year:0,month:0,day:0},end:{year:0,month:0,day:0}},this.weekDays=[],this.dates=[],this.months=[],this.years=[],this.yearsDuration="",this.dayIdx=0,this.weekDayOpts=[l,A,c,y,I,u,p],this.selectMonth=!1,this.selectYear=!1,this.viewChanged=!1,this.selectorPos=null,this.prevViewDisabled=!1,this.nextViewDisabled=!1,this.clickListener=t.listen(e.nativeElement,D,function(e){(n.opts.monthSelector||n.opts.yearSelector)&&e.target&&n.resetMonthYearSelect()})}var ue=(pe.prototype.ngOnChanges=function(e){e.hasOwnProperty(W)&&(this.opts=e[W].currentValue),e.hasOwnProperty(J)&&(this.yearsDuration=e[J].currentValue),e.hasOwnProperty(K)&&(this.visibleMonth=e[K].currentValue),e.hasOwnProperty(j)&&(this.selectMonth=e[j].currentValue),e.hasOwnProperty(G)&&(this.selectYear=e[G].currentValue),e.hasOwnProperty(U)&&(this.prevViewDisabled=e[U].currentValue),e.hasOwnProperty(Q)&&(this.nextViewDisabled=e[Q].currentValue)},pe.prototype.onPrevNavigateBtnClicked=function(e){e.stopPropagation(),(this.opts.rtl?this.nextNavigateBtnClicked:this.prevNavigateBtnClicked).emit()},pe.prototype.onNextNavigateBtnClicked=function(e){e.stopPropagation(),(this.opts.rtl?this.prevNavigateBtnClicked:this.nextNavigateBtnClicked).emit()},pe.prototype.onMonthViewBtnClicked=function(e){e.stopPropagation(),this.monthViewBtnClicked.emit()},pe.prototype.onYearViewBtnClicked=function(e){e.stopPropagation(),this.yearViewBtnClicked.emit()},pe.decorators=[{type:d.Component,args:[{selector:"lib-selection-bar",template:'<div class="myDpMonthYearSelBar">\n <div class="myDpPrevBtn">\n <button type="button" [attr.aria-label]="opts.ariaLabelPrevMonth" class="myDpHeaderBtn myDpIcon myDpIconLeftArrow myDpHeaderBtnEnabled" (click)="onPrevNavigateBtnClicked($event)" tabindex="{{!prevViewDisabled ? \'0\':\'-1\'}}" [disabled]="prevViewDisabled" [ngClass]="{\'myDpHeaderBtnDisabled\': prevViewDisabled}"></button>\n </div>\n <div class="myDpMonthYearText">\n <button type="button" class="myDpHeaderBtn myDpMonthBtn" *ngIf="!selectYear" (click)="opts.monthSelector && onMonthViewBtnClicked($event)" tabindex="{{opts.monthSelector ? \'0\':\'-1\'}}" [ngClass]="{\'myDpMonthLabel\': opts.monthSelector, \'myDpHeaderLabelBtnNotEdit\': !opts.monthSelector}">{{visibleMonth.monthTxt}}</button>\n <button type="button" class="myDpHeaderBtn myDpYearBtn" (click)="opts.yearSelector && onYearViewBtnClicked($event)" tabindex="{{opts.yearSelector ? \'0\':\'-1\'}}" [ngClass]="{\'myDpYearLabel\': opts.yearSelector, \'myDpHeaderLabelBtnNotEdit\': !opts.yearSelector}">{{!selectYear ? visibleMonth.year : yearsDuration}}</button>\n </div>\n <div class="myDpNextBtn">\n <button type="button" [attr.aria-label]="opts.ariaLabelNextMonth" class="myDpHeaderBtn myDpIcon myDpIconRightArrow myDpHeaderBtnEnabled" (click)="onNextNavigateBtnClicked($event)" tabindex="{{!nextViewDisabled ? \'0\':\'-1\'}}" [disabled]="nextViewDisabled" [ngClass]="{\'myDpHeaderBtnDisabled\': nextViewDisabled}"></button>\n </div>\n</div>\n',encapsulation:d.ViewEncapsulation.None}]}],pe.ctorParameters=function(){return[]},pe.propDecorators={opts:[{type:d.Input}],yearsDuration:[{type:d.Input}],visibleMonth:[{type:d.Input}],selectMonth:[{type:d.Input}],selectYear:[{type:d.Input}],prevViewDisabled:[{type:d.Input}],nextViewDisabled:[{type:d.Input}],prevNavigateBtnClicked:[{type:d.Output}],nextNavigateBtnClicked:[{type:d.Output}],monthViewBtnClicked:[{type:d.Output}],yearViewBtnClicked:[{type:d.Output}]},pe);function pe(){this.prevNavigateBtnClicked=new d.EventEmitter,this.nextNavigateBtnClicked=new d.EventEmitter,this.monthViewBtnClicked=new d.EventEmitter,this.yearViewBtnClicked=new d.EventEmitter}var me={Date:1,Month:2,Year:3};me[me.Date]="Date",me[me.Month]="Month",me[me.Year]="Year";var De=(ge.prototype.ngOnChanges=function(e){e.hasOwnProperty(W)&&(this.opts=e[W].currentValue),e.hasOwnProperty(Z)&&(this.dates=e[Z].currentValue),e.hasOwnProperty(_)&&(this.weekDays=e[_].currentValue),e.hasOwnProperty(q)&&(this.selectedDate=e[q].currentValue),e.hasOwnProperty(X)&&(this.selectedDateRange=e[X].currentValue)},ge.prototype.ngAfterViewInit=function(){this.viewActivated.emit(me.Date)},ge.prototype.onDayCellClicked=function(e,t){e.stopPropagation(),t.disabledDate.disabled||this.dayCellClicked.emit(t)},ge.prototype.onDayCellKeyDown=function(e,t){var a=this.utilService.getKeyCodeFromEvent(e);a!==h.tab&&(e.preventDefault(),a===h.enter||a===h.space?this.onDayCellClicked(e,t):this.opts.moveFocusByArrowKeys&&this.dayCellKeyDown.emit(e))},ge.prototype.onDayCellMouseEnter=function(e){var t,a,i,n;if(this.utilService.isInitializedDate(this.selectedDateRange.begin)&&!this.utilService.isInitializedDate(this.selectedDateRange.end))try{for(var o=S(this.dates),r=o.n