@tabworthy/components 0.16.0 → 1.0.0

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.
Files changed (26) hide show
  1. package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +11 -6
  2. package/dist/cjs/tabworthy-dates.cjs.entry.js +2 -2
  3. package/dist/cjs/tabworthy-times.cjs.entry.js +5 -5
  4. package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +2 -2
  5. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +16 -7
  6. package/dist/collection/components/tabworthy-times/tabworthy-times.js +5 -5
  7. package/dist/components/{p-DXCumu2Y.js → p-Denq9zJN.js} +1 -1
  8. package/dist/components/tabworthy-dates-modal.js +1 -1
  9. package/dist/components/tabworthy-dates.js +1 -1
  10. package/dist/components/tabworthy-times.js +1 -1
  11. package/dist/esm/tabworthy-dates-calendar_2.entry.js +11 -6
  12. package/dist/esm/tabworthy-dates.entry.js +2 -2
  13. package/dist/esm/tabworthy-times.entry.js +5 -5
  14. package/dist/tabworthy-components/p-6749b25f.entry.js +1 -0
  15. package/dist/tabworthy-components/{p-82d70f28.entry.js → p-8c2b9340.entry.js} +1 -1
  16. package/dist/tabworthy-components/{p-66c929f1.entry.js → p-98ba1248.entry.js} +1 -1
  17. package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
  18. package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +1 -0
  19. package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +2 -1
  20. package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +1 -0
  21. package/dist/types/components.d.ts +1 -1
  22. package/package.json +3 -2
  23. package/dist/tabworthy-components/p-c57563a0.entry.js +0 -1
  24. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.d.ts +0 -3
  25. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.type.d.ts +0 -40
  26. package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/utils.d.ts +0 -34
