@ionic/core 8.8.4-nightly.20260407 → 8.8.4-nightly.20260408
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ion-datetime.js +1 -1
- package/components/ion-picker-column.js +1 -1
- package/components/p-FBcnjE5W.js +4 -0
- package/dist/cjs/ion-datetime_3.cjs.entry.js +15 -5
- package/dist/cjs/ion-picker-column.cjs.entry.js +4 -4
- package/dist/collection/components/datetime/datetime.js +15 -5
- package/dist/collection/components/picker-column/picker-column.js +5 -5
- package/dist/docs.json +1 -1
- package/dist/esm/ion-datetime_3.entry.js +15 -5
- package/dist/esm/ion-picker-column.entry.js +5 -5
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-078037da.entry.js +4 -0
- package/dist/ionic/p-4c67ce4c.entry.js +4 -0
- package/dist/types/components/datetime/datetime.d.ts +1 -0
- package/hydrate/index.js +19 -9
- package/hydrate/index.mjs +19 -9
- package/package.json +1 -1
- package/components/p-C7AoMl7c.js +0 -4
- package/dist/ionic/p-5b52aa7d.entry.js +0 -4
- package/dist/ionic/p-9fae83d8.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{j as e,f as t,p as a,H as i,e as n,w as o,h as r,d as s,t as d}from"./p-BJoMtgfR.js";import{startFocusVisible as l}from"./p-BmVRXR1y.js";import{r as h,g as c,e as p}from"./p-DgbT0exM.js";import{F as m}from"./p-Cq8cQ0NL.js";import{i as u}from"./p-C53feagD.js";import{c as b}from"./p-DiVJyqlX.js";import{c as y,f as g,g as f,h as x,a as v}from"./p-CO7fmmxt.js";import{b as w}from"./p-CDfQnFrd.js";import{i as k,a as j,g as C,b as O,c as P,d as D,e as z,v as V,f as T,h as $,j as A,k as E,l as S,m as B,n as W,o as M,p as R,q as I,r as F,s as L,w as H,t as q,u as Y,x as G,y as J,z as N,A as K,B as Q,C as U,D as X,E as Z,F as _,G as ee,H as te,I as ae,J as ie,K as ne,L as oe,M as re,N as se,O as de,P as le,Q as he,R as ce}from"./p-BS1TtEiJ.js";import{d as pe}from"./p-CoA-aqGF.js";import{d as me}from"./p-BTeL5HCK.js";import{d as ue}from"./p-B8b1Ukl9.js";import{d as be}from"./p-YLXPWgVj.js";import{d as ye}from"./p-B6HaBl3o.js";import{d as ge}from"./p-C7AoMl7c.js";import{d as fe}from"./p-BxwWvu-b.js";import{d as xe}from"./p-DHsZWn1l.js";import{d as ve}from"./p-fpbh6w3f.js";const we=(e,t,a,i)=>null===e.day||void 0!==i&&!i.includes(e.day)||!(!t||!k(e,t))||!(!a||!j(e,a)),ke=(e,t,a,i,n,o,r)=>{const s=void 0!==(Array.isArray(a)?a:[a]).find((e=>P(t,e))),d=P(t,i);return{disabled:we(t,n,o,r),isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:z(e,d,t),text:null!=t.day?D(e,t):null}},je=(e,{minParts:t,maxParts:a})=>!!((e,t,a)=>!!(t&&t.year>e)||!!(a&&a.year<e))(e.year,t,a)||!!(t&&k(e,t)||a&&j(e,a)),Ce=(e,a)=>{var i,n,o,r;((null===(i=null==a?void 0:a.date)||void 0===i?void 0:i.timeZone)||(null===(n=null==a?void 0:a.date)||void 0===n?void 0:n.timeZoneName)||(null===(o=null==a?void 0:a.time)||void 0===o?void 0:o.timeZone)||(null===(r=null==a?void 0:a.time)||void 0===r?void 0:r.timeZoneName))&&t('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".',e)},Oe=(e,a,i)=>{if(i)switch(a){case"date":case"month-year":case"month":case"year":void 0===i.date&&t(`[ion-datetime] - The '${a}' presentation requires a date object in formatOptions.`,e);break;case"time":void 0===i.time&&t("[ion-datetime] - The 'time' presentation requires a time object in formatOptions.",e);break;case"date-time":case"time-date":void 0===i.date&&void 0===i.time&&t(`[ion-datetime] - The '${a}' presentation requires either a date or time object (or both) in formatOptions.`,e)}},Pe=a(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ionCancel=n(this,"ionCancel",7),this.ionChange=n(this,"ionChange",7),this.ionValueChange=n(this,"ionValueChange",7),this.ionFocus=n(this,"ionFocus",7),this.ionBlur=n(this,"ionBlur",7),this.ionStyle=n(this,"ionStyle",7),this.ionRender=n(this,"ionRender",7),this.inputId="ion-dt-"+De++,this.prevPresentation=null,this.showMonthAndYear=!1,this.activeParts=[],this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm",isAdjacentDay:!1},this.isTimePopoverOpen=!1,this.color="primary",this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.showAdjacentDays=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.warnIfIncorrectValueUsage=()=>{const{multiple:e,value:a}=this;!e&&Array.isArray(a)&&t(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${a.map((e=>`'${e}'`)).join(", ")}]\n`,this.el)},this.setValue=e=>{this.value=e,this.ionChange.emit({value:e})},this.getActivePartsWithFallback=()=>{var e;const{defaultParts:t}=this;return null!==(e=this.getActivePart())&&void 0!==e?e:t},this.getActivePart=()=>{const{activeParts:e}=this;return Array.isArray(e)?e[0]:e},this.closeParentOverlay=e=>{const t=this.el.closest("ion-modal, ion-popover");t&&t.dismiss(void 0,e)},this.setWorkingParts=e=>{this.workingParts=Object.assign({},e)},this.setActiveParts=(e,t=!1)=>{if(this.readonly)return;const{multiple:a,minParts:i,maxParts:n,activeParts:o}=this,r=V(e,i,n);if(this.setWorkingParts(r),a){const e=Array.isArray(o)?o:[o];this.activeParts=t?e.filter((e=>!P(e,r))):[...e,r]}else this.activeParts=Object.assign({},r);null!==this.el.querySelector('[slot="buttons"]')||this.showDefaultButtons||this.confirm()},this.initializeKeyboardListeners=()=>{const e=this.calendarBodyRef;if(!e)return;const t=this.el.shadowRoot,a=e.querySelector(".calendar-month:nth-of-type(2)"),i=new MutationObserver((t=>{var i;!(null===(i=t[0].oldValue)||void 0===i?void 0:i.includes("ion-focused"))&&e.classList.contains("ion-focused")&&this.focusWorkingDay(a)}));i.observe(e,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{null==i||i.disconnect()},e.addEventListener("keydown",(e=>{const i=t.activeElement;if(!i||!i.classList.contains("calendar-day"))return;const n=T(i);let o;switch(e.key){case"ArrowDown":e.preventDefault(),o=R(n);break;case"ArrowUp":e.preventDefault(),o=M(n);break;case"ArrowRight":e.preventDefault(),o=W(n);break;case"ArrowLeft":e.preventDefault(),o=B(n);break;case"Home":e.preventDefault(),o=S(n);break;case"End":e.preventDefault(),o=E(n);break;case"PageUp":e.preventDefault(),o=e.shiftKey?A(n):C(n);break;case"PageDown":e.preventDefault(),o=e.shiftKey?$(n):O(n);break;default:return}we(o,this.minParts,this.maxParts)||(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),o)),requestAnimationFrame((()=>this.focusWorkingDay(a))))}))},this.focusWorkingDay=e=>{const{day:t,month:a,year:i}=this.workingParts,n=new Date(`${a}/1/${i}`).getDay();if(null===t)return;const o=e.querySelector(`.calendar-day-wrapper:nth-of-type(${(n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-(this.firstDayOfWeek-n))+t}) .calendar-day`);o&&o.focus()},this.processMinParts=()=>{const{min:e,defaultParts:t}=this;this.minParts=void 0!==e?I(e,t):void 0},this.processMaxParts=()=>{const{max:e,defaultParts:t}=this;this.maxParts=void 0!==e?F(e,t):void 0},this.initializeCalendarListener=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelectorAll(".calendar-month"),a=t[0],i=t[1],n=t[2],r="ios"===w(this)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1;o((()=>{e.scrollLeft=a.clientWidth*(u(this.el)?-1:1);const t=t=>{const i=e.getBoundingClientRect(),o=(u(this.el)?e.scrollLeft>=-2:e.scrollLeft<=2)?a:n,r=o.getBoundingClientRect();if(Math.abs(r.x-i.x)>2)return;const{forceRenderDate:s}=this;return void 0!==s?{month:s.month,year:s.year,day:s.day}:o===a?C(t):o===n?O(t):void 0},s=()=>{r&&(e.style.removeProperty("pointer-events"),l=!1);const a=t(this.workingParts);if(!a)return;const{month:n,day:s,year:d}=a;je({month:n,year:d,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})||(e.style.setProperty("overflow","hidden"),o((()=>{var t;this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:n,day:s,year:d})),e.scrollLeft=i.clientWidth*(u(this.el)?-1:1),e.style.removeProperty("overflow"),this.resolveForceDateScrolling&&this.resolveForceDateScrolling();const a=this.el.shadowRoot.activeElement;a&&a.classList.contains("calendar-day")&&(null===(t=a.closest(".calendar-body"))||void 0===t||t.focus())})))};let d,l=!1;const h=()=>{d&&clearTimeout(d),!l&&r&&(e.style.setProperty("pointer-events","none"),l=!0),d=setTimeout(s,50)};e.addEventListener("scroll",h),this.destroyCalendarListener=()=>{e.removeEventListener("scroll",h)}}))},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:e,destroyKeyboardMO:t}=this;void 0!==e&&e(),void 0!==t&&t()},this.ensureReadyIfVisible=()=>{if(this.el.classList.contains("datetime-ready"))return;const e=this.el.getBoundingClientRect();0!==e.width&&0!==e.height&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))},this.processValue=e=>{const t=null!=e&&""!==e&&(!Array.isArray(e)||e.length>0),a=t?L(e):this.defaultParts,{minParts:i,maxParts:n,workingParts:o,el:r}=this;if(this.warnIfIncorrectValueUsage(),!a)return;t&&H(a,i,n);const s=Y(Array.isArray(a)?a[a.length-1]:a,i,n),{month:d,day:l,year:h,hour:c,minute:p}=s,m=q(c);this.activeParts=t?Array.isArray(a)?[...a]:{month:d,day:l,year:h,hour:c,minute:p,ampm:m}:[];const u=void 0!==d&&d!==o.month||void 0!==h&&h!==o.year,b=r.classList.contains("datetime-ready"),{isGridStyle:y,showMonthAndYear:g}=this;y&&u&&b&&!g?this.animateToDate(s):this.setWorkingParts({month:d,day:l,year:h,hour:c,minute:p,ampm:m})},this.animateToDate=async e=>{const{workingParts:t}=this;this.forceRenderDate=e;const a=new Promise((e=>{this.resolveForceDateScrolling=e}));k(e,t)?this.prevMonth():this.nextMonth(),await a,this.resolveForceDateScrolling=void 0,this.forceRenderDate=void 0},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value,this.nextMonth=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelector(".calendar-month:last-of-type");t&&e.scrollTo({top:0,left:2*t.offsetWidth*(u(this.el)?-1:1),behavior:"smooth"})},this.prevMonth=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelector(".calendar-month:first-of-type");t&&e.scrollTo({top:0,left:2*t.offsetWidth*(u(this.el)?1:-1),behavior:"smooth"})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}formatOptionsChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t),Ce(e,t)}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}presentationChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t)}get isGridStyle(){const{presentation:e,preferWheel:t}=this;return("date"===e||"date-time"===e||"time-date"===e)&&!t}yearValuesChanged(){this.parsedYearValues=G(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=G(this.monthValues)}dayValuesChanged(){this.parsedDayValues=G(this.dayValues)}hourValuesChanged(){this.parsedHourValues=G(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=G(this.minuteValues)}async valueChanged(){const{value:e}=this;this.hasValue()&&this.processValue(e),this.emitStyle(),this.ionValueChange.emit({value:e})}async confirm(e=!1){const{isCalendarPicker:t,activeParts:a,preferWheel:i,workingParts:n}=this;void 0===a&&t||this.setValue(Array.isArray(a)&&0===a.length?i?J(n):void 0:J(a)),e&&this.closeParentOverlay(Ve)}async reset(e){this.processValue(e)}async cancel(e=!1){this.ionCancel.emit(),e&&this.closeParentOverlay(ze)}get isCalendarPicker(){const{presentation:e}=this;return"date"===e||"date-time"===e||"time-date"===e}connectedCallback(){this.clearFocusVisible=l(this.el).destroy}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0),this.loadTimeout&&clearTimeout(this.loadTimeout)}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const{el:e,intersectionTrackerRef:t}=this,a=new IntersectionObserver((e=>{e[0].isIntersecting&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))}),{threshold:.01,root:e});h((()=>null==a?void 0:a.observe(t))),this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100);const i=new IntersectionObserver((e=>{e[0].isIntersecting||(this.destroyInteractionListeners(),this.showMonthAndYear=!1,o((()=>{this.el.classList.remove("datetime-ready")})))}),{threshold:0,root:e});h((()=>null==i?void 0:i.observe(t)));const n=c(this.el);n.addEventListener("ionFocus",(e=>e.stopPropagation())),n.addEventListener("ionBlur",(e=>e.stopPropagation()))}componentDidRender(){const{presentation:e,prevPresentation:t,calendarBodyRef:a,minParts:i,preferWheel:n,forceRenderDate:o}=this;if(void 0!==i&&!n&&["date-time","time-date","date"].includes(e)&&a){const e=a.querySelector(".calendar-month:nth-of-type(1)");e&&void 0===o&&(a.scrollLeft=e.clientWidth*(u(this.el)?-1:1))}null!==t?e!==t&&(this.prevPresentation=e,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,h((()=>{this.ionRender.emit()}))):this.prevPresentation=e}componentWillLoad(){const{el:e,formatOptions:a,highlightedDates:i,multiple:n,presentation:o,preferWheel:r}=this;n&&("date"!==o&&t('[ion-datetime] - Multiple date selection is only supported for presentation="date".',e),r&&t('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".',e)),void 0!==i&&("date"!==o&&"date-time"!==o&&"time-date"!==o&&t("[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.",e),r&&t('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".',e)),a&&(Oe(e,o,a),Ce(e,a));const s=this.parsedHourValues=G(this.hourValues),d=this.parsedMinuteValues=G(this.minuteValues),l=this.parsedMonthValues=G(this.monthValues),h=this.parsedYearValues=G(this.yearValues),c=this.parsedDayValues=G(this.dayValues),p=this.todayParts=L(N());this.processMinParts(),this.processMaxParts(),this.defaultParts=K({refParts:p,monthValues:l,dayValues:c,yearValues:h,hourValues:s,minuteValues:d,minParts:this.minParts,maxParts:this.maxParts}),this.processValue(this.value),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{disabled:e,readonly:t,showDefaultButtons:a,showClearButton:i}=this,n=e||t;if(null===this.el.querySelector('[slot="buttons"]')&&!a&&!i)return;const o=()=>{this.reset(),this.setValue(void 0)};return r("div",{class:"datetime-footer"},r("div",{class:"datetime-buttons"},r("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},r("slot",{name:"buttons"},r("ion-buttons",null,a&&r("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0),disabled:n},this.cancelText),r("div",{class:"datetime-action-buttons-container"},i&&r("ion-button",{id:"clear-button",color:this.color,onClick:()=>o(),disabled:n},this.clearText),a&&r("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0),disabled:n},this.doneText)))))))}renderWheelPicker(e=this.presentation){const t="time-date"===e?[this.renderTimePickerColumns(e),this.renderDatePickerColumns(e)]:[this.renderDatePickerColumns(e),this.renderTimePickerColumns(e)];return r("ion-picker",{class:m},t)}renderDatePickerColumns(e){return"date-time"===e||"time-date"===e?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(e)}renderCombinedDatePickerColumn(){const{defaultParts:t,disabled:a,workingParts:i,locale:n,minParts:o,maxParts:s,todayParts:d,isDateEnabled:l}=this,h=this.getActivePartsWithFallback(),c=Q(i),p=c[c.length-1];c[0].day=1,p.day=U(p.month,p.year);const m=void 0!==o&&j(o,c[0])?o:c[0],u=void 0!==s&&k(s,p)?s:p,b=X(n,d,m,u,this.parsedDayValues,this.parsedMonthValues);let y=b.items;const g=b.parts;l&&(y=y.map(((t,a)=>{const i=g[a];let n;try{n=!l(J(i))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:n})})));const f=null!==i.day?`${i.year}-${i.month}-${i.day}`:`${t.year}-${t.month}-${t.day}`;return r("ion-picker-column",{part:Te,"aria-label":"Select a date",class:"date-column",color:this.color,disabled:a,value:f,onIonChange:e=>{const{value:t}=e.detail,a=g.find((({month:e,day:a,year:i})=>t===`${i}-${e}-${a}`));this.setWorkingParts(Object.assign(Object.assign({},i),a)),this.setActiveParts(Object.assign(Object.assign({},h),a)),e.stopPropagation()}},y.map((e=>r("ion-picker-column-option",{part:e.value===f?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderIndividualDatePickerColumns(t){const{workingParts:a,isDateEnabled:i}=this,n="year"!==t&&"time"!==t?Z(this.locale,a,this.minParts,this.maxParts,this.parsedMonthValues):[];let o="date"===t?_(this.locale,a,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(o=o.map((t=>{const{value:n}=t,o={month:a.month,day:"string"==typeof n?parseInt(n):n,year:a.year};let r;try{r=!i(J(o))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:r})})));const r="month"!==t&&"time"!==t?ee(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];let s=[];return s=te(this.locale,{month:"numeric",day:"numeric"})?[this.renderMonthPickerColumn(n),this.renderDayPickerColumn(o),this.renderYearPickerColumn(r)]:[this.renderDayPickerColumn(o),this.renderMonthPickerColumn(n),this.renderYearPickerColumn(r)],s}renderDayPickerColumn(e){var t;if(0===e.length)return[];const{disabled:a,workingParts:i}=this,n=this.getActivePartsWithFallback(),o=null!==(t=null!==i.day?i.day:this.defaultParts.day)&&void 0!==t?t:void 0;return r("ion-picker-column",{part:Te,"aria-label":"Select a day",class:"day-column",color:this.color,disabled:a,value:o,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},i),{day:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},n),{day:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===o?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMonthPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a month",class:"month-column",color:this.color,disabled:t,value:a.month,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{month:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{month:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.month?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderYearPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a year",class:"year-column",color:this.color,disabled:t,value:a.year,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{year:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{year:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.year?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderTimePickerColumns(e){if(["date","month","month-year","year"].includes(e))return[];const t=void 0!==this.getActivePart(),{hoursData:a,minutesData:i,dayPeriodData:n}=ae(this.locale,this.workingParts,this.hourCycle,t?this.minParts:void 0,t?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(a),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select an hour",color:this.color,disabled:t,value:i.hour,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{hour:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{hour:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.hour?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMinutePickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a minute",color:this.color,disabled:t,value:i.minute,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{minute:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{minute:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.minute?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderDayPeriodPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback(),n=ie(this.locale);return r("ion-picker-column",{part:Te,"aria-label":"Select a day period",style:n?{order:"-1"}:{},color:this.color,disabled:t,value:i.ampm,onIonChange:e=>{const t=ce(a,e.detail.value);this.setWorkingParts(Object.assign(Object.assign({},a),{ampm:e.detail.value,hour:t})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{ampm:e.detail.value,hour:t})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.ampm?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderWheelView(e){const{locale:t}=this,a=te(t)?"month-first":"year-first";return r("div",{class:{["wheel-order-"+a]:!0}},this.renderWheelPicker(e))}renderCalendarHeader(e){const{disabled:t}=this,a="ios"===e?y:g,i="ios"===e?f:x,n=t||((e,t,a)=>{const i=Object.assign(Object.assign({},C(this.workingParts)),{day:null});return je(i,{minParts:t,maxParts:a})})(0,this.minParts,this.maxParts),o=t||((e,t)=>{const a=Object.assign(Object.assign({},O(this.workingParts)),{day:null});return je(a,{maxParts:t})})(0,this.maxParts),s=this.el.getAttribute("dir")||void 0;return r("div",{class:"calendar-header",part:"calendar-header"},r("div",{class:"calendar-action-buttons"},r("div",{class:"calendar-month-year"},r("button",{class:{"calendar-month-year-toggle":!0,"ion-activatable":!0,"ion-focusable":!0},part:"month-year-button",disabled:t,"aria-label":this.showMonthAndYear?"Hide year picker":"Show year picker",onClick:()=>this.toggleMonthAndYearView()},r("span",{id:"toggle-wrapper"},oe(this.locale,this.workingParts),r("ion-icon",{"aria-hidden":"true",icon:this.showMonthAndYear?a:i,lazy:!1,flipRtl:!0})),"md"===e&&r("ion-ripple-effect",null))),r("div",{class:"calendar-next-prev"},r("ion-buttons",null,r("ion-button",{"aria-label":"Previous month",disabled:n,onClick:()=>this.prevMonth(),part:"navigation-button previous-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:v,lazy:!1,flipRtl:!0})),r("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth(),part:"navigation-button next-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:f,lazy:!1,flipRtl:!0}))))),r("div",{class:"calendar-days-of-week","aria-hidden":"true",part:"calendar-days-of-week"},ne(this.locale,e,this.firstDayOfWeek%7).map((e=>r("div",{class:"day-of-week"},e)))))}renderMonth(t,a){const{disabled:i,readonly:n}=this,o=void 0===this.parsedYearValues||this.parsedYearValues.includes(a),s=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(t),d=!o||!s,l=i||n,h=i||je({month:t,year:a,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})}),c=this.workingParts.month===t&&this.workingParts.year===a,p=this.getActivePartsWithFallback();return r("div",{"aria-hidden":c?null:"true",class:{"calendar-month":!0,"calendar-month-disabled":!c&&h}},r("div",{class:"calendar-month-grid"},re(t,a,this.firstDayOfWeek%7,this.showAdjacentDays).map(((i,n)=>{const{day:o,dayOfWeek:s,isAdjacentDay:h}=i,{el:c,highlightedDates:m,isDateEnabled:u,multiple:b,showAdjacentDays:y}=this;let g=t,f=a;y&&h&&null!==o&&(o>20?1===t?(f=a-1,g=12):g=t-1:o<15&&(12===t?(f=a+1,g=1):g=t+1));const x={month:g,day:o,year:f,isAdjacentDay:h},v=null===o,{isActive:w,isToday:k,ariaLabel:j,ariaSelected:C,disabled:O,text:P}=ke(this.locale,x,this.activeParts,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues),D=J(x);let z=d||O;if(!z&&void 0!==u)try{z=!u(D)}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",c,t)}const V=z&&l,T=z||l;let $,A;return void 0===m||w||null===o||h||($=((t,a,i)=>{if(Array.isArray(t)){const e=a.split("T")[0],i=t.find((t=>t.date===e));if(i)return{textColor:i.textColor,backgroundColor:i.backgroundColor,border:i.border}}else try{return t(a)}catch(t){e("[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",i,t)}})(m,D,c)),v||h?h&&(A="calendar-day"+(z?" disabled":"")):A=`calendar-day${w?" active":""}${k?" today":""}${z?" disabled":""}`,r("div",{class:"calendar-day-wrapper"},r("button",{ref:e=>{e&&(e.style.setProperty("color",""+($?$.textColor:""),"important"),e.style.setProperty("background-color",""+($?$.backgroundColor:""),"important"),e.style.setProperty("border",""+($?$.border:""),"important"))},tabindex:"-1","data-day":o,"data-month":g,"data-year":f,"data-index":n,"data-day-of-week":s,disabled:T,class:{"calendar-day-padding":v,"calendar-day":!0,"calendar-day-active":w,"calendar-day-constrained":V,"calendar-day-today":k,"calendar-day-adjacent-day":h},part:A,"aria-hidden":v?"true":null,"aria-selected":C,"aria-label":j,onClick:()=>{v||(h?(this.el.blur(),this.activeParts=Object.assign(Object.assign({},p),x),this.animateToDate(x),this.confirm()):(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),x)),b?this.setActiveParts(x,w):this.setActiveParts(Object.assign(Object.assign({},p),x))))}},P))}))))}renderCalendarBody(){return r("div",{class:"calendar-body ion-focusable",ref:e=>this.calendarBodyRef=e,tabindex:"0"},Q(this.workingParts,this.forceRenderDate).map((({month:e,year:t})=>this.renderMonth(e,t))))}renderCalendar(e){return r("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(e),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return r("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{disabled:e,hourCycle:t,isTimePopoverOpen:a,locale:i,formatOptions:n}=this,o=se(i,t),s=this.getActivePartsWithFallback();return[r("div",{class:"time-header"},this.renderTimeLabel()),r("button",{class:{"time-body":!0,"time-body-active":a},part:"time-button"+(a?" active":""),"aria-expanded":"false","aria-haspopup":"true",disabled:e,onClick:async e=>{const{popoverRef:t}=this;t&&(this.isTimePopoverOpen=!0,t.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:e.target}})),await t.onWillDismiss(),this.isTimePopoverOpen=!1)}},de(i,s,o,null==n?void 0:n.time)),r("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:e=>{e.target.querySelectorAll("ion-picker-column").forEach((e=>e.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:e=>this.popoverRef=e},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){var t;const{activeParts:a,formatOptions:i,multiple:n,titleSelectedDatesFormatter:o}=this;let r;if(n&&Array.isArray(a)&&1!==a.length){if(r=a.length+" days",void 0!==o)try{r=o(J(a))}catch(t){e("[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:",t)}}else r=le(this.locale,this.getActivePartsWithFallback(),null!==(t=null==i?void 0:i.date)&&void 0!==t?t:{weekday:"short",month:"short",day:"numeric"});return r}renderHeader(e=!0){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return r("div",{class:"datetime-header",part:"datetime-header"},r("div",{class:"datetime-title",part:"datetime-title"},r("slot",{name:"title"},"Select Date")),e&&r("div",{class:"datetime-selected-date",part:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:e}=this;return r("div",{class:"datetime-time"},"time"===e?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return r("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(e){const{presentation:t,preferWheel:a}=this;if(a&&("date"===t||"date-time"===t||"time-date"===t))return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];switch(t){case"date-time":return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(!1),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:e,value:t,disabled:a,el:i,color:n,readonly:o,showMonthAndYear:d,preferWheel:l,presentation:h,size:c,isGridStyle:m}=this,u=w(this),y="year"===h||"month"===h||"month-year"===h,g=d||y,f=d&&!y,x=("date"===h||"date-time"===h||"time-date"===h)&&l;return p(!0,i,e,he(t),a),r(s,{key:"da5a32b82f28e43ccdd78e371b1491347d2c9dc3","aria-disabled":a?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},b(n,{[u]:!0,"datetime-readonly":o,"datetime-disabled":a,"show-month-and-year":g,"month-year-picker-open":f,["datetime-presentation-"+h]:!0,["datetime-size-"+c]:!0,"datetime-prefer-wheel":x,"datetime-grid":m}))},r("div",{key:"3edc567b8d6cefb3af3be0b6008322daeed52e94",class:"intersection-tracker",ref:e=>this.intersectionTrackerRef=e}),this.renderDatetime(u))}get el(){return this}static get watchers(){return{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}}static get style(){return{ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2);font-size:min(1.375rem, 35.2px)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}'}}},[289,"ion-datetime",{color:[1],name:[1],disabled:[4],formatOptions:[16],readonly:[4],isDateEnabled:[16],showAdjacentDays:[4,"show-adjacent-days"],min:[1025],max:[1025],presentation:[1],cancelText:[1,"cancel-text"],doneText:[1,"done-text"],clearText:[1,"clear-text"],yearValues:[8,"year-values"],monthValues:[8,"month-values"],dayValues:[8,"day-values"],hourValues:[8,"hour-values"],minuteValues:[8,"minute-values"],locale:[1],firstDayOfWeek:[2,"first-day-of-week"],titleSelectedDatesFormatter:[16],multiple:[4],highlightedDates:[16],value:[1025],showDefaultTitle:[4,"show-default-title"],showDefaultButtons:[4,"show-default-buttons"],showClearButton:[4,"show-clear-button"],showDefaultTimeLabel:[4,"show-default-time-label"],hourCycle:[1,"hour-cycle"],size:[1],preferWheel:[4,"prefer-wheel"],showMonthAndYear:[32],activeParts:[32],workingParts:[32],isTimePopoverOpen:[32],forceRenderDate:[32],confirm:[64],reset:[64],cancel:[64]},void 0,{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}]);let De=0;const ze="datetime-cancel",Ve="datetime-confirm",Te="wheel",$e="wheel-item",Ae="active",Ee=Pe,Se=function(){"undefined"!=typeof customElements&&["ion-datetime","ion-backdrop","ion-button","ion-buttons","ion-icon","ion-picker","ion-picker-column","ion-picker-column-option","ion-popover","ion-ripple-effect"].forEach((e=>{switch(e){case"ion-datetime":customElements.get(d(e))||customElements.define(d(e),Pe);break;case"ion-backdrop":customElements.get(d(e))||pe();break;case"ion-button":customElements.get(d(e))||me();break;case"ion-buttons":customElements.get(d(e))||ue();break;case"ion-icon":customElements.get(d(e))||be();break;case"ion-picker":customElements.get(d(e))||ye();break;case"ion-picker-column":customElements.get(d(e))||ge();break;case"ion-picker-column-option":customElements.get(d(e))||fe();break;case"ion-popover":customElements.get(d(e))||xe();break;case"ion-ripple-effect":customElements.get(d(e))||ve()}}))};export{Ee as IonDatetime,Se as defineCustomElement}
|
|
4
|
+
import{j as e,f as t,p as a,H as i,e as n,w as o,h as r,d as s,t as d}from"./p-BJoMtgfR.js";import{startFocusVisible as l}from"./p-BmVRXR1y.js";import{r as h,g as c,e as p}from"./p-DgbT0exM.js";import{F as m}from"./p-Cq8cQ0NL.js";import{i as u}from"./p-C53feagD.js";import{c as b}from"./p-DiVJyqlX.js";import{c as y,f as g,g as f,h as x,a as v}from"./p-CO7fmmxt.js";import{b as w}from"./p-CDfQnFrd.js";import{i as k,a as j,g as C,b as O,c as P,d as D,e as z,v as V,f as T,h as $,j as E,k as A,l as S,m as B,n as W,o as R,p as I,q as M,r as F,s as L,w as H,t as q,u as Y,x as G,y as J,z as N,A as K,B as Q,C as U,D as X,E as Z,F as _,G as ee,H as te,I as ae,J as ie,K as ne,L as oe,M as re,N as se,O as de,P as le,Q as he,R as ce}from"./p-BS1TtEiJ.js";import{d as pe}from"./p-CoA-aqGF.js";import{d as me}from"./p-BTeL5HCK.js";import{d as ue}from"./p-B8b1Ukl9.js";import{d as be}from"./p-YLXPWgVj.js";import{d as ye}from"./p-B6HaBl3o.js";import{d as ge}from"./p-FBcnjE5W.js";import{d as fe}from"./p-BxwWvu-b.js";import{d as xe}from"./p-DHsZWn1l.js";import{d as ve}from"./p-fpbh6w3f.js";const we=(e,t,a,i)=>null===e.day||void 0!==i&&!i.includes(e.day)||!(!t||!k(e,t))||!(!a||!j(e,a)),ke=(e,t,a,i,n,o,r)=>{const s=void 0!==(Array.isArray(a)?a:[a]).find((e=>P(t,e))),d=P(t,i);return{disabled:we(t,n,o,r),isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:z(e,d,t),text:null!=t.day?D(e,t):null}},je=(e,{minParts:t,maxParts:a})=>!!((e,t,a)=>!!(t&&t.year>e)||!!(a&&a.year<e))(e.year,t,a)||!!(t&&k(e,t)||a&&j(e,a)),Ce=(e,a)=>{var i,n,o,r;((null===(i=null==a?void 0:a.date)||void 0===i?void 0:i.timeZone)||(null===(n=null==a?void 0:a.date)||void 0===n?void 0:n.timeZoneName)||(null===(o=null==a?void 0:a.time)||void 0===o?void 0:o.timeZone)||(null===(r=null==a?void 0:a.time)||void 0===r?void 0:r.timeZoneName))&&t('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".',e)},Oe=(e,a,i)=>{if(i)switch(a){case"date":case"month-year":case"month":case"year":void 0===i.date&&t(`[ion-datetime] - The '${a}' presentation requires a date object in formatOptions.`,e);break;case"time":void 0===i.time&&t("[ion-datetime] - The 'time' presentation requires a time object in formatOptions.",e);break;case"date-time":case"time-date":void 0===i.date&&void 0===i.time&&t(`[ion-datetime] - The '${a}' presentation requires either a date or time object (or both) in formatOptions.`,e)}},Pe=a(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ionCancel=n(this,"ionCancel",7),this.ionChange=n(this,"ionChange",7),this.ionValueChange=n(this,"ionValueChange",7),this.ionFocus=n(this,"ionFocus",7),this.ionBlur=n(this,"ionBlur",7),this.ionStyle=n(this,"ionStyle",7),this.ionRender=n(this,"ionRender",7),this.inputId="ion-dt-"+De++,this.prevPresentation=null,this.showMonthAndYear=!1,this.activeParts=[],this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm",isAdjacentDay:!1},this.isTimePopoverOpen=!1,this.color="primary",this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.showAdjacentDays=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.warnIfIncorrectValueUsage=()=>{const{multiple:e,value:a}=this;!e&&Array.isArray(a)&&t(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${a.map((e=>`'${e}'`)).join(", ")}]\n`,this.el)},this.setValue=e=>{this.value=e,this.ionChange.emit({value:e})},this.getActivePartsWithFallback=()=>{var e;const{defaultParts:t}=this;return null!==(e=this.getActivePart())&&void 0!==e?e:t},this.getActivePart=()=>{const{activeParts:e}=this;return Array.isArray(e)?e[0]:e},this.closeParentOverlay=e=>{const t=this.el.closest("ion-modal, ion-popover");t&&t.dismiss(void 0,e)},this.setWorkingParts=e=>{this.workingParts=Object.assign({},e)},this.setActiveParts=(e,t=!1)=>{if(this.readonly)return;const{multiple:a,minParts:i,maxParts:n,activeParts:o}=this,r=V(e,i,n);if(this.setWorkingParts(r),a){const e=Array.isArray(o)?o:[o];this.activeParts=t?e.filter((e=>!P(e,r))):[...e,r]}else this.activeParts=Object.assign({},r);null!==this.el.querySelector('[slot="buttons"]')||this.showDefaultButtons||this.confirm()},this.initializeKeyboardListeners=()=>{const e=this.calendarBodyRef;if(!e)return;const t=this.el.shadowRoot,a=e.querySelector(".calendar-month:nth-of-type(2)"),i=new MutationObserver((t=>{var i;!(null===(i=t[0].oldValue)||void 0===i?void 0:i.includes("ion-focused"))&&e.classList.contains("ion-focused")&&this.focusWorkingDay(a)}));i.observe(e,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{null==i||i.disconnect()},e.addEventListener("keydown",(e=>{const i=t.activeElement;if(!i||!i.classList.contains("calendar-day"))return;const n=T(i);let o;switch(e.key){case"ArrowDown":e.preventDefault(),o=I(n);break;case"ArrowUp":e.preventDefault(),o=R(n);break;case"ArrowRight":e.preventDefault(),o=W(n);break;case"ArrowLeft":e.preventDefault(),o=B(n);break;case"Home":e.preventDefault(),o=S(n);break;case"End":e.preventDefault(),o=A(n);break;case"PageUp":e.preventDefault(),o=e.shiftKey?E(n):C(n);break;case"PageDown":e.preventDefault(),o=e.shiftKey?$(n):O(n);break;default:return}we(o,this.minParts,this.maxParts)||(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),o)),requestAnimationFrame((()=>this.focusWorkingDay(a))))}))},this.focusWorkingDay=e=>{const{day:t,month:a,year:i}=this.workingParts,n=new Date(`${a}/1/${i}`).getDay();if(null===t)return;const o=e.querySelector(`.calendar-day-wrapper:nth-of-type(${(n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-(this.firstDayOfWeek-n))+t}) .calendar-day`);o&&o.focus()},this.processMinParts=()=>{const{min:e,defaultParts:t}=this;this.minParts=void 0!==e?M(e,t):void 0},this.processMaxParts=()=>{const{max:e,defaultParts:t}=this;this.maxParts=void 0!==e?F(e,t):void 0},this.initializeCalendarListener=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelectorAll(".calendar-month"),a=t[0],i=t[1],n=t[2],r="ios"===w(this)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1;o((()=>{e.scrollLeft=a.clientWidth*(u(this.el)?-1:1);const t=t=>{const i=e.getBoundingClientRect(),o=(u(this.el)?e.scrollLeft>=-2:e.scrollLeft<=2)?a:n,r=o.getBoundingClientRect();if(Math.abs(r.x-i.x)>2)return;const{forceRenderDate:s}=this;return void 0!==s?{month:s.month,year:s.year,day:s.day}:o===a?C(t):o===n?O(t):void 0},s=()=>{r&&(e.style.removeProperty("pointer-events"),l=!1);const a=t(this.workingParts);if(!a)return;const{month:n,day:s,year:d}=a;je({month:n,year:d,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})||(e.style.setProperty("overflow","hidden"),o((()=>{var t;this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:n,day:s,year:d})),e.scrollLeft=i.clientWidth*(u(this.el)?-1:1),e.style.removeProperty("overflow"),this.resolveForceDateScrolling&&this.resolveForceDateScrolling();const a=this.el.shadowRoot.activeElement;a&&a.classList.contains("calendar-day")&&(null===(t=a.closest(".calendar-body"))||void 0===t||t.focus())})))};let d,l=!1;const h=()=>{d&&clearTimeout(d),!l&&r&&(e.style.setProperty("pointer-events","none"),l=!0),d=setTimeout(s,50)};e.addEventListener("scroll",h),this.destroyCalendarListener=()=>{e.removeEventListener("scroll",h)}}))},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:e,destroyKeyboardMO:t}=this;void 0!==e&&e(),void 0!==t&&t()},this.ensureReadyIfVisible=()=>{if(this.el.classList.contains("datetime-ready"))return;const e=this.el.getBoundingClientRect();0!==e.width&&0!==e.height&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))},this.loadTimeoutCleanup=()=>{this.loadTimeout&&(clearTimeout(this.loadTimeout),this.loadTimeout=void 0)},this.processValue=e=>{const t=null!=e&&""!==e&&(!Array.isArray(e)||e.length>0),a=t?L(e):this.defaultParts,{minParts:i,maxParts:n,workingParts:o,el:r}=this;if(this.warnIfIncorrectValueUsage(),!a)return;t&&H(a,i,n);const s=Y(Array.isArray(a)?a[a.length-1]:a,i,n),{month:d,day:l,year:h,hour:c,minute:p}=s,m=q(c);this.activeParts=t?Array.isArray(a)?[...a]:{month:d,day:l,year:h,hour:c,minute:p,ampm:m}:[];const u=void 0!==d&&d!==o.month||void 0!==h&&h!==o.year,b=r.classList.contains("datetime-ready"),{isGridStyle:y,showMonthAndYear:g}=this;y&&u&&b&&!g?this.animateToDate(s):this.setWorkingParts({month:d,day:l,year:h,hour:c,minute:p,ampm:m})},this.animateToDate=async e=>{const{workingParts:t}=this;this.forceRenderDate=e;const a=new Promise((e=>{this.resolveForceDateScrolling=e}));k(e,t)?this.prevMonth():this.nextMonth(),await a,this.resolveForceDateScrolling=void 0,this.forceRenderDate=void 0},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value,this.nextMonth=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelector(".calendar-month:last-of-type");t&&e.scrollTo({top:0,left:2*t.offsetWidth*(u(this.el)?-1:1),behavior:"smooth"})},this.prevMonth=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelector(".calendar-month:first-of-type");t&&e.scrollTo({top:0,left:2*t.offsetWidth*(u(this.el)?1:-1),behavior:"smooth"})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}formatOptionsChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t),Ce(e,t)}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}presentationChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t)}get isGridStyle(){const{presentation:e,preferWheel:t}=this;return("date"===e||"date-time"===e||"time-date"===e)&&!t}yearValuesChanged(){this.parsedYearValues=G(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=G(this.monthValues)}dayValuesChanged(){this.parsedDayValues=G(this.dayValues)}hourValuesChanged(){this.parsedHourValues=G(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=G(this.minuteValues)}async valueChanged(){const{value:e}=this;this.hasValue()&&this.processValue(e),this.emitStyle(),this.ionValueChange.emit({value:e})}async confirm(e=!1){const{isCalendarPicker:t,activeParts:a,preferWheel:i,workingParts:n}=this;void 0===a&&t||this.setValue(Array.isArray(a)&&0===a.length?i?J(n):void 0:J(a)),e&&this.closeParentOverlay(Ve)}async reset(e){this.processValue(e)}async cancel(e=!1){this.ionCancel.emit(),e&&this.closeParentOverlay(ze)}get isCalendarPicker(){const{presentation:e}=this;return"date"===e||"date-time"===e||"time-date"===e}connectedCallback(){this.clearFocusVisible=l(this.el).destroy,this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100)}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0),this.loadTimeoutCleanup()}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const{el:e,intersectionTrackerRef:t}=this,a=new IntersectionObserver((e=>{e[0].isIntersecting&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))}),{threshold:.01,root:e});h((()=>null==a?void 0:a.observe(t))),this.loadTimeoutCleanup(),this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100);const i=new IntersectionObserver((e=>{e[0].isIntersecting||(this.destroyInteractionListeners(),this.showMonthAndYear=!1,o((()=>{this.el.classList.remove("datetime-ready")})))}),{threshold:0,root:e});h((()=>null==i?void 0:i.observe(t)));const n=c(this.el);n.addEventListener("ionFocus",(e=>e.stopPropagation())),n.addEventListener("ionBlur",(e=>e.stopPropagation()))}componentDidRender(){const{presentation:e,prevPresentation:t,calendarBodyRef:a,minParts:i,preferWheel:n,forceRenderDate:o}=this;if(void 0!==i&&!n&&["date-time","time-date","date"].includes(e)&&a){const e=a.querySelector(".calendar-month:nth-of-type(1)");e&&void 0===o&&(a.scrollLeft=e.clientWidth*(u(this.el)?-1:1))}null!==t?e!==t&&(this.prevPresentation=e,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,h((()=>{this.ionRender.emit()}))):this.prevPresentation=e}componentWillLoad(){const{el:e,formatOptions:a,highlightedDates:i,multiple:n,presentation:o,preferWheel:r}=this;n&&("date"!==o&&t('[ion-datetime] - Multiple date selection is only supported for presentation="date".',e),r&&t('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".',e)),void 0!==i&&("date"!==o&&"date-time"!==o&&"time-date"!==o&&t("[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.",e),r&&t('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".',e)),a&&(Oe(e,o,a),Ce(e,a));const s=this.parsedHourValues=G(this.hourValues),d=this.parsedMinuteValues=G(this.minuteValues),l=this.parsedMonthValues=G(this.monthValues),h=this.parsedYearValues=G(this.yearValues),c=this.parsedDayValues=G(this.dayValues),p=this.todayParts=L(N());this.processMinParts(),this.processMaxParts(),this.defaultParts=K({refParts:p,monthValues:l,dayValues:c,yearValues:h,hourValues:s,minuteValues:d,minParts:this.minParts,maxParts:this.maxParts}),this.processValue(this.value),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{disabled:e,readonly:t,showDefaultButtons:a,showClearButton:i}=this,n=e||t;if(null===this.el.querySelector('[slot="buttons"]')&&!a&&!i)return;const o=()=>{this.reset(),this.setValue(void 0)};return r("div",{class:"datetime-footer"},r("div",{class:"datetime-buttons"},r("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},r("slot",{name:"buttons"},r("ion-buttons",null,a&&r("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0),disabled:n},this.cancelText),r("div",{class:"datetime-action-buttons-container"},i&&r("ion-button",{id:"clear-button",color:this.color,onClick:()=>o(),disabled:n},this.clearText),a&&r("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0),disabled:n},this.doneText)))))))}renderWheelPicker(e=this.presentation){const t="time-date"===e?[this.renderTimePickerColumns(e),this.renderDatePickerColumns(e)]:[this.renderDatePickerColumns(e),this.renderTimePickerColumns(e)];return r("ion-picker",{class:m},t)}renderDatePickerColumns(e){return"date-time"===e||"time-date"===e?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(e)}renderCombinedDatePickerColumn(){const{defaultParts:t,disabled:a,workingParts:i,locale:n,minParts:o,maxParts:s,todayParts:d,isDateEnabled:l}=this,h=this.getActivePartsWithFallback(),c=Q(i),p=c[c.length-1];c[0].day=1,p.day=U(p.month,p.year);const m=void 0!==o&&j(o,c[0])?o:c[0],u=void 0!==s&&k(s,p)?s:p,b=X(n,d,m,u,this.parsedDayValues,this.parsedMonthValues);let y=b.items;const g=b.parts;l&&(y=y.map(((t,a)=>{const i=g[a];let n;try{n=!l(J(i))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:n})})));const f=null!==i.day?`${i.year}-${i.month}-${i.day}`:`${t.year}-${t.month}-${t.day}`;return r("ion-picker-column",{part:Te,"aria-label":"Select a date",class:"date-column",color:this.color,disabled:a,value:f,onIonChange:e=>{const{value:t}=e.detail,a=g.find((({month:e,day:a,year:i})=>t===`${i}-${e}-${a}`));this.setWorkingParts(Object.assign(Object.assign({},i),a)),this.setActiveParts(Object.assign(Object.assign({},h),a)),e.stopPropagation()}},y.map((e=>r("ion-picker-column-option",{part:e.value===f?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderIndividualDatePickerColumns(t){const{workingParts:a,isDateEnabled:i}=this,n="year"!==t&&"time"!==t?Z(this.locale,a,this.minParts,this.maxParts,this.parsedMonthValues):[];let o="date"===t?_(this.locale,a,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(o=o.map((t=>{const{value:n}=t,o={month:a.month,day:"string"==typeof n?parseInt(n):n,year:a.year};let r;try{r=!i(J(o))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:r})})));const r="month"!==t&&"time"!==t?ee(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];let s=[];return s=te(this.locale,{month:"numeric",day:"numeric"})?[this.renderMonthPickerColumn(n),this.renderDayPickerColumn(o),this.renderYearPickerColumn(r)]:[this.renderDayPickerColumn(o),this.renderMonthPickerColumn(n),this.renderYearPickerColumn(r)],s}renderDayPickerColumn(e){var t;if(0===e.length)return[];const{disabled:a,workingParts:i}=this,n=this.getActivePartsWithFallback(),o=null!==(t=null!==i.day?i.day:this.defaultParts.day)&&void 0!==t?t:void 0;return r("ion-picker-column",{part:Te,"aria-label":"Select a day",class:"day-column",color:this.color,disabled:a,value:o,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},i),{day:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},n),{day:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===o?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMonthPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a month",class:"month-column",color:this.color,disabled:t,value:a.month,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{month:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{month:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.month?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderYearPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a year",class:"year-column",color:this.color,disabled:t,value:a.year,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{year:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{year:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.year?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderTimePickerColumns(e){if(["date","month","month-year","year"].includes(e))return[];const t=void 0!==this.getActivePart(),{hoursData:a,minutesData:i,dayPeriodData:n}=ae(this.locale,this.workingParts,this.hourCycle,t?this.minParts:void 0,t?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(a),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select an hour",color:this.color,disabled:t,value:i.hour,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{hour:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{hour:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.hour?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMinutePickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a minute",color:this.color,disabled:t,value:i.minute,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{minute:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{minute:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.minute?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderDayPeriodPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback(),n=ie(this.locale);return r("ion-picker-column",{part:Te,"aria-label":"Select a day period",style:n?{order:"-1"}:{},color:this.color,disabled:t,value:i.ampm,onIonChange:e=>{const t=ce(a,e.detail.value);this.setWorkingParts(Object.assign(Object.assign({},a),{ampm:e.detail.value,hour:t})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{ampm:e.detail.value,hour:t})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.ampm?`${$e} ${Ee}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderWheelView(e){const{locale:t}=this,a=te(t)?"month-first":"year-first";return r("div",{class:{["wheel-order-"+a]:!0}},this.renderWheelPicker(e))}renderCalendarHeader(e){const{disabled:t}=this,a="ios"===e?y:g,i="ios"===e?f:x,n=t||((e,t,a)=>{const i=Object.assign(Object.assign({},C(this.workingParts)),{day:null});return je(i,{minParts:t,maxParts:a})})(0,this.minParts,this.maxParts),o=t||((e,t)=>{const a=Object.assign(Object.assign({},O(this.workingParts)),{day:null});return je(a,{maxParts:t})})(0,this.maxParts),s=this.el.getAttribute("dir")||void 0;return r("div",{class:"calendar-header",part:"calendar-header"},r("div",{class:"calendar-action-buttons"},r("div",{class:"calendar-month-year"},r("button",{class:{"calendar-month-year-toggle":!0,"ion-activatable":!0,"ion-focusable":!0},part:"month-year-button",disabled:t,"aria-label":this.showMonthAndYear?"Hide year picker":"Show year picker",onClick:()=>this.toggleMonthAndYearView()},r("span",{id:"toggle-wrapper"},oe(this.locale,this.workingParts),r("ion-icon",{"aria-hidden":"true",icon:this.showMonthAndYear?a:i,lazy:!1,flipRtl:!0})),"md"===e&&r("ion-ripple-effect",null))),r("div",{class:"calendar-next-prev"},r("ion-buttons",null,r("ion-button",{"aria-label":"Previous month",disabled:n,onClick:()=>this.prevMonth(),part:"navigation-button previous-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:v,lazy:!1,flipRtl:!0})),r("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth(),part:"navigation-button next-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:f,lazy:!1,flipRtl:!0}))))),r("div",{class:"calendar-days-of-week","aria-hidden":"true",part:"calendar-days-of-week"},ne(this.locale,e,this.firstDayOfWeek%7).map((e=>r("div",{class:"day-of-week"},e)))))}renderMonth(t,a){const{disabled:i,readonly:n}=this,o=void 0===this.parsedYearValues||this.parsedYearValues.includes(a),s=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(t),d=!o||!s,l=i||n,h=i||je({month:t,year:a,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})}),c=this.workingParts.month===t&&this.workingParts.year===a,p=this.getActivePartsWithFallback();return r("div",{"aria-hidden":c?null:"true",class:{"calendar-month":!0,"calendar-month-disabled":!c&&h}},r("div",{class:"calendar-month-grid"},re(t,a,this.firstDayOfWeek%7,this.showAdjacentDays).map(((i,n)=>{const{day:o,dayOfWeek:s,isAdjacentDay:h}=i,{el:c,highlightedDates:m,isDateEnabled:u,multiple:b,showAdjacentDays:y}=this;let g=t,f=a;y&&h&&null!==o&&(o>20?1===t?(f=a-1,g=12):g=t-1:o<15&&(12===t?(f=a+1,g=1):g=t+1));const x={month:g,day:o,year:f,isAdjacentDay:h},v=null===o,{isActive:w,isToday:k,ariaLabel:j,ariaSelected:C,disabled:O,text:P}=ke(this.locale,x,this.activeParts,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues),D=J(x);let z=d||O;if(!z&&void 0!==u)try{z=!u(D)}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",c,t)}const V=z&&l,T=z||l;let $,E;return void 0===m||w||null===o||h||($=((t,a,i)=>{if(Array.isArray(t)){const e=a.split("T")[0],i=t.find((t=>t.date===e));if(i)return{textColor:i.textColor,backgroundColor:i.backgroundColor,border:i.border}}else try{return t(a)}catch(t){e("[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",i,t)}})(m,D,c)),v||h?h&&(E="calendar-day"+(z?" disabled":"")):E=`calendar-day${w?" active":""}${k?" today":""}${z?" disabled":""}`,r("div",{class:"calendar-day-wrapper"},r("button",{ref:e=>{e&&(e.style.setProperty("color",""+($?$.textColor:""),"important"),e.style.setProperty("background-color",""+($?$.backgroundColor:""),"important"),e.style.setProperty("border",""+($?$.border:""),"important"))},tabindex:"-1","data-day":o,"data-month":g,"data-year":f,"data-index":n,"data-day-of-week":s,disabled:T,class:{"calendar-day-padding":v,"calendar-day":!0,"calendar-day-active":w,"calendar-day-constrained":V,"calendar-day-today":k,"calendar-day-adjacent-day":h},part:E,"aria-hidden":v?"true":null,"aria-selected":C,"aria-label":j,onClick:()=>{v||(h?(this.el.blur(),this.activeParts=Object.assign(Object.assign({},p),x),this.animateToDate(x),this.confirm()):(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),x)),b?this.setActiveParts(x,w):this.setActiveParts(Object.assign(Object.assign({},p),x))))}},P))}))))}renderCalendarBody(){return r("div",{class:"calendar-body ion-focusable",ref:e=>this.calendarBodyRef=e,tabindex:"0"},Q(this.workingParts,this.forceRenderDate).map((({month:e,year:t})=>this.renderMonth(e,t))))}renderCalendar(e){return r("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(e),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return r("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{disabled:e,hourCycle:t,isTimePopoverOpen:a,locale:i,formatOptions:n}=this,o=se(i,t),s=this.getActivePartsWithFallback();return[r("div",{class:"time-header"},this.renderTimeLabel()),r("button",{class:{"time-body":!0,"time-body-active":a},part:"time-button"+(a?" active":""),"aria-expanded":"false","aria-haspopup":"true",disabled:e,onClick:async e=>{const{popoverRef:t}=this;t&&(this.isTimePopoverOpen=!0,t.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:e.target}})),await t.onWillDismiss(),this.isTimePopoverOpen=!1)}},de(i,s,o,null==n?void 0:n.time)),r("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:e=>{e.target.querySelectorAll("ion-picker-column").forEach((e=>e.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:e=>this.popoverRef=e},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){var t;const{activeParts:a,formatOptions:i,multiple:n,titleSelectedDatesFormatter:o}=this;let r;if(n&&Array.isArray(a)&&1!==a.length){if(r=a.length+" days",void 0!==o)try{r=o(J(a))}catch(t){e("[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:",t)}}else r=le(this.locale,this.getActivePartsWithFallback(),null!==(t=null==i?void 0:i.date)&&void 0!==t?t:{weekday:"short",month:"short",day:"numeric"});return r}renderHeader(e=!0){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return r("div",{class:"datetime-header",part:"datetime-header"},r("div",{class:"datetime-title",part:"datetime-title"},r("slot",{name:"title"},"Select Date")),e&&r("div",{class:"datetime-selected-date",part:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:e}=this;return r("div",{class:"datetime-time"},"time"===e?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return r("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(e){const{presentation:t,preferWheel:a}=this;if(a&&("date"===t||"date-time"===t||"time-date"===t))return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];switch(t){case"date-time":return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(!1),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:e,value:t,disabled:a,el:i,color:n,readonly:o,showMonthAndYear:d,preferWheel:l,presentation:h,size:c,isGridStyle:m}=this,u=w(this),y="year"===h||"month"===h||"month-year"===h,g=d||y,f=d&&!y,x=("date"===h||"date-time"===h||"time-date"===h)&&l;return p(!0,i,e,he(t),a),r(s,{key:"59e0811aa273e88dfb8e4b703e6824088a457380","aria-disabled":a?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},b(n,{[u]:!0,"datetime-readonly":o,"datetime-disabled":a,"show-month-and-year":g,"month-year-picker-open":f,["datetime-presentation-"+h]:!0,["datetime-size-"+c]:!0,"datetime-prefer-wheel":x,"datetime-grid":m}))},r("div",{key:"3753ff3dde3085070916c3de83687a219a49e553",class:"intersection-tracker",ref:e=>this.intersectionTrackerRef=e}),this.renderDatetime(u))}get el(){return this}static get watchers(){return{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}}static get style(){return{ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2);font-size:min(1.375rem, 35.2px)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}'}}},[289,"ion-datetime",{color:[1],name:[1],disabled:[4],formatOptions:[16],readonly:[4],isDateEnabled:[16],showAdjacentDays:[4,"show-adjacent-days"],min:[1025],max:[1025],presentation:[1],cancelText:[1,"cancel-text"],doneText:[1,"done-text"],clearText:[1,"clear-text"],yearValues:[8,"year-values"],monthValues:[8,"month-values"],dayValues:[8,"day-values"],hourValues:[8,"hour-values"],minuteValues:[8,"minute-values"],locale:[1],firstDayOfWeek:[2,"first-day-of-week"],titleSelectedDatesFormatter:[16],multiple:[4],highlightedDates:[16],value:[1025],showDefaultTitle:[4,"show-default-title"],showDefaultButtons:[4,"show-default-buttons"],showClearButton:[4,"show-clear-button"],showDefaultTimeLabel:[4,"show-default-time-label"],hourCycle:[1,"hour-cycle"],size:[1],preferWheel:[4,"prefer-wheel"],showMonthAndYear:[32],activeParts:[32],workingParts:[32],isTimePopoverOpen:[32],forceRenderDate:[32],confirm:[64],reset:[64],cancel:[64]},void 0,{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}]);let De=0;const ze="datetime-cancel",Ve="datetime-confirm",Te="wheel",$e="wheel-item",Ee="active",Ae=Pe,Se=function(){"undefined"!=typeof customElements&&["ion-datetime","ion-backdrop","ion-button","ion-buttons","ion-icon","ion-picker","ion-picker-column","ion-picker-column-option","ion-popover","ion-ripple-effect"].forEach((e=>{switch(e){case"ion-datetime":customElements.get(d(e))||customElements.define(d(e),Pe);break;case"ion-backdrop":customElements.get(d(e))||pe();break;case"ion-button":customElements.get(d(e))||me();break;case"ion-buttons":customElements.get(d(e))||ue();break;case"ion-icon":customElements.get(d(e))||be();break;case"ion-picker":customElements.get(d(e))||ye();break;case"ion-picker-column":customElements.get(d(e))||ge();break;case"ion-picker-column-option":customElements.get(d(e))||fe();break;case"ion-popover":customElements.get(d(e))||xe();break;case"ion-ripple-effect":customElements.get(d(e))||ve()}}))};export{Ae as IonDatetime,Se as defineCustomElement}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{P as o,d as s}from"./p-
|
|
4
|
+
import{P as o,d as s}from"./p-FBcnjE5W.js";const p=o,r=s;export{p as IonPickerColumn,r as defineCustomElement}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{p as t,H as i,e,h as s,d as n,t as o}from"./p-BJoMtgfR.js";import{d as a}from"./p-ZjP4CjeZ.js";import{r as l}from"./p-DgbT0exM.js";import{b as r,a as c,h as d}from"./p-cyNmxje6.js";import{a as p,b as h}from"./p-CDfQnFrd.js";import{c as u}from"./p-DiVJyqlX.js";const m=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.ionChange=e(this,"ionChange",7),this.isScrolling=!1,this.isColumnVisible=!1,this.canExitInputMode=!0,this.updateValueTextOnScroll=!1,this.ariaLabel=null,this.isActive=!1,this.disabled=!1,this.color="primary",this.numericInput=!1,this.centerPickerItemInView=(t,i=!0,e=!0)=>{const{isColumnVisible:s,scrollEl:n}=this;if(s&&n){const s=t.offsetTop-3*t.clientHeight+t.clientHeight/2;n.scrollTop!==s&&(this.canExitInputMode=e,this.updateValueTextOnScroll=!1,n.scroll({top:s,left:0,behavior:i?"smooth":void 0}))}},this.setPickerItemActiveState=(t,i)=>{i?t.classList.add(f):t.classList.remove(f)},this.inputModeChange=t=>{if(!this.numericInput)return;const{useInputMode:i,inputModeColumn:e}=t.detail;this.setInputModeActive(!(!i||void 0!==e&&e!==this.el))},this.setInputModeActive=t=>{this.isScrolling?this.scrollEndCallback=()=>{this.isActive=t}:this.isActive=t},this.initializeScrollListener=()=>{const t=p("ios"),{el:i,scrollEl:e}=this;let s,n=this.activeItem;const o=()=>{l((()=>{var o;if(!e)return;s&&(clearTimeout(s),s=void 0),this.isScrolling||(t&&r(),this.isScrolling=!0);const l=e.getBoundingClientRect(),p=l.x+l.width/2,h=l.y+l.height/2,u=i.getRootNode(),m=u instanceof ShadowRoot?u:a;if(void 0===m)return;let f=m.elementsFromPoint(p,h).find((t=>"ION-PICKER-COLUMN-OPTION"===t.tagName));if(void 0===f){const t=m.elementFromPoint(p,h);"ION-PICKER-COLUMN-OPTION"===(null==t?void 0:t.tagName)&&(f=t)}void 0!==n&&this.setPickerItemActiveState(n,!1),void 0===f||f.disabled||(f!==n&&(t&&c(),this.canExitInputMode&&this.exitInputMode()),n=f,this.setPickerItemActiveState(f,!0),this.updateValueTextOnScroll&&(null===(o=this.assistiveFocusable)||void 0===o||o.setAttribute("aria-valuetext",this.getOptionValueText(f))),s=setTimeout((()=>{this.isScrolling=!1,this.updateValueTextOnScroll=!0,t&&d();const{scrollEndCallback:i}=this;i&&(i(),this.scrollEndCallback=void 0),this.canExitInputMode=!0,this.setValue(f.value)}),250))}))};l((()=>{e&&(e.addEventListener("scroll",o),this.destroyScrollListener=()=>{e.removeEventListener("scroll",o)})}))},this.exitInputMode=()=>{const{parentEl:t}=this;null!=t&&(t.exitInputMode(),this.el.classList.remove("picker-column-active"))},this.findNextOption=(t=1)=>{const{activeItem:i}=this;if(!i)return null;let e=i,s=i.nextElementSibling;for(;null!=s;){if(t>0&&t--,"ION-PICKER-COLUMN-OPTION"===s.tagName&&!s.disabled&&0===t)return s;e=s,s=s.nextElementSibling}return e},this.findPreviousOption=(t=1)=>{const{activeItem:i}=this;if(!i)return null;let e=i,s=i.previousElementSibling;for(;null!=s;){if(t>0&&t--,"ION-PICKER-COLUMN-OPTION"===s.tagName&&!s.disabled&&0===t)return s;e=s,s=s.previousElementSibling}return e},this.onKeyDown=t=>{const i=p("mobile");let e=null;switch(t.key){case"ArrowDown":e=i?this.findPreviousOption():this.findNextOption();break;case"ArrowUp":e=i?this.findNextOption():this.findPreviousOption();break;case"PageUp":e=i?this.findNextOption(5):this.findPreviousOption(5);break;case"PageDown":e=i?this.findPreviousOption(5):this.findNextOption(5);break;case"Home":e=this.el.querySelector("ion-picker-column-option:first-of-type");break;case"End":e=this.el.querySelector("ion-picker-column-option:last-of-type")}null!==e&&(this.setValue(e.value),t.preventDefault())},this.getOptionValueText=t=>{var i;return t?null!==(i=t.getAttribute("aria-label"))&&void 0!==i?i:t.innerText:""}}ariaLabelChanged(t){this.ariaLabel=t}valueChange(){this.isColumnVisible&&this.scrollActiveItemIntoView(!0)}componentWillLoad(){const t=this.parentEl=this.el.closest("ion-picker");new IntersectionObserver((t=>{if(t[t.length-1].isIntersecting){const{activeItem:t,el:i}=this;this.isColumnVisible=!0;const e=i.querySelector(`.${f}`);e&&this.setPickerItemActiveState(e,!1),this.scrollActiveItemIntoView(),t&&this.setPickerItemActiveState(t,!0),this.initializeScrollListener()}else this.isColumnVisible=!1,this.destroyScrollListener&&(this.destroyScrollListener(),this.destroyScrollListener=void 0)}),{threshold:.001,root:this.parentEl}).observe(this.el),null!==t&&t.addEventListener("ionInputModeChange",(t=>this.inputModeChange(t)))}componentDidRender(){const{el:t,activeItem:i,isColumnVisible:e,value:s}=this;if(e&&!i){const i=t.querySelector("ion-picker-column-option");null!==i&&i.value!==s&&this.setValue(i.value)}}async scrollActiveItemIntoView(t=!1){const i=this.activeItem;i&&this.centerPickerItemInView(i,t,!1)}async setValue(t){!0!==this.disabled&&this.value!==t&&(this.value=t,this.ionChange.emit({value:t}))}async setFocus(){this.assistiveFocusable&&this.assistiveFocusable.focus()}connectedCallback(){var t;this.ariaLabel=null!==(t=this.el.getAttribute("aria-label"))&&void 0!==t?t:"Select a value"}get activeItem(){const{value:t}=this;return Array.from(this.el.querySelectorAll("ion-picker-column-option")).find((i=>!(!this.disabled&&i.disabled)&&i.value===t))}render(){const{color:t,disabled:i,isActive:e,numericInput:o}=this,a=h(this);return s(n,{key:"234c96a501d7ac413b9b0ea56b33017681e25b40",class:u(t,{[a]:!0,"picker-column-active":e,"picker-column-numeric-input":o,"picker-column-disabled":i})},s("slot",{key:"9dc15ea0601ddd2cb2e0a745e91e036a8bd96f8b",name:"prefix"}),s("div",{key:"de4fe28ee4bc46b7c0420d6ab0df0e7809443da9",class:"picker-opts",ref:t=>{this.scrollEl=t},role:"slider",tabindex:this.disabled?void 0:0,"aria-label":this.ariaLabel,"aria-valuemin":0,"aria-valuemax":0,"aria-valuenow":0,"aria-valuetext":this.getOptionValueText(this.activeItem),"aria-orientation":"vertical",onKeyDown:t=>this.onKeyDown(t)},s("div",{key:"5297617462cc30e9444039ae032d8bdf718349af",class:"picker-item-empty","aria-hidden":"true"}," "),s("div",{key:"55ea39ef867bcb1a11a912d52ecd20cb886c5fb3",class:"picker-item-empty","aria-hidden":"true"}," "),s("div",{key:"3496730ce6182ebfd33e0ee4bafc130feb575a31",class:"picker-item-empty","aria-hidden":"true"}," "),s("slot",{key:"44c3628aa957d60f799dc7019f72fe8b676c7843"}),s("div",{key:"5a1809f6c949678a67e0d4b5bfe93ea335c0161d",class:"picker-item-empty","aria-hidden":"true"}," "),s("div",{key:"98fd57f1c66dbaebc2db2dd5da142671b3159fd1",class:"picker-item-empty","aria-hidden":"true"}," "),s("div",{key:"85590708abddfa885994e549deac64866fec938f",class:"picker-item-empty","aria-hidden":"true"}," ")),s("slot",{key:"bb7e674f543696a80fcbfb1f68f2e975826898a6",name:"suffix"}))}get el(){return this}static get watchers(){return{"aria-label":[{ariaLabelChanged:0}],value:[{valueChange:0}]}}static get style(){return":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;height:200px;font-size:22px;text-align:center}.assistive-focusable{left:0;right:0;top:0;bottom:0;position:absolute;z-index:1;pointer-events:none}.assistive-focusable:focus{outline:none}.picker-opts{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-width:26px;max-height:200px;outline:none;text-align:inherit;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none}.picker-item-empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.picker-opts::-webkit-scrollbar{display:none}::slotted(ion-picker-column-option){display:block;scroll-snap-align:center}.picker-item-empty,:host(:not([disabled])) ::slotted(ion-picker-column-option.option-disabled){scroll-snap-align:none}::slotted([slot=prefix]),::slotted([slot=suffix]){max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}::slotted([slot=prefix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:end;justify-content:end}::slotted([slot=suffix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:start;justify-content:start}:host(.picker-column-disabled) .picker-opts{overflow-y:hidden}:host(.picker-column-disabled) ::slotted(ion-picker-column-option){cursor:default;opacity:0.4;pointer-events:none}@media (any-hover: hover){:host(:focus) .picker-opts{outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}"}},[257,"ion-picker-column",{disabled:[4],value:[1032],color:[513],numericInput:[4,"numeric-input"],ariaLabel:[32],isActive:[32],scrollActiveItemIntoView:[64],setValue:[64],setFocus:[64]},void 0,{"aria-label":[{ariaLabelChanged:0}],value:[{valueChange:0}]}]),f="option-active";function b(){"undefined"!=typeof customElements&&["ion-picker-column"].forEach((t=>{"ion-picker-column"===t&&(customElements.get(o(t))||customElements.define(o(t),m))}))}export{m as P,b as d}
|
|
@@ -813,6 +813,12 @@ const Datetime = class {
|
|
|
813
813
|
this.el.classList.add('datetime-ready');
|
|
814
814
|
});
|
|
815
815
|
};
|
|
816
|
+
this.loadTimeoutCleanup = () => {
|
|
817
|
+
if (this.loadTimeout) {
|
|
818
|
+
clearTimeout(this.loadTimeout);
|
|
819
|
+
this.loadTimeout = undefined;
|
|
820
|
+
}
|
|
821
|
+
};
|
|
816
822
|
this.processValue = (value) => {
|
|
817
823
|
const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
|
|
818
824
|
const valueToProcess = hasValue ? data.parseDate(value) : this.defaultParts;
|
|
@@ -1085,15 +1091,16 @@ const Datetime = class {
|
|
|
1085
1091
|
}
|
|
1086
1092
|
connectedCallback() {
|
|
1087
1093
|
this.clearFocusVisible = focusVisible.startFocusVisible(this.el).destroy;
|
|
1094
|
+
this.loadTimeout = setTimeout(() => {
|
|
1095
|
+
this.ensureReadyIfVisible();
|
|
1096
|
+
}, 100);
|
|
1088
1097
|
}
|
|
1089
1098
|
disconnectedCallback() {
|
|
1090
1099
|
if (this.clearFocusVisible) {
|
|
1091
1100
|
this.clearFocusVisible();
|
|
1092
1101
|
this.clearFocusVisible = undefined;
|
|
1093
1102
|
}
|
|
1094
|
-
|
|
1095
|
-
clearTimeout(this.loadTimeout);
|
|
1096
|
-
}
|
|
1103
|
+
this.loadTimeoutCleanup();
|
|
1097
1104
|
}
|
|
1098
1105
|
initializeListeners() {
|
|
1099
1106
|
this.initializeCalendarListener();
|
|
@@ -1141,7 +1148,10 @@ const Datetime = class {
|
|
|
1141
1148
|
* we still initialize listeners and mark the component as ready.
|
|
1142
1149
|
*
|
|
1143
1150
|
* We schedule this after everything has had a chance to run.
|
|
1151
|
+
*
|
|
1152
|
+
* We also clean up the load timeout to ensure that we don't have multiple timeouts running.
|
|
1144
1153
|
*/
|
|
1154
|
+
this.loadTimeoutCleanup();
|
|
1145
1155
|
this.loadTimeout = setTimeout(() => {
|
|
1146
1156
|
this.ensureReadyIfVisible();
|
|
1147
1157
|
}, 100);
|
|
@@ -1900,7 +1910,7 @@ const Datetime = class {
|
|
|
1900
1910
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1901
1911
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1902
1912
|
helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
|
|
1903
|
-
return (index.h(index.Host, { key: '
|
|
1913
|
+
return (index.h(index.Host, { key: '59e0811aa273e88dfb8e4b703e6824088a457380', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
|
|
1904
1914
|
[mode]: true,
|
|
1905
1915
|
['datetime-readonly']: readonly,
|
|
1906
1916
|
['datetime-disabled']: disabled,
|
|
@@ -1910,7 +1920,7 @@ const Datetime = class {
|
|
|
1910
1920
|
[`datetime-size-${size}`]: true,
|
|
1911
1921
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1912
1922
|
[`datetime-grid`]: isGridStyle,
|
|
1913
|
-
})) }, index.h("div", { key: '
|
|
1923
|
+
})) }, index.h("div", { key: '3753ff3dde3085070916c3de83687a219a49e553', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1914
1924
|
}
|
|
1915
1925
|
get el() { return index.getElement(this); }
|
|
1916
1926
|
static get watchers() { return {
|
|
@@ -450,7 +450,7 @@ const PickerColumn = class {
|
|
|
450
450
|
* Because this initial call to scrollActiveItemIntoView has to fire before
|
|
451
451
|
* the scroll listener is set up, we need to manage the active class manually.
|
|
452
452
|
*/
|
|
453
|
-
const oldActive =
|
|
453
|
+
const oldActive = el.querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
|
|
454
454
|
if (oldActive) {
|
|
455
455
|
this.setPickerItemActiveState(oldActive, false);
|
|
456
456
|
}
|
|
@@ -550,14 +550,14 @@ const PickerColumn = class {
|
|
|
550
550
|
render() {
|
|
551
551
|
const { color, disabled, isActive, numericInput } = this;
|
|
552
552
|
const mode = ionicGlobal.getIonMode(this);
|
|
553
|
-
return (index.h(index.Host, { key: '
|
|
553
|
+
return (index.h(index.Host, { key: '234c96a501d7ac413b9b0ea56b33017681e25b40', class: theme.createColorClasses(color, {
|
|
554
554
|
[mode]: true,
|
|
555
555
|
['picker-column-active']: isActive,
|
|
556
556
|
['picker-column-numeric-input']: numericInput,
|
|
557
557
|
['picker-column-disabled']: disabled,
|
|
558
|
-
}) }, index.h("slot", { key: '
|
|
558
|
+
}) }, index.h("slot", { key: '9dc15ea0601ddd2cb2e0a745e91e036a8bd96f8b', name: "prefix" }), index.h("div", { key: 'de4fe28ee4bc46b7c0420d6ab0df0e7809443da9', class: "picker-opts", ref: (el) => {
|
|
559
559
|
this.scrollEl = el;
|
|
560
|
-
}, role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": this.getOptionValueText(this.activeItem), "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }, index.h("div", { key: '
|
|
560
|
+
}, role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": this.getOptionValueText(this.activeItem), "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }, index.h("div", { key: '5297617462cc30e9444039ae032d8bdf718349af', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '55ea39ef867bcb1a11a912d52ecd20cb886c5fb3', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '3496730ce6182ebfd33e0ee4bafc130feb575a31', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("slot", { key: '44c3628aa957d60f799dc7019f72fe8b676c7843' }), index.h("div", { key: '5a1809f6c949678a67e0d4b5bfe93ea335c0161d', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '98fd57f1c66dbaebc2db2dd5da142671b3159fd1', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '85590708abddfa885994e549deac64866fec938f', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), index.h("slot", { key: 'bb7e674f543696a80fcbfb1f68f2e975826898a6', name: "suffix" })));
|
|
561
561
|
}
|
|
562
562
|
get el() { return index.getElement(this); }
|
|
563
563
|
static get watchers() { return {
|
|
@@ -622,6 +622,12 @@ export class Datetime {
|
|
|
622
622
|
this.el.classList.add('datetime-ready');
|
|
623
623
|
});
|
|
624
624
|
};
|
|
625
|
+
this.loadTimeoutCleanup = () => {
|
|
626
|
+
if (this.loadTimeout) {
|
|
627
|
+
clearTimeout(this.loadTimeout);
|
|
628
|
+
this.loadTimeout = undefined;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
625
631
|
this.processValue = (value) => {
|
|
626
632
|
const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
|
|
627
633
|
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
|
|
@@ -894,15 +900,16 @@ export class Datetime {
|
|
|
894
900
|
}
|
|
895
901
|
connectedCallback() {
|
|
896
902
|
this.clearFocusVisible = startFocusVisible(this.el).destroy;
|
|
903
|
+
this.loadTimeout = setTimeout(() => {
|
|
904
|
+
this.ensureReadyIfVisible();
|
|
905
|
+
}, 100);
|
|
897
906
|
}
|
|
898
907
|
disconnectedCallback() {
|
|
899
908
|
if (this.clearFocusVisible) {
|
|
900
909
|
this.clearFocusVisible();
|
|
901
910
|
this.clearFocusVisible = undefined;
|
|
902
911
|
}
|
|
903
|
-
|
|
904
|
-
clearTimeout(this.loadTimeout);
|
|
905
|
-
}
|
|
912
|
+
this.loadTimeoutCleanup();
|
|
906
913
|
}
|
|
907
914
|
initializeListeners() {
|
|
908
915
|
this.initializeCalendarListener();
|
|
@@ -950,7 +957,10 @@ export class Datetime {
|
|
|
950
957
|
* we still initialize listeners and mark the component as ready.
|
|
951
958
|
*
|
|
952
959
|
* We schedule this after everything has had a chance to run.
|
|
960
|
+
*
|
|
961
|
+
* We also clean up the load timeout to ensure that we don't have multiple timeouts running.
|
|
953
962
|
*/
|
|
963
|
+
this.loadTimeoutCleanup();
|
|
954
964
|
this.loadTimeout = setTimeout(() => {
|
|
955
965
|
this.ensureReadyIfVisible();
|
|
956
966
|
}, 100);
|
|
@@ -1709,7 +1719,7 @@ export class Datetime {
|
|
|
1709
1719
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1710
1720
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1711
1721
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1712
|
-
return (h(Host, { key: '
|
|
1722
|
+
return (h(Host, { key: '59e0811aa273e88dfb8e4b703e6824088a457380', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1713
1723
|
[mode]: true,
|
|
1714
1724
|
['datetime-readonly']: readonly,
|
|
1715
1725
|
['datetime-disabled']: disabled,
|
|
@@ -1719,7 +1729,7 @@ export class Datetime {
|
|
|
1719
1729
|
[`datetime-size-${size}`]: true,
|
|
1720
1730
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1721
1731
|
[`datetime-grid`]: isGridStyle,
|
|
1722
|
-
})) }, h("div", { key: '
|
|
1732
|
+
})) }, h("div", { key: '3753ff3dde3085070916c3de83687a219a49e553', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1723
1733
|
}
|
|
1724
1734
|
static get is() { return "ion-datetime"; }
|
|
1725
1735
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h } from "@stencil/core";
|
|
5
5
|
import { doc } from "../../utils/browser/index";
|
|
6
|
-
import {
|
|
6
|
+
import { raf } from "../../utils/helpers";
|
|
7
7
|
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from "../../utils/native/haptic";
|
|
8
8
|
import { isPlatform } from "../../utils/platform";
|
|
9
9
|
import { createColorClasses } from "../../utils/theme";
|
|
@@ -451,7 +451,7 @@ export class PickerColumn {
|
|
|
451
451
|
* Because this initial call to scrollActiveItemIntoView has to fire before
|
|
452
452
|
* the scroll listener is set up, we need to manage the active class manually.
|
|
453
453
|
*/
|
|
454
|
-
const oldActive =
|
|
454
|
+
const oldActive = el.querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
|
|
455
455
|
if (oldActive) {
|
|
456
456
|
this.setPickerItemActiveState(oldActive, false);
|
|
457
457
|
}
|
|
@@ -551,14 +551,14 @@ export class PickerColumn {
|
|
|
551
551
|
render() {
|
|
552
552
|
const { color, disabled, isActive, numericInput } = this;
|
|
553
553
|
const mode = getIonMode(this);
|
|
554
|
-
return (h(Host, { key: '
|
|
554
|
+
return (h(Host, { key: '234c96a501d7ac413b9b0ea56b33017681e25b40', class: createColorClasses(color, {
|
|
555
555
|
[mode]: true,
|
|
556
556
|
['picker-column-active']: isActive,
|
|
557
557
|
['picker-column-numeric-input']: numericInput,
|
|
558
558
|
['picker-column-disabled']: disabled,
|
|
559
|
-
}) }, h("slot", { key: '
|
|
559
|
+
}) }, h("slot", { key: '9dc15ea0601ddd2cb2e0a745e91e036a8bd96f8b', name: "prefix" }), h("div", { key: 'de4fe28ee4bc46b7c0420d6ab0df0e7809443da9', class: "picker-opts", ref: (el) => {
|
|
560
560
|
this.scrollEl = el;
|
|
561
|
-
}, role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": this.getOptionValueText(this.activeItem), "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }, h("div", { key: '
|
|
561
|
+
}, role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": this.getOptionValueText(this.activeItem), "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }, h("div", { key: '5297617462cc30e9444039ae032d8bdf718349af', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '55ea39ef867bcb1a11a912d52ecd20cb886c5fb3', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '3496730ce6182ebfd33e0ee4bafc130feb575a31', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("slot", { key: '44c3628aa957d60f799dc7019f72fe8b676c7843' }), h("div", { key: '5a1809f6c949678a67e0d4b5bfe93ea335c0161d', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '98fd57f1c66dbaebc2db2dd5da142671b3159fd1', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '85590708abddfa885994e549deac64866fec938f', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), h("slot", { key: 'bb7e674f543696a80fcbfb1f68f2e975826898a6', name: "suffix" })));
|
|
562
562
|
}
|
|
563
563
|
static get is() { return "ion-picker-column"; }
|
|
564
564
|
static get encapsulation() { return "shadow"; }
|
package/dist/docs.json
CHANGED
|
@@ -811,6 +811,12 @@ const Datetime = class {
|
|
|
811
811
|
this.el.classList.add('datetime-ready');
|
|
812
812
|
});
|
|
813
813
|
};
|
|
814
|
+
this.loadTimeoutCleanup = () => {
|
|
815
|
+
if (this.loadTimeout) {
|
|
816
|
+
clearTimeout(this.loadTimeout);
|
|
817
|
+
this.loadTimeout = undefined;
|
|
818
|
+
}
|
|
819
|
+
};
|
|
814
820
|
this.processValue = (value) => {
|
|
815
821
|
const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
|
|
816
822
|
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
|
|
@@ -1083,15 +1089,16 @@ const Datetime = class {
|
|
|
1083
1089
|
}
|
|
1084
1090
|
connectedCallback() {
|
|
1085
1091
|
this.clearFocusVisible = startFocusVisible(this.el).destroy;
|
|
1092
|
+
this.loadTimeout = setTimeout(() => {
|
|
1093
|
+
this.ensureReadyIfVisible();
|
|
1094
|
+
}, 100);
|
|
1086
1095
|
}
|
|
1087
1096
|
disconnectedCallback() {
|
|
1088
1097
|
if (this.clearFocusVisible) {
|
|
1089
1098
|
this.clearFocusVisible();
|
|
1090
1099
|
this.clearFocusVisible = undefined;
|
|
1091
1100
|
}
|
|
1092
|
-
|
|
1093
|
-
clearTimeout(this.loadTimeout);
|
|
1094
|
-
}
|
|
1101
|
+
this.loadTimeoutCleanup();
|
|
1095
1102
|
}
|
|
1096
1103
|
initializeListeners() {
|
|
1097
1104
|
this.initializeCalendarListener();
|
|
@@ -1139,7 +1146,10 @@ const Datetime = class {
|
|
|
1139
1146
|
* we still initialize listeners and mark the component as ready.
|
|
1140
1147
|
*
|
|
1141
1148
|
* We schedule this after everything has had a chance to run.
|
|
1149
|
+
*
|
|
1150
|
+
* We also clean up the load timeout to ensure that we don't have multiple timeouts running.
|
|
1142
1151
|
*/
|
|
1152
|
+
this.loadTimeoutCleanup();
|
|
1143
1153
|
this.loadTimeout = setTimeout(() => {
|
|
1144
1154
|
this.ensureReadyIfVisible();
|
|
1145
1155
|
}, 100);
|
|
@@ -1898,7 +1908,7 @@ const Datetime = class {
|
|
|
1898
1908
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1899
1909
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1900
1910
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1901
|
-
return (h(Host, { key: '
|
|
1911
|
+
return (h(Host, { key: '59e0811aa273e88dfb8e4b703e6824088a457380', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1902
1912
|
[mode]: true,
|
|
1903
1913
|
['datetime-readonly']: readonly,
|
|
1904
1914
|
['datetime-disabled']: disabled,
|
|
@@ -1908,7 +1918,7 @@ const Datetime = class {
|
|
|
1908
1918
|
[`datetime-size-${size}`]: true,
|
|
1909
1919
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1910
1920
|
[`datetime-grid`]: isGridStyle,
|
|
1911
|
-
})) }, h("div", { key: '
|
|
1921
|
+
})) }, h("div", { key: '3753ff3dde3085070916c3de83687a219a49e553', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1912
1922
|
}
|
|
1913
1923
|
get el() { return getElement(this); }
|
|
1914
1924
|
static get watchers() { return {
|