vendor: 11,259 bytes, lines 1-4
1/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. 2See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. 3v3.0.3 */ 4import{a as f,b as m,j as h,m as F,n as I,q as k}from"./FWYDKVOD.js";import"./DWSKOILM.js";import{a as H}from"./RIMAR2EG.js";import"./DFFLO6RQ.js";import{b as R}from"./SZONZQBZ.js";import{J as x,e as $,f as v,v as p,w as M,x as g}from"./74XIV7EB.js";var l={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",insideRangeHover:"inside-range--hover",month:"month",noncurrent:"noncurrent",outsideRangeHover:"outside-range--hover",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},A=$`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-3))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,y=7,w=6,b=class extends M{constructor(){super(),this.activeDate=new Date,this.range=!1,this.calciteInternalDatePickerDayHover=p({cancelable:!1}),this.calciteInternalDatePickerDaySelect=p({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=p({cancelable:!1}),this.calciteInternalDatePickerMonthChange=p({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=p({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:16,activeDate:0,dateTimeFormat:0,endDate:0,headingLevel:11,hoverRange:0,layout:3,localeData:0,max:0,messages:0,min:0,monthStyle:1,range:7,scale:3,selectedDate:0,startDate:0}}static{this.styles=A}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=f(e,this.min,this.max)?e:m(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(m(t,this.min,this.max)),this.focusedDate=m(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(m(t,this.min,this.max)),this.focusedDate=m(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let i=new Date(a,e,0),s=i.getDate(),n=i.getDay(),r=[];if(n===(t+w)%y)return r;if(n===t)return[s];for(let c=(y+n-t)%y;c>=0;c--)r.push(s-c);return r}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),i=[];for(let s=0;s<t;s++)i.push(s+1);return i}getNextMonthDays(e,a,t){let i=new Date(a,e+1,0).getDay(),s=[];if(i===(t+w)%y)return s;for(let n=0;n<(w-(i-t))%y;n++)s.push(n+1);return s}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(h(e,this.selectedDate)||this.startDate&&h(e,this.startDate)||this.endDate&&h(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!h(this.startDate,this.endDate)&&h(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!h(this.startDate,this.endDate)&&h(this.endDate,e)||!this.endDate&&this.hoverRange&&h(this.startDate,this.hoverRange.end)&&h(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),i=this.startDate&&a>this.startDate,s=this.endDate&&a<this.endDate,n=this.startDate&&e>this.startDate,r=this.endDate&&e<this.endDate,c=!t&&this.startDate&&i&&(!this.endDate||s),o=t&&this.startDate&&n&&r;return c||o}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,i=this.isFocusedOnStart(),s=this.isHoverInRange(),n=e>a&&e<this.startDate,r=e<t&&e>this.endDate,c=e>t&&e<this.endDate,o=e<a&&e>this.startDate,d=e<t&&e>this.startDate,D=e>a&&e<this.endDate,u=this.startDate&&this.endDate;if(s){if(u)return i?e<this.endDate&&(o||n):c||r;if(this.startDate&&!this.endDate)return i?n:d;if(!this.startDate&&this.endDate)return i?D:r}else if(u)return i?n:r}getDays(e,a,t,i="start"){let s=this.activeDate.getMonth(),n=s+1;s=i==="end"?n:s;let r=0,c=()=>r++%7,o=this.activeDate.getFullYear();return[...e.map(d=>({active:!1,day:d,dayInWeek:c(),date:new Date(o,s-1,d)})),...a.map(d=>{let D=new Date(o,s,d),u=h(D,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?h(D,this.focusedDate):h(D,this.startDate)||h(D,this.endDate),currentMonth:!0,currentDay:u,day:d,dayInWeek:c(),date:D,ref:!0}}),...t.map(d=>({active:!1,day:d,dayInWeek:c(),date:new Date(o,n,d)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!k(this.startDate,e)||!k(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:F(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:i,short:s,narrow:n}=this.localeData.days,r=this.scale==="s"?n||s||i:s||i||n,c=[...r.slice(t,7),...r.slice(0,t)],o=this.getCurrentMonthDays(e,a),d=this.getPreviousMonthDays(e,a,t),D=this.getNextMonthDays(e,a,t),u=e+1,P=this.getPreviousMonthDays(u,a,t),C=this.getCurrentMonthDays(u,a),S=this.getNextMonthDays(u,a,t),z=this.getDays(d,o,D),O=this.getDays(P,C,S,"end");return v`<div class=${g({[l.calendarContainer]:!0})} role=grid>${this.renderCalendar(c,z)}${this.range&&this.renderCalendar(c,O,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:i,day:s,dayInWeek:n,ref:r},c){let o=f(i,this.min,this.max);return H(c,v`<div class=${g({[l.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${g({[l.currentDay]:t,[l.insideRangeHover]:this.isHoverInRange(),[l.outsideRangeHover]:!this.isHoverInRange(),[l.noncurrent]:this.range&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${s} .disabled=${!o} .endOfRange=${this.isEndOfRange(i)} .highlighted=${this.betweenSelectedRange(i)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!h(this.startDate,this.endDate)} .rangeEdge=${n===0?"start":n===6?"end":void 0} .rangeHover=${o&&this.isRangeHover(i)} .scale=${this.scale} .selected=${this.isSelected(i)} .startOfRange=${this.isStartOfRange(i)} .value=${i} ${R(d=>{r&&e&&this.activeFocus&&d?.setFocus()})}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return v`<div class=${g({[l.calendar]:!0,[l.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?I(this.activeDate):this.activeDate} data-test-calendar=${t?"end":"start"} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range?"start":null} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return v`<div class=${g({[l.month]:!0})} @keydown=${this.keyDownHandler}><div class=${g({[l.weekHeaderContainer]:!0})} role=row>${e.map(i=>v`<span class=${g({[l.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${g({[l.weekDays]:!0})} role=row>${a.map((i,s)=>this.renderDateDay(i,t?50+s:s))}</div></div>`}};x("calcite-date-picker-month",b);export{b as DatePickerMonth};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.