@@ -1 +1 @@
1
- import{p as t,H as s,c as i,h as e,d as h,t as a}from"./p-BiJ0HZVY.js";import{g as n,d as o,c as r,f as d}from"./p-DCgn1Avj.js";import{g as l,r as c,c as u}from"./p-C_Pq_S0e.js";import{d as m}from"./p-DXCumu2Y.js";import{d as f}from"./p-BvcvP308.js";var b,p={exports:{}},y=n(b?p.exports:(b=1,p.exports=function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(s,i,e){var h=i.prototype,a=h.format;e.en.formats=t,h.format=function(s){void 0===s&&(s="YYYY-MM-DDTHH:mm:ssZ");var i=this.$locale().formats,e=function(s,i){return s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(s,e,h){var a=h&&h.toUpperCase();return e||i[h]||t[h]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,s,i){return s||i.slice(1)}))}))}(s,void 0===i?{}:i);return a.call(this,e)}}}()));o.extend(r),o.extend(y);const v={selected:"selected",openCalendar:"Choose time",calendar:"date and time picker",invalidDateError:"We could not find a matching date",minDateError:"Please fill in a date after ",maxDateError:"Please fill in a date before ",rangeOutOfBoundsError:"Please enter a valid range of dates",disabledDateError:"Please choose an available date",to:"to",startDate:"Start date",timeLabel:"Time"},w=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectDateTime=i(this,"selectDateTime",7),this.changeYear=i(this,"changeYear",7),this.errorChange=i(this,"errorChange",7),this.componentReady=i(this,"componentReady",7),this.range=!1,this.timeOnly=!1,this.label="Choose a date and time",this.placeholder="",this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.disabled=!1,this.startDate=l(new Date),this.referenceDate=l(new Date),this.useTwelveHourFormat=!0,this.showSeconds=!1,this.timesLabels=v,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showCloseButton=!1,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.disableFreeformInput=!1,this.inputClass="",this.selectedHours=(new Date).getHours(),this.selectedMinutes=(new Date).getMinutes(),this.selectedSeconds=(new Date).getSeconds(),this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{if(!t)return this.clearValue();const s=t.split(",");if(this.range&&2===s.length){const t=c(new Date(s[0])),i=c(new Date(s[1]));if(!this.isDateValid(t)||!this.isDateValid(i))return;this.updateValue([t,i]),this.pickerRef&&(this.pickerRef.value=[t,i])}else{const t=c(new Date(s[0]));if(!this.isDateValid(t))return;this.clampTimeToBounds(t),this.updateValue(t),this.pickerRef&&(this.pickerRef.value=void 0,this.pickerRef.value=t)}},this.handleTimeChange=t=>{this.selectedHours=t.detail.hours,this.selectedMinutes=t.detail.minutes,void 0!==t.detail.seconds&&(this.selectedSeconds=t.detail.seconds),this.selectedDate?this.updateValue(this.selectedDate):this.timeOnly&&this.updateValue(this.getDateForTimeOnlyValue())},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.inputContainerRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const s=t.target.value;if(0===s.length)return this.errorState=!1,this.internalValue="",this.pickerRef&&(this.pickerRef.value=null),this.value=this.internalValue,this.selectDateTime.emit(this.internalValue);let i=o(s,this.format,!0);if(i.isValid()||(i=o(s)),i.isValid()){if(this.minDate&&i.isBefore(o(this.minDate)))return this.errorState=!0,this.errorMessage=d(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),void this.emitErrorChange("minDate",this.errorMessage);if(this.maxDate&&i.isAfter(o(this.maxDate)))return this.errorState=!0,this.errorMessage=d(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),void this.emitErrorChange("maxDate",this.errorMessage);if(this.disableDate(i.toDate()))return this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,void this.emitErrorChange("disabledDate",this.errorMessage);this.errorState=!1,this.selectedHours=i.hour(),this.selectedMinutes=i.minute(),this.selectedSeconds=i.second(),this.updateValue(i.toDate())}else this.errorState=!0,this.errorMessage=this.timesLabels.invalidDateError,this.emitErrorChange("invalid",this.errorMessage)}}emitErrorChange(t,s){this.errorChange.emit({reason:t,message:s})}formatBoundaryDate(t){const s=o(t);if(!s.isValid())return t;if(!t.includes("T")&&!t.includes(" "))return Intl.DateTimeFormat(this.locale,{day:"numeric",month:"short",year:"numeric"}).format(s.toDate());const i=Object.assign({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"},this.showSeconds?{second:"numeric"}:{});return Intl.DateTimeFormat(this.locale,i).format(s.toDate())}getEffectiveMinTime(){if(!this.minDate||!this.selectedDate)return;const t=o(this.minDate),s=o(this.selectedDate);return t.isValid()&&s.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}getEffectiveMaxTime(){if(!this.maxDate||!this.selectedDate)return;const t=o(this.maxDate),s=o(this.selectedDate);return t.isValid()&&s.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}isDateOutOfBounds(){if(!this.selectedDate)return!1;const t=o(this.selectedDate);return!(!this.minDate||!t.isBefore(o(this.minDate),"day"))||!(!this.maxDate||!t.isAfter(o(this.maxDate),"day"))}clampTimeToBounds(t){const s=o(t);if(this.minDate){const t=o(this.minDate);t.isValid()&&s.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds<3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}if(this.maxDate){const t=o(this.maxDate);t.isValid()&&s.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds>3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}getDateForTimeOnlyValue(){if(this.selectedDate)return this.selectedDate;const t=o(this.referenceDate);return t.isValid()?t.toDate():new Date}watchValue(t){this.syncFromValueProp()}watchDisabled(t){this.disabledState=t}watchHasError(t){this.errorState=t}componentDidLoad(){this.syncFromValueProp(),this.componentReady.emit(),this.id||console.error('tabworthy-times: The "id" prop is required for accessibility')}syncFromValueProp(){if(this.internalValue=this.value||null,this.value){const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const s=o(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hour(),this.selectedMinutes=s.minute(),this.selectedSeconds=s.second())}}else this.selectedDate=void 0;if(this.pickerRef)if(Array.isArray(this.value)){const t=this.value.reduce(((t,s)=>{const i=o(s,this.format,!0);return i.isValid()&&t.push(i.toDate()),t}),[]);this.pickerRef.value=t.length?t:null}else if(this.value){const t=o(this.value,this.format,!0);t.isValid()&&(this.pickerRef.value=t.toDate())}else this.pickerRef.value=null;this.inputRef&&(this.value?this.shouldInputFormat()?this.formatInput():this.inputRef.value=""+this.internalValue:this.inputRef.value="")}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>o(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format)));this.internalValue=s,this.value=s,this.selectDateTime.emit(s)}else{const s=o(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format);this.internalValue=s,this.value=s,this.selectedDate=t,this.selectDateTime.emit(s)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}isDateValid(t){const s=o(t);return!(!s.isValid()||(this.minDate&&s.isBefore(o(this.minDate),"day")?(this.errorState=!0,this.errorMessage=d(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),this.emitErrorChange("minDate",this.errorMessage),1):this.maxDate&&s.isAfter(o(this.maxDate),"day")?(this.errorState=!0,this.errorMessage=d(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),this.emitErrorChange("maxDate",this.errorMessage),1):this.disableDate(t)&&(this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,this.emitErrorChange("disabledDate",this.errorMessage),1)))}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>o(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=this.timeOnly?o(this.internalValue,this.format).format(this.showSeconds?"LTS":"LT"):o(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>o(t,this.format).toDate())):o(t,this.format).toDate():null}async revertInput(t,s=!1){s&&(this.errorState=!1),this.value=t,this.syncFromValueProp()}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef&&(this.inputRef.value=""),this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return e(h,{key:"40aebf1f077c4766cbbb9bd3929f5d8d959b60a4",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState,"time-only":this.timeOnly},e("label",{key:"cbf04161329d320ebc9ae5b3a0fede08e3157afb",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),e("div",{key:"2e7e46172b8d46b2f88047d93f9e4d35e5c841f3",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},e("input",{key:"0fcf906d8bad7fe78e003bf881a6d22dcb42f4e8",id:this.id+"-input",ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:""+t,onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?this.id+"-error":void 0,"aria-invalid":this.errorState}),!this.inline&&e("button",{key:"7d63c31494474844633f64faf0aba4851574dce6",type:"button",onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState,"aria-label":this.calendarButtonContent?this.timesLabels.openCalendar:void 0},this.calendarButtonContent?e("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),e("tabworthy-dates-modal",{key:"802a7f839dd33d19885918819ae4a3fa9f6cb838",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0),this.timeOnly&&this.timePickerRef&&(this.timePickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1),this.timePickerRef&&(this.timePickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},e("div",{key:"2ff172c30561b5962400dc2fa052162e01013c7a",class:this.getClassName("picker-container")},!this.timeOnly&&e("tabworthy-dates-calendar",{key:"6456181b374cae4d91c01b9b7873c91bb08a8778",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),onRequestClose:()=>{var t;return null===(t=this.modalRef)||void 0===t?void 0:t.close()},labels:this.datesCalendarLabels,ref:t=>this.pickerRef=t,startDate:this.startDate,firstDayOfWeek:this.firstDayOfWeek,showHiddenTitle:!0,disabled:this.disabledState,showMonthStepper:this.showMonthStepper,showYearStepper:this.showYearStepper,showClearButton:this.showClearButton,showCloseButton:this.showCloseButton,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline,value:this.value?this.toDate(this.value):void 0,nextMonthButtonContent:this.nextMonthButtonContent,nextYearButtonContent:this.nextYearButtonContent,previousMonthButtonContent:this.previousMonthButtonContent,previousYearButtonContent:this.previousYearButtonContent,todayButtonContent:this.todayButtonContent,clearButtonContent:this.clearButtonContent,closeButtonContent:this.closeButtonContent},e("div",{key:"4a89d517cfcf22cffccecddca841102cb913a8fb",slot:"after-calendar",class:this.getClassName("time-section")},e("hr",{key:"72d37f7058959877afa16b8336f834cc0e5aceba",class:this.getClassName("divider")}),e("tabworthy-times-picker",{key:"bdba34da5c2a2a0af681e40516b0d48e8833e276",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t}))),this.timeOnly&&e("div",{key:"50a2866b8e7a408f72d37ee540ecba546103d4f4",class:this.getClassName("time-section")},e("tabworthy-times-picker",{key:"de317aaa6579be60679cba468e5b28be8654aa5d",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t})))),this.errorState&&e("div",{key:"7617cfa25799dbbb8056abcba161284745022f44",class:this.getClassName("input-error"),id:this.id?this.id+"-error":void 0,role:"status"},this.errorMessage))}get el(){return this}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}},[2,"tabworthy-times",{id:[513],value:[1025],range:[4],timeOnly:[4,"time-only"],label:[1],placeholder:[1],locale:[1],disabled:[4],minDate:[1,"min-date"],maxDate:[1,"max-date"],startDate:[1,"start-date"],referenceDate:[1,"reference-date"],useTwelveHourFormat:[4,"use-twelve-hour-format"],showSeconds:[4,"show-seconds"],timesLabels:[16],datesCalendarLabels:[16],timesPickerLabels:[16],inline:[4],hasError:[1028,"has-error"],showYearStepper:[4,"show-year-stepper"],showMonthStepper:[4,"show-month-stepper"],showClearButton:[4,"show-clear-button"],showCloseButton:[4,"show-close-button"],showTodayButton:[4,"show-today-button"],calendarButtonContent:[1,"calendar-button-content"],nextMonthButtonContent:[1,"next-month-button-content"],nextYearButtonContent:[1,"next-year-button-content"],previousMonthButtonContent:[1,"previous-month-button-content"],previousYearButtonContent:[1,"previous-year-button-content"],todayButtonContent:[1,"today-button-content"],clearButtonContent:[1,"clear-button-content"],closeButtonContent:[1,"close-button-content"],disableDate:[16],elementClassName:[1,"element-class-name"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],inputShouldFormat:[8,"input-should-format"],disableFreeformInput:[4,"disable-freeform-input"],inputClass:[1,"input-class"],appendTo:[1,"append-to"],internalValue:[32],selectedDate:[32],selectedHours:[32],selectedMinutes:[32],selectedSeconds:[32],errorState:[32],disabledState:[32],revertInput:[64],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),D=w,C=function(){"undefined"!=typeof customElements&&["tabworthy-times","tabworthy-dates-calendar","tabworthy-dates-modal","tabworthy-times-picker"].forEach((t=>{switch(t){case"tabworthy-times":customElements.get(a(t))||customElements.define(a(t),w);break;case"tabworthy-dates-calendar":customElements.get(a(t))||u();break;case"tabworthy-dates-modal":customElements.get(a(t))||m();break;case"tabworthy-times-picker":customElements.get(a(t))||f()}}))};export{D as TabworthyTimes,C as defineCustomElement}
1
+ import{p as t,H as s,c as i,h as e,d as h,t as a}from"./p-BiJ0HZVY.js";import{g as n,d as o,c as r,f as d}from"./p-DCgn1Avj.js";import{g as l,r as c,c as u}from"./p-C_Pq_S0e.js";import{d as m}from"./p-Denq9zJN.js";import{d as f}from"./p-BvcvP308.js";var b,p={exports:{}},y=n(b?p.exports:(b=1,p.exports=function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(s,i,e){var h=i.prototype,a=h.format;e.en.formats=t,h.format=function(s){void 0===s&&(s="YYYY-MM-DDTHH:mm:ssZ");var i=this.$locale().formats,e=function(s,i){return s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(s,e,h){var a=h&&h.toUpperCase();return e||i[h]||t[h]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,s,i){return s||i.slice(1)}))}))}(s,void 0===i?{}:i);return a.call(this,e)}}}()));o.extend(r),o.extend(y);const v={selected:"selected",openCalendar:"Choose time",calendar:"date and time picker",invalidDateError:"We could not find a matching date",minDateError:"Please fill in a date after ",maxDateError:"Please fill in a date before ",rangeOutOfBoundsError:"Please enter a valid range of dates",disabledDateError:"Please choose an available date",to:"to",startDate:"Start date",timeLabel:"Time"},w=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectDateTime=i(this,"selectDateTime",7),this.changeYear=i(this,"changeYear",7),this.errorChange=i(this,"errorChange",7),this.componentReady=i(this,"componentReady",7),this.range=!1,this.timeOnly=!1,this.label="Choose a date and time",this.placeholder="",this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.disabled=!1,this.startDate=l(new Date),this.referenceDate=l(new Date),this.useTwelveHourFormat=!0,this.showSeconds=!1,this.timesLabels=v,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showCloseButton=!1,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.disableFreeformInput=!1,this.inputClass="",this.selectedHours=(new Date).getHours(),this.selectedMinutes=(new Date).getMinutes(),this.selectedSeconds=(new Date).getSeconds(),this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{if(!t)return this.clearValue();const s=t.split(",");if(this.range&&2===s.length){const t=c(new Date(s[0])),i=c(new Date(s[1]));if(!this.isDateValid(t)||!this.isDateValid(i))return;this.updateValue([t,i]),this.pickerRef&&(this.pickerRef.value=[t,i])}else{const t=c(new Date(s[0]));if(!this.isDateValid(t))return;this.clampTimeToBounds(t),this.updateValue(t),this.pickerRef&&(this.pickerRef.value=void 0,this.pickerRef.value=t)}},this.handleTimeChange=t=>{this.selectedHours=t.detail.hours,this.selectedMinutes=t.detail.minutes,void 0!==t.detail.seconds&&(this.selectedSeconds=t.detail.seconds),this.selectedDate?this.updateValue(this.selectedDate):this.timeOnly&&this.updateValue(this.getDateForTimeOnlyValue())},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.inputContainerRef,this.calendarButtonRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const s=t.target.value;if(0===s.length)return this.errorState=!1,this.internalValue="",this.pickerRef&&(this.pickerRef.value=null),this.value=this.internalValue,this.selectDateTime.emit(this.internalValue);let i=o(s,this.format,!0);if(i.isValid()||(i=o(s)),i.isValid()){if(this.minDate&&i.isBefore(o(this.minDate)))return this.errorState=!0,this.errorMessage=d(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),void this.emitErrorChange("minDate",this.errorMessage);if(this.maxDate&&i.isAfter(o(this.maxDate)))return this.errorState=!0,this.errorMessage=d(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),void this.emitErrorChange("maxDate",this.errorMessage);if(this.disableDate(i.toDate()))return this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,void this.emitErrorChange("disabledDate",this.errorMessage);this.errorState=!1,this.selectedHours=i.hour(),this.selectedMinutes=i.minute(),this.selectedSeconds=i.second(),this.updateValue(i.toDate())}else this.errorState=!0,this.errorMessage=this.timesLabels.invalidDateError,this.emitErrorChange("invalid",this.errorMessage)}}emitErrorChange(t,s){this.errorChange.emit({reason:t,message:s})}formatBoundaryDate(t){const s=o(t);if(!s.isValid())return t;if(!t.includes("T")&&!t.includes(" "))return Intl.DateTimeFormat(this.locale,{day:"numeric",month:"short",year:"numeric"}).format(s.toDate());const i=Object.assign({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"},this.showSeconds?{second:"numeric"}:{});return Intl.DateTimeFormat(this.locale,i).format(s.toDate())}getEffectiveMinTime(){if(!this.minDate||!this.selectedDate)return;const t=o(this.minDate),s=o(this.selectedDate);return t.isValid()&&s.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}getEffectiveMaxTime(){if(!this.maxDate||!this.selectedDate)return;const t=o(this.maxDate),s=o(this.selectedDate);return t.isValid()&&s.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}isDateOutOfBounds(){if(!this.selectedDate)return!1;const t=o(this.selectedDate);return!(!this.minDate||!t.isBefore(o(this.minDate),"day"))||!(!this.maxDate||!t.isAfter(o(this.maxDate),"day"))}clampTimeToBounds(t){const s=o(t);if(this.minDate){const t=o(this.minDate);t.isValid()&&s.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds<3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}if(this.maxDate){const t=o(this.maxDate);t.isValid()&&s.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds>3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}getDateForTimeOnlyValue(){if(this.selectedDate)return this.selectedDate;const t=o(this.referenceDate);return t.isValid()?t.toDate():new Date}watchValue(t){this.syncFromValueProp()}watchDisabled(t){this.disabledState=t}watchHasError(t){this.errorState=t}componentDidLoad(){this.syncFromValueProp(),this.componentReady.emit(),this.id||console.error('tabworthy-times: The "id" prop is required for accessibility')}syncFromValueProp(){if(this.internalValue=this.value||null,this.value){const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const s=o(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hour(),this.selectedMinutes=s.minute(),this.selectedSeconds=s.second())}}else this.selectedDate=void 0;if(this.pickerRef)if(Array.isArray(this.value)){const t=this.value.reduce(((t,s)=>{const i=o(s,this.format,!0);return i.isValid()&&t.push(i.toDate()),t}),[]);this.pickerRef.value=t.length?t:null}else if(this.value){const t=o(this.value,this.format,!0);t.isValid()&&(this.pickerRef.value=t.toDate())}else this.pickerRef.value=null;this.inputRef&&(this.value?this.shouldInputFormat()?this.formatInput():this.inputRef.value=""+this.internalValue:this.inputRef.value="")}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>o(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format)));this.internalValue=s,this.value=s,this.selectDateTime.emit(s)}else{const s=o(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format);this.internalValue=s,this.value=s,this.selectedDate=t,this.selectDateTime.emit(s)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}isDateValid(t){const s=o(t);return!(!s.isValid()||(this.minDate&&s.isBefore(o(this.minDate),"day")?(this.errorState=!0,this.errorMessage=d(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),this.emitErrorChange("minDate",this.errorMessage),1):this.maxDate&&s.isAfter(o(this.maxDate),"day")?(this.errorState=!0,this.errorMessage=d(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),this.emitErrorChange("maxDate",this.errorMessage),1):this.disableDate(t)&&(this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,this.emitErrorChange("disabledDate",this.errorMessage),1)))}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>o(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=this.timeOnly?o(this.internalValue,this.format).format(this.showSeconds?"LTS":"LT"):o(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>o(t,this.format).toDate())):o(t,this.format).toDate():null}async revertInput(t,s=!1){s&&(this.errorState=!1),this.value=t,this.syncFromValueProp()}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef&&(this.inputRef.value=""),this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return e(h,{key:"eb40f4186e17019d6c0e7f59cd6c34ee65550fd8",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState,"time-only":this.timeOnly},e("label",{key:"6d1f0deae328d66331350247da217c428910ddfb",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),e("div",{key:"d7721562f0eeb5be4f6b68ff8e1c01c4ed08fe1b",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},e("input",{key:"1e4b4bd45f63aa5357505f58edde39739a51a124",id:this.id+"-input",ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:""+t,onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?this.id+"-error":void 0,"aria-invalid":this.errorState}),!this.inline&&e("button",{key:"c5789e7d45619291c38895ba184c6ec74d73c584",type:"button",ref:t=>this.calendarButtonRef=t,onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState,"aria-label":this.calendarButtonContent?this.timesLabels.openCalendar:void 0},this.calendarButtonContent?e("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),e("tabworthy-dates-modal",{key:"af58b555642816b299cf50394148ed17c427db21",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0),this.timeOnly&&this.timePickerRef&&(this.timePickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1),this.timePickerRef&&(this.timePickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},e("div",{key:"1bc48335f50777efd746a2737ac6acc60a72dec3",class:this.getClassName("picker-container")},!this.timeOnly&&e("tabworthy-dates-calendar",{key:"d0bdb6e18676f0019be5fd939a19075927b10fa4",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),onRequestClose:()=>{var t;return null===(t=this.modalRef)||void 0===t?void 0:t.close()},labels:this.datesCalendarLabels,ref:t=>this.pickerRef=t,startDate:this.startDate,firstDayOfWeek:this.firstDayOfWeek,showHiddenTitle:!0,disabled:this.disabledState,showMonthStepper:this.showMonthStepper,showYearStepper:this.showYearStepper,showClearButton:this.showClearButton,showCloseButton:this.showCloseButton,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline,value:this.value?this.toDate(this.value):void 0,nextMonthButtonContent:this.nextMonthButtonContent,nextYearButtonContent:this.nextYearButtonContent,previousMonthButtonContent:this.previousMonthButtonContent,previousYearButtonContent:this.previousYearButtonContent,todayButtonContent:this.todayButtonContent,clearButtonContent:this.clearButtonContent,closeButtonContent:this.closeButtonContent},e("div",{key:"042f5fa7e60b67858ea7f92ca80792953b38d0a1",slot:"after-calendar",class:this.getClassName("time-section")},e("hr",{key:"7262873201e1294e6116fea1f429c71e37bf06c2",class:this.getClassName("divider")}),e("tabworthy-times-picker",{key:"46a179fd9ce95d53e144d0b03a77311e4daa3c10",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t}))),this.timeOnly&&e("div",{key:"eaedaf5a7157dbdc99a947b6eb3e55f696556371",class:this.getClassName("time-section")},e("tabworthy-times-picker",{key:"504ea7e3069134e695d09ef48834b947de629b5e",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t})))),this.errorState&&e("div",{key:"961823a7550b5439d2768f80317422b057758de3",class:this.getClassName("input-error"),id:this.id?this.id+"-error":void 0,role:"status"},this.errorMessage))}get el(){return this}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}},[2,"tabworthy-times",{id:[513],value:[1025],range:[4],timeOnly:[4,"time-only"],label:[1],placeholder:[1],locale:[1],disabled:[4],minDate:[1,"min-date"],maxDate:[1,"max-date"],startDate:[1,"start-date"],referenceDate:[1,"reference-date"],useTwelveHourFormat:[4,"use-twelve-hour-format"],showSeconds:[4,"show-seconds"],timesLabels:[16],datesCalendarLabels:[16],timesPickerLabels:[16],inline:[4],hasError:[1028,"has-error"],showYearStepper:[4,"show-year-stepper"],showMonthStepper:[4,"show-month-stepper"],showClearButton:[4,"show-clear-button"],showCloseButton:[4,"show-close-button"],showTodayButton:[4,"show-today-button"],calendarButtonContent:[1,"calendar-button-content"],nextMonthButtonContent:[1,"next-month-button-content"],nextYearButtonContent:[1,"next-year-button-content"],previousMonthButtonContent:[1,"previous-month-button-content"],previousYearButtonContent:[1,"previous-year-button-content"],todayButtonContent:[1,"today-button-content"],clearButtonContent:[1,"clear-button-content"],closeButtonContent:[1,"close-button-content"],disableDate:[16],elementClassName:[1,"element-class-name"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],inputShouldFormat:[8,"input-should-format"],disableFreeformInput:[4,"disable-freeform-input"],inputClass:[1,"input-class"],appendTo:[1,"append-to"],internalValue:[32],selectedDate:[32],selectedHours:[32],selectedMinutes:[32],selectedSeconds:[32],errorState:[32],disabledState:[32],revertInput:[64],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),D=w,C=function(){"undefined"!=typeof customElements&&["tabworthy-times","tabworthy-dates-calendar","tabworthy-dates-modal","tabworthy-times-picker"].forEach((t=>{switch(t){case"tabworthy-times":customElements.get(a(t))||customElements.define(a(t),w);break;case"tabworthy-dates-calendar":customElements.get(a(t))||u();break;case"tabworthy-dates-modal":customElements.get(a(t))||m();break;case"tabworthy-times-picker":customElements.get(a(t))||f()}}))};export{D as TabworthyTimes,C as defineCustomElement}
@@ -2815,14 +2815,18 @@ const TabworthyDatesModal = class {
2815
2815
  * Close the dialog.
2816
2816
  */
2817
2817
  async close() {
2818
- var _a;
2818
+ var _a, _b;
2819
2819
  if (this.inline)
2820
2820
  return;
2821
+ const activeElement = document.activeElement;
2822
+ const focusMovedOutside = !!activeElement &&
2823
+ activeElement !== document.body &&
2824
+ !this.hostElement.contains(activeElement);
2821
2825
  this.showing = false;
2822
2826
  this.closed.emit(undefined);
2823
2827
  (_a = this.undo) === null || _a === void 0 ? void 0 : _a.call(this);
2824
- if (this.triggerElement)
2825
- this.triggerElement.focus();
2828
+ if (!focusMovedOutside)
2829
+ (_b = this.focusReturnElement) === null || _b === void 0 ? void 0 : _b.focus();
2826
2830
  }
2827
2831
  disconnectedCallback() {
2828
2832
  // Skip cleanup if we're in the middle of portal operations
@@ -2834,8 +2838,9 @@ const TabworthyDatesModal = class {
2834
2838
  async getState() {
2835
2839
  return this.showing;
2836
2840
  }
2837
- async setTriggerElement(element) {
2841
+ async setTriggerElement(element, focusElement = element) {
2838
2842
  this.triggerElement = element;
2843
+ this.focusReturnElement = focusElement;
2839
2844
  }
2840
2845
  /** Force update the popper position */
2841
2846
  async updatePosition() {
@@ -2857,7 +2862,7 @@ const TabworthyDatesModal = class {
2857
2862
  }
2858
2863
  }
2859
2864
  render() {
2860
- return (h(Host, { key: '2c9c3ade4eb4964dbb5ba86bd196240851dbb996', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (h("div", { key: '961c2d9e34d7ddadb512f8652f14ed4ed4ec6ce5', part: "body", ref: (r) => {
2865
+ return (h(Host, { key: '8f2128e3b9ed31547aaa4a1eb1f9fe1c2c554834', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (h("div", { key: 'd3c8a2b9d11bdd1147ded6256417c0bdda9274b5', part: "body", ref: (r) => {
2861
2866
  if (r) {
2862
2867
  this.bodyRef = r;
2863
2868
  // Setup portal and create popper when ref is set
@@ -2874,7 +2879,7 @@ const TabworthyDatesModal = class {
2874
2879
  });
2875
2880
  }
2876
2881
  }
2877
- }, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: '719a3e82aab59326d1aa069b237d158d2311cd62' }, h("div", { key: 'b33e1aabdb7477409d97f757bf7121697979d50c', part: "content" }, h("slot", { key: 'c7e85552f37b930e298484c0040c138fdccb8ea7' }))))), this.inline && (h("div", { key: '59e0333fb0e980c17e0a1da041e6bc492d025bd8', part: "content" }, h("slot", { key: 'd52759f124c038fbde4b510ae1df8c3a1bdad25e' })))));
2882
+ }, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: '3c36e0e81b87ef9364ff8288e200c4462626bfea' }, h("div", { key: '111ba3d8fea2f0f4afdb63506fa43d1b8467c14d', part: "content" }, h("slot", { key: '6ec34c827f3c4cf1a5f30d9e571826f73cc66157' }))))), this.inline && (h("div", { key: '49970743a4f726fd02b18ba485ba0753acc4d0ec', part: "content" }, h("slot", { key: '6d0e2cd6bdc51f63fbab138c93f9c99cc3b1291d' })))));
2878
2883
  }
2879
2884
  get hostElement() { return getElement(this); }
2880
2885
  static get watchers() { return {
@@ -10555,7 +10555,7 @@ const TabworthyDates = class {
10555
10555
  await customElements.whenDefined("tabworthy-dates-modal");
10556
10556
  // Use input container as trigger for proper dropdown alignment
10557
10557
  this.inputContainerRef &&
10558
- (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.inputContainerRef)));
10558
+ (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.inputContainerRef, this.calendarButtonRef)));
10559
10559
  if ((await ((_b = this.modalRef) === null || _b === void 0 ? void 0 : _b.getState())) === false)
10560
10560
  await ((_c = this.modalRef) === null || _c === void 0 ? void 0 : _c.open());
10561
10561
  else if ((await ((_d = this.modalRef) === null || _d === void 0 ? void 0 : _d.getState())) === true)
@@ -10999,7 +10999,7 @@ const TabworthyDates = class {
10999
10999
  return (h(Host, null, h("label", { htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", null), h("div", { class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
11000
11000
  [this.getClassName("input")]: true,
11001
11001
  [this.inputClass]: !!this.inputClass
11002
- }, ref: (r) => (this.inputRef = r), onChange: this.handleChange, onFocus: () => this.formatInput(false), onBlur: () => this.formatInput(true, false), "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState, "aria-label": this.calendarButtonContent
11002
+ }, ref: (r) => (this.inputRef = r), onChange: this.handleChange, onFocus: () => this.formatInput(false), onBlur: () => this.formatInput(true, false), "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { type: "button", ref: (r) => (this.calendarButtonRef = r), onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState, "aria-label": this.calendarButtonContent
11003
11003
  ? this.datesLabels.openCalendar
11004
11004
  : undefined }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.datesLabels.openCalendar)))), h("tabworthy-dates-modal", { label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
11005
11005
  if (!this.pickerRef)
@@ -143,7 +143,7 @@ const TabworthyTimes = class {
143
143
  this.handleCalendarButtonClick = async () => {
144
144
  if (this.modalRef) {
145
145
  // Use input container as trigger for proper dropdown alignment
146
- await this.modalRef.setTriggerElement(this.inputContainerRef);
146
+ await this.modalRef.setTriggerElement(this.inputContainerRef, this.calendarButtonRef);
147
147
  await this.modalRef.open();
148
148
  }
149
149
  };
@@ -489,12 +489,12 @@ const TabworthyTimes = class {
489
489
  }
490
490
  render() {
491
491
  var _a;
492
- return (h(Host, { key: '40aebf1f077c4766cbbb9bd3929f5d8d959b60a4', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState, "time-only": this.timeOnly }, h("label", { key: 'cbf04161329d320ebc9ae5b3a0fede08e3157afb', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '2e7e46172b8d46b2f88047d93f9e4d35e5c841f3', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '0fcf906d8bad7fe78e003bf881a6d22dcb42f4e8', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
492
+ return (h(Host, { key: 'eb40f4186e17019d6c0e7f59cd6c34ee65550fd8', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState, "time-only": this.timeOnly }, h("label", { key: '6d1f0deae328d66331350247da217c428910ddfb', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: 'd7721562f0eeb5be4f6b68ff8e1c01c4ed08fe1b', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '1e4b4bd45f63aa5357505f58edde39739a51a124', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
493
493
  [this.getClassName("input")]: true,
494
494
  [this.inputClass]: !!this.inputClass
495
- }, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: '7d63c31494474844633f64faf0aba4851574dce6', type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState, "aria-label": this.calendarButtonContent
495
+ }, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: 'c5789e7d45619291c38895ba184c6ec74d73c584', type: "button", ref: (r) => (this.calendarButtonRef = r), onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState, "aria-label": this.calendarButtonContent
496
496
  ? this.timesLabels.openCalendar
497
- : undefined }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: '802a7f839dd33d19885918819ae4a3fa9f6cb838', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
497
+ : undefined }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: 'af58b555642816b299cf50394148ed17c427db21', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
498
498
  if (this.pickerRef) {
499
499
  this.pickerRef.modalIsOpen = true;
500
500
  }
@@ -508,7 +508,7 @@ const TabworthyTimes = class {
508
508
  if (this.timePickerRef) {
509
509
  this.timePickerRef.modalIsOpen = false;
510
510
  }
511
- }, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '2ff172c30561b5962400dc2fa052162e01013c7a', class: this.getClassName("picker-container") }, !this.timeOnly && (h("tabworthy-dates-calendar", { key: '6456181b374cae4d91c01b9b7873c91bb08a8778', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), onRequestClose: () => { var _a; return (_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close(); }, labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showCloseButton: this.showCloseButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined, nextMonthButtonContent: this.nextMonthButtonContent, nextYearButtonContent: this.nextYearButtonContent, previousMonthButtonContent: this.previousMonthButtonContent, previousYearButtonContent: this.previousYearButtonContent, todayButtonContent: this.todayButtonContent, clearButtonContent: this.clearButtonContent, closeButtonContent: this.closeButtonContent }, h("div", { key: '4a89d517cfcf22cffccecddca841102cb913a8fb', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: '72d37f7058959877afa16b8336f834cc0e5aceba', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: 'bdba34da5c2a2a0af681e40516b0d48e8833e276', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState || this.isDateOutOfBounds(), onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels, minTime: this.getEffectiveMinTime(), maxTime: this.getEffectiveMaxTime(), ref: (el) => (this.timePickerRef = el) })))), this.timeOnly && (h("div", { key: '50a2866b8e7a408f72d37ee540ecba546103d4f4', class: this.getClassName("time-section") }, h("tabworthy-times-picker", { key: 'de317aaa6579be60679cba468e5b28be8654aa5d', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState || this.isDateOutOfBounds(), onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels, minTime: this.getEffectiveMinTime(), maxTime: this.getEffectiveMaxTime(), ref: (el) => (this.timePickerRef = el) }))))), this.errorState && (h("div", { key: '7617cfa25799dbbb8056abcba161284745022f44', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
511
+ }, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '1bc48335f50777efd746a2737ac6acc60a72dec3', class: this.getClassName("picker-container") }, !this.timeOnly && (h("tabworthy-dates-calendar", { key: 'd0bdb6e18676f0019be5fd939a19075927b10fa4', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), onRequestClose: () => { var _a; return (_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close(); }, labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showCloseButton: this.showCloseButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined, nextMonthButtonContent: this.nextMonthButtonContent, nextYearButtonContent: this.nextYearButtonContent, previousMonthButtonContent: this.previousMonthButtonContent, previousYearButtonContent: this.previousYearButtonContent, todayButtonContent: this.todayButtonContent, clearButtonContent: this.clearButtonContent, closeButtonContent: this.closeButtonContent }, h("div", { key: '042f5fa7e60b67858ea7f92ca80792953b38d0a1', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: '7262873201e1294e6116fea1f429c71e37bf06c2', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: '46a179fd9ce95d53e144d0b03a77311e4daa3c10', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState || this.isDateOutOfBounds(), onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels, minTime: this.getEffectiveMinTime(), maxTime: this.getEffectiveMaxTime(), ref: (el) => (this.timePickerRef = el) })))), this.timeOnly && (h("div", { key: 'eaedaf5a7157dbdc99a947b6eb3e55f696556371', class: this.getClassName("time-section") }, h("tabworthy-times-picker", { key: '504ea7e3069134e695d09ef48834b947de629b5e', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState || this.isDateOutOfBounds(), onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels, minTime: this.getEffectiveMinTime(), maxTime: this.getEffectiveMaxTime(), ref: (el) => (this.timePickerRef = el) }))))), this.errorState && (h("div", { key: '961823a7550b5439d2768f80317422b057758de3', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
512
512
  }
513
513
  get el() { return getElement(this); }
514
514
  static get watchers() { return {
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,H as h,g as e}from"./p-CwtZ_Lud.js";import{g as a,d as n,c as r,f as o}from"./p-DCgn1Avj.js";import{g as d,r as l}from"./p-CoFOnMSw.js";var c,u,f={exports:{}},m=a(c?f.exports:(c=1,f.exports=(u={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},function(t,i,s){var h=i.prototype,e=h.format;s.en.formats=u,h.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var i=this.$locale().formats,s=function(t,i){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,s,h){var e=h&&h.toUpperCase();return s||i[h]||u[h]||i[e].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,i,s){return i||s.slice(1)}))}))}(t,void 0===i?{}:i);return e.call(this,s)}})));n.extend(r),n.extend(m);const b={selected:"selected",openCalendar:"Choose time",calendar:"date and time picker",invalidDateError:"We could not find a matching date",minDateError:"Please fill in a date after ",maxDateError:"Please fill in a date before ",rangeOutOfBoundsError:"Please enter a valid range of dates",disabledDateError:"Please choose an available date",to:"to",startDate:"Start date",timeLabel:"Time"},y=class{constructor(s){t(this,s),this.selectDateTime=i(this,"selectDateTime",7),this.changeYear=i(this,"changeYear",7),this.errorChange=i(this,"errorChange",7),this.componentReady=i(this,"componentReady",7),this.range=!1,this.timeOnly=!1,this.label="Choose a date and time",this.placeholder="",this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.disabled=!1,this.startDate=d(new Date),this.referenceDate=d(new Date),this.useTwelveHourFormat=!0,this.showSeconds=!1,this.timesLabels=b,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showCloseButton=!1,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.disableFreeformInput=!1,this.inputClass="",this.selectedHours=(new Date).getHours(),this.selectedMinutes=(new Date).getMinutes(),this.selectedSeconds=(new Date).getSeconds(),this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{if(!t)return this.clearValue();const i=t.split(",");if(this.range&&2===i.length){const t=l(new Date(i[0])),s=l(new Date(i[1]));if(!this.isDateValid(t)||!this.isDateValid(s))return;this.updateValue([t,s]),this.pickerRef&&(this.pickerRef.value=[t,s])}else{const t=l(new Date(i[0]));if(!this.isDateValid(t))return;this.clampTimeToBounds(t),this.updateValue(t),this.pickerRef&&(this.pickerRef.value=void 0,this.pickerRef.value=t)}},this.handleTimeChange=t=>{this.selectedHours=t.detail.hours,this.selectedMinutes=t.detail.minutes,void 0!==t.detail.seconds&&(this.selectedSeconds=t.detail.seconds),this.selectedDate?this.updateValue(this.selectedDate):this.timeOnly&&this.updateValue(this.getDateForTimeOnlyValue())},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.inputContainerRef,this.calendarButtonRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const i=t.target.value;if(0===i.length)return this.errorState=!1,this.internalValue="",this.pickerRef&&(this.pickerRef.value=null),this.value=this.internalValue,this.selectDateTime.emit(this.internalValue);let s=n(i,this.format,!0);if(s.isValid()||(s=n(i)),s.isValid()){if(this.minDate&&s.isBefore(n(this.minDate)))return this.errorState=!0,this.errorMessage=o(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),void this.emitErrorChange("minDate",this.errorMessage);if(this.maxDate&&s.isAfter(n(this.maxDate)))return this.errorState=!0,this.errorMessage=o(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),void this.emitErrorChange("maxDate",this.errorMessage);if(this.disableDate(s.toDate()))return this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,void this.emitErrorChange("disabledDate",this.errorMessage);this.errorState=!1,this.selectedHours=s.hour(),this.selectedMinutes=s.minute(),this.selectedSeconds=s.second(),this.updateValue(s.toDate())}else this.errorState=!0,this.errorMessage=this.timesLabels.invalidDateError,this.emitErrorChange("invalid",this.errorMessage)}}emitErrorChange(t,i){this.errorChange.emit({reason:t,message:i})}formatBoundaryDate(t){const i=n(t);if(!i.isValid())return t;if(!t.includes("T")&&!t.includes(" "))return Intl.DateTimeFormat(this.locale,{day:"numeric",month:"short",year:"numeric"}).format(i.toDate());const s=Object.assign({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"},this.showSeconds?{second:"numeric"}:{});return Intl.DateTimeFormat(this.locale,s).format(i.toDate())}getEffectiveMinTime(){if(!this.minDate||!this.selectedDate)return;const t=n(this.minDate),i=n(this.selectedDate);return t.isValid()&&i.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}getEffectiveMaxTime(){if(!this.maxDate||!this.selectedDate)return;const t=n(this.maxDate),i=n(this.selectedDate);return t.isValid()&&i.isSame(t,"day")?{hours:t.hour(),minutes:t.minute(),seconds:t.second()}:void 0}isDateOutOfBounds(){if(!this.selectedDate)return!1;const t=n(this.selectedDate);return!(!this.minDate||!t.isBefore(n(this.minDate),"day"))||!(!this.maxDate||!t.isAfter(n(this.maxDate),"day"))}clampTimeToBounds(t){const i=n(t);if(this.minDate){const t=n(this.minDate);t.isValid()&&i.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds<3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}if(this.maxDate){const t=n(this.maxDate);t.isValid()&&i.isSame(t,"day")&&3600*this.selectedHours+60*this.selectedMinutes+this.selectedSeconds>3600*t.hour()+60*t.minute()+t.second()&&(this.selectedHours=t.hour(),this.selectedMinutes=t.minute(),this.selectedSeconds=t.second())}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}getDateForTimeOnlyValue(){if(this.selectedDate)return this.selectedDate;const t=n(this.referenceDate);return t.isValid()?t.toDate():new Date}watchValue(t){this.syncFromValueProp()}watchDisabled(t){this.disabledState=t}watchHasError(t){this.errorState=t}componentDidLoad(){this.syncFromValueProp(),this.componentReady.emit(),this.id||console.error('tabworthy-times: The "id" prop is required for accessibility')}syncFromValueProp(){if(this.internalValue=this.value||null,this.value){const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const i=n(t,this.format);i.isValid()&&(this.selectedDate=i.toDate(),this.selectedHours=i.hour(),this.selectedMinutes=i.minute(),this.selectedSeconds=i.second())}}else this.selectedDate=void 0;if(this.pickerRef)if(Array.isArray(this.value)){const t=this.value.reduce(((t,i)=>{const s=n(i,this.format,!0);return s.isValid()&&t.push(s.toDate()),t}),[]);this.pickerRef.value=t.length?t:null}else if(this.value){const t=n(this.value,this.format,!0);t.isValid()&&(this.pickerRef.value=t.toDate())}else this.pickerRef.value=null;this.inputRef&&(this.value?this.shouldInputFormat()?this.formatInput():this.inputRef.value=this.internalValue.toString():this.inputRef.value="")}updateValue(t){if(Array.isArray(t)){const i=t.map((t=>n(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format)));this.internalValue=i,this.value=i,this.selectDateTime.emit(i)}else{const i=n(t).hour(this.selectedHours).minute(this.selectedMinutes).second(this.selectedSeconds).format(this.format);this.internalValue=i,this.value=i,this.selectedDate=t,this.selectDateTime.emit(i)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}isDateValid(t){const i=n(t);return!(!i.isValid()||(this.minDate&&i.isBefore(n(this.minDate),"day")?(this.errorState=!0,this.errorMessage=o(this.timesLabels.minDateError,this.formatBoundaryDate(this.minDate)),this.emitErrorChange("minDate",this.errorMessage),1):this.maxDate&&i.isAfter(n(this.maxDate),"day")?(this.errorState=!0,this.errorMessage=o(this.timesLabels.maxDateError,this.formatBoundaryDate(this.maxDate)),this.emitErrorChange("maxDate",this.errorMessage),1):this.disableDate(t)&&(this.errorState=!0,this.errorMessage=this.timesLabels.disabledDateError,this.emitErrorChange("disabledDate",this.errorMessage),1)))}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>n(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=this.timeOnly?n(this.internalValue,this.format).format(this.showSeconds?"LTS":"LT"):n(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>n(t,this.format).toDate())):n(t,this.format).toDate():null}async revertInput(t,i=!1){i&&(this.errorState=!1),this.value=t,this.syncFromValueProp()}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef&&(this.inputRef.value=""),this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return s(h,{key:"eb40f4186e17019d6c0e7f59cd6c34ee65550fd8",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState,"time-only":this.timeOnly},s("label",{key:"6d1f0deae328d66331350247da217c428910ddfb",htmlFor:`${this.id}-input`,class:this.getClassName("label")},this.label),s("div",{key:"d7721562f0eeb5be4f6b68ff8e1c01c4ed08fe1b",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},s("input",{key:"1e4b4bd45f63aa5357505f58edde39739a51a124",id:`${this.id}-input`,ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:t.toString(),onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?`${this.id}-error`:void 0,"aria-invalid":this.errorState}),!this.inline&&s("button",{key:"c5789e7d45619291c38895ba184c6ec74d73c584",type:"button",ref:t=>this.calendarButtonRef=t,onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState,"aria-label":this.calendarButtonContent?this.timesLabels.openCalendar:void 0},this.calendarButtonContent?s("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),s("tabworthy-dates-modal",{key:"af58b555642816b299cf50394148ed17c427db21",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0),this.timeOnly&&this.timePickerRef&&(this.timePickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1),this.timePickerRef&&(this.timePickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},s("div",{key:"1bc48335f50777efd746a2737ac6acc60a72dec3",class:this.getClassName("picker-container")},!this.timeOnly&&s("tabworthy-dates-calendar",{key:"d0bdb6e18676f0019be5fd939a19075927b10fa4",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),onRequestClose:()=>{var t;return null===(t=this.modalRef)||void 0===t?void 0:t.close()},labels:this.datesCalendarLabels,ref:t=>this.pickerRef=t,startDate:this.startDate,firstDayOfWeek:this.firstDayOfWeek,showHiddenTitle:!0,disabled:this.disabledState,showMonthStepper:this.showMonthStepper,showYearStepper:this.showYearStepper,showClearButton:this.showClearButton,showCloseButton:this.showCloseButton,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline,value:this.value?this.toDate(this.value):void 0,nextMonthButtonContent:this.nextMonthButtonContent,nextYearButtonContent:this.nextYearButtonContent,previousMonthButtonContent:this.previousMonthButtonContent,previousYearButtonContent:this.previousYearButtonContent,todayButtonContent:this.todayButtonContent,clearButtonContent:this.clearButtonContent,closeButtonContent:this.closeButtonContent},s("div",{key:"042f5fa7e60b67858ea7f92ca80792953b38d0a1",slot:"after-calendar",class:this.getClassName("time-section")},s("hr",{key:"7262873201e1294e6116fea1f429c71e37bf06c2",class:this.getClassName("divider")}),s("tabworthy-times-picker",{key:"46a179fd9ce95d53e144d0b03a77311e4daa3c10",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t}))),this.timeOnly&&s("div",{key:"eaedaf5a7157dbdc99a947b6eb3e55f696556371",class:this.getClassName("time-section")},s("tabworthy-times-picker",{key:"504ea7e3069134e695d09ef48834b947de629b5e",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState||this.isDateOutOfBounds(),onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels,minTime:this.getEffectiveMinTime(),maxTime:this.getEffectiveMaxTime(),ref:t=>this.timePickerRef=t})))),this.errorState&&s("div",{key:"961823a7550b5439d2768f80317422b057758de3",class:this.getClassName("input-error"),id:this.id?`${this.id}-error`:void 0,role:"status"},this.errorMessage))}get el(){return e(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}};export{y as tabworthy_times}