@tabworthy/components 0.12.2 → 0.12.4
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tabworthy-components.cjs.js +1 -1
- package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +22 -6
- package/dist/cjs/tabworthy-dates.cjs.entry.js +4 -2
- package/dist/cjs/tabworthy-times.cjs.entry.js +5 -3
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +80 -2
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +22 -6
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +138 -3
- package/dist/components/p-DAc3jaFB.js +1 -0
- package/dist/components/tabworthy-dates-calendar.js +1 -1
- package/dist/components/tabworthy-dates.js +1 -1
- package/dist/components/tabworthy-times.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tabworthy-components.js +1 -1
- package/dist/esm/tabworthy-dates-calendar_2.entry.js +22 -6
- package/dist/esm/tabworthy-dates.entry.js +4 -2
- package/dist/esm/tabworthy-times.entry.js +5 -3
- package/dist/tabworthy-components/p-28192b55.entry.js +1 -0
- package/dist/tabworthy-components/{p-744ffef9.entry.js → p-3b548ae1.entry.js} +1 -1
- package/dist/tabworthy-components/{p-04240a8d.entry.js → p-626a5c0b.entry.js} +1 -1
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +4 -0
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +7 -0
- package/dist/types/components.d.ts +33 -0
- package/package.json +1 -2
- package/dist/components/p-M03P4DAz.js +0 -1
- package/dist/tabworthy-components/p-df93e5d4.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as i,d as a,t as h}from"./p-BiJ0HZVY.js";import{g as r,d as o,c as n}from"./p-DkyM-7xr.js";import{g as d,r as l,c}from"./p-M03P4DAz.js";import{d as u}from"./p-CMIEIvTW.js";import{d as f}from"./p-BTQaxOHo.js";var m,b={exports:{}},p=r(m?b.exports:(m=1,b.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,e,i){var a=e.prototype,h=a.format;i.en.formats=t,a.format=function(s){void 0===s&&(s="YYYY-MM-DDTHH:mm:ssZ");var e=this.$locale().formats,i=function(s,e){return s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(s,i,a){var h=a&&a.toUpperCase();return i||e[a]||t[a]||e[h].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,s,e){return s||e.slice(1)}))}))}(s,void 0===e?{}:e);return h.call(this,i)}}}()));o.extend(n),o.extend(p);const w={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=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectDateTime=e(this,"selectDateTime",7),this.changeYear=e(this,"changeYear",7),this.componentReady=e(this,"componentReady",7),this.range=!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=w,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=l(new Date(s[0])),e=l(new Date(s[1]));this.updateValue([t,e]),this.pickerRef&&(this.pickerRef.value=[t,e])}else{const t=l(new Date(s[0]));this.updateValue(t),this.pickerRef&&(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.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 e=o(s,this.format,!0);e.isValid()||(e=o(s)),e.isValid()?(this.errorState=!1,this.selectedHours=e.hour(),this.selectedMinutes=e.minute(),this.selectedSeconds=e.second(),this.updateValue(e.toDate())):(this.errorState=!0,this.errorMessage=this.timesLabels.invalidDateError)}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}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.value){this.internalValue=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.internalValue=null}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()}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=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 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 i(a,{key:"671702979dddb6a19cfa78a95df28a958af56df9",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"7b23263f899b3a59d43f3f2922e9c98a0bc62524",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),i("div",{key:"453d585bee8dd0262aadec8ba816cd22c51cffea",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},i("input",{key:"d2ec7de2b31f3c1a6b9acb4f57341530cb8431dc",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&&i("button",{key:"77b42f53ad8a5e0d5d70ea41f999f95d61942a83",type:"button",onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState},this.calendarButtonContent?i("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),i("tabworthy-dates-modal",{key:"3633f9e7839b8947da48f83ac3808156bea8515d",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},i("div",{key:"706e2fdcd7e4ecf77f5ee63f4c5ced7951593735",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"cb027f3fe4d2bf73abea9ec6511fe11305e28aba",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},i("div",{key:"2287a25cdec6fc40c36833c250536f99cabe5cbf",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"540cfd69b4ca3618ecd22f9d1ed3d240ed8eeee9",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"79e8c05c3ba4af1ef46a78c6d6fcb211dec7abd5",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels}))))),this.errorState&&i("div",{key:"4a568e01f57652308adb7a8c115ab6649fc591fc",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],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"],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],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),D=y,v=function(){"undefined"!=typeof customElements&&["tabworthy-times","tabworthy-dates-calendar","tabworthy-dates-modal","tabworthy-times-picker"].forEach((t=>{switch(t){case"tabworthy-times":customElements.get(h(t))||customElements.define(h(t),y);break;case"tabworthy-dates-calendar":customElements.get(h(t))||c();break;case"tabworthy-dates-modal":customElements.get(h(t))||u();break;case"tabworthy-times-picker":customElements.get(h(t))||f()}}))};export{D as TabworthyTimes,v as defineCustomElement}
|
|
1
|
+
import{p as t,H as s,c as e,h as i,d as a,t as h}from"./p-BiJ0HZVY.js";import{g as o,d as n,c as r}from"./p-DkyM-7xr.js";import{g as l,r as d,c}from"./p-DAc3jaFB.js";import{d as u}from"./p-CMIEIvTW.js";import{d as b}from"./p-BTQaxOHo.js";var m,f={exports:{}},p=o(m?f.exports:(m=1,f.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,e,i){var a=e.prototype,h=a.format;i.en.formats=t,a.format=function(s){void 0===s&&(s="YYYY-MM-DDTHH:mm:ssZ");var e=this.$locale().formats,i=function(s,e){return s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(s,i,a){var h=a&&a.toUpperCase();return i||e[a]||t[a]||e[h].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,s,e){return s||e.slice(1)}))}))}(s,void 0===e?{}:e);return h.call(this,i)}}}()));n.extend(r),n.extend(p);const w={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=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectDateTime=e(this,"selectDateTime",7),this.changeYear=e(this,"changeYear",7),this.componentReady=e(this,"componentReady",7),this.range=!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=w,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=d(new Date(s[0])),e=d(new Date(s[1]));this.updateValue([t,e]),this.pickerRef&&(this.pickerRef.value=[t,e])}else{const t=d(new Date(s[0]));this.updateValue(t),this.pickerRef&&(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.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 e=n(s,this.format,!0);e.isValid()||(e=n(s)),e.isValid()?(this.errorState=!1,this.selectedHours=e.hour(),this.selectedMinutes=e.minute(),this.selectedSeconds=e.second(),this.updateValue(e.toDate())):(this.errorState=!0,this.errorMessage=this.timesLabels.invalidDateError)}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}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.value){this.internalValue=this.value;const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const s=n(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hour(),this.selectedMinutes=s.minute(),this.selectedSeconds=s.second())}}else this.internalValue=null}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>n(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=n(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()}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=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 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 i(a,{key:"e07a561aa76dedbf8f8e28c491b3aac19f45c472",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"24e11901760a8c7f989f3d33df9cd58af899a8dc",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),i("div",{key:"17c4a53c621b66e62f857d49b4b8f4b52d51183d",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},i("input",{key:"7dd776e464533c7bb6c842a0332f0d667f52c7cc",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&&i("button",{key:"0e84b4e3ae7f5abe1a59e939cccc227bf34ab992",type:"button",onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState,"aria-label":this.calendarButtonContent?this.timesLabels.openCalendar:void 0},this.calendarButtonContent?i("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),i("tabworthy-dates-modal",{key:"baebeeeda4200bf13fe8f023bb39e2c13fc58b0b",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},i("div",{key:"0fc94282af5f36ae9214e967dab2acac911bca14",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"4b0ef9c95058398d759fe913b22a84d5f22bd383",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},i("div",{key:"b766d90c7bb4732c6ae26cadeb610a6e0c10a597",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"f98fc31d11a3bdd999a5dc0cc15bf1921f349b9b",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"cfe86bb9291d1a14d37ab7240ec2f2f7f9bece4d",hours:this.selectedHours,minutes:this.selectedMinutes,seconds:this.selectedSeconds,showSeconds:this.showSeconds,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels}))))),this.errorState&&i("div",{key:"1c2d4b6469266b894402512612a71721acf28f7e",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],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],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),v=y,D=function(){"undefined"!=typeof customElements&&["tabworthy-times","tabworthy-dates-calendar","tabworthy-dates-modal","tabworthy-times-picker"].forEach((t=>{switch(t){case"tabworthy-times":customElements.get(h(t))||customElements.define(h(t),y);break;case"tabworthy-dates-calendar":customElements.get(h(t))||c();break;case"tabworthy-dates-modal":customElements.get(h(t))||u();break;case"tabworthy-times-picker":customElements.get(h(t))||b()}}))};export{v as TabworthyTimes,D as defineCustomElement}
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"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"],"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],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-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"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"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"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"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],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-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"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"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"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"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"],"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],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-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"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"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"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"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],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-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"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"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"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -231,6 +231,16 @@ const TabworthyDatesCalendar = class {
|
|
|
231
231
|
const row = daysOfMonth.slice(i, i + 7);
|
|
232
232
|
calendarRows.push(row);
|
|
233
233
|
}
|
|
234
|
+
const lastRow = calendarRows[calendarRows.length - 1];
|
|
235
|
+
let lastDay = lastRow === null || lastRow === void 0 ? void 0 : lastRow[lastRow.length - 1];
|
|
236
|
+
while (calendarRows.length < 6 && lastDay) {
|
|
237
|
+
const row = [];
|
|
238
|
+
for (let i = 0; i < 7; i += 1) {
|
|
239
|
+
lastDay = addDays(lastDay, 1);
|
|
240
|
+
row.push(lastDay);
|
|
241
|
+
}
|
|
242
|
+
calendarRows.push(row);
|
|
243
|
+
}
|
|
234
244
|
return calendarRows;
|
|
235
245
|
}
|
|
236
246
|
getTitle() {
|
|
@@ -326,15 +336,15 @@ const TabworthyDatesCalendar = class {
|
|
|
326
336
|
monthIsDisabled(getNextMonth(this.currentDate).getMonth(), getNextMonth(this.currentDate).getFullYear(), this.minDate, this.maxDate)
|
|
327
337
|
}
|
|
328
338
|
};
|
|
329
|
-
return (h(Host, { key: '
|
|
339
|
+
return (h(Host, { key: '1bda8d7a489d87cf27ecbcd978accf5363f32804' }, h("div", { key: '7118660fbbdfac4a73a1ace99d96d4ac32a4b137', class: {
|
|
330
340
|
[`${this.getClassName()}-wrapper`]: true,
|
|
331
341
|
[`${this.getClassName()}-wrapper--inline`]: this.inline
|
|
332
|
-
} }, h("div", { key: '
|
|
342
|
+
} }, h("div", { key: '41b62826cdff428aef8ad89844a50873f8853b5e', class: {
|
|
333
343
|
[this.getClassName()]: true,
|
|
334
344
|
[`${this.getClassName()}--disabled`]: this.disabled
|
|
335
|
-
} }, h("div", { key: '
|
|
345
|
+
} }, h("div", { key: '7a9ee67778c6f48e65d88defc1ff620e995d75bc', class: this.getClassName("header") }, this.showHiddenTitle && (h("span", { key: '404e50ab0f24235d6678af7c12f6b3cdd491e347', "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle())), this.showYearStepper && (h("button", { key: '88552edc01ae9c4a7d8225c2aab078d2123bf9f6', "aria-label": this.labels.previousYearButton, class: this.getClassName("previous-year-button"), "aria-disabled": disabled.year.prev, innerHTML: this.previousYearButtonContent || undefined, onClick: this.previousYear, type: "button" }, h("svg", { key: '5daef016748f562ddf3866557774c87016887fc6', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { key: '5b73b6ec2b5abcae4d2e5cd833b5de441938e533', points: "11 17 6 12 11 7" }), h("polyline", { key: '05e146e1c233c39403147e7af61948798db7c0f7', points: "18 17 13 12 18 7" })))), this.showMonthStepper && (h("button", { key: '6145f62f073563e9136ad454f4e9633e99b8d8a9', "aria-label": this.labels.previousMonthButton, class: this.getClassName("previous-month-button"), "aria-disabled": disabled.month.prev, innerHTML: this.previousMonthButtonContent || undefined, onClick: this.previousMonth, type: "button" }, h("svg", { key: '8ae9cc385a6fdbdd915a2717246752c7f2f17b01', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { key: '9395192e65c1e550547220850b29a117569a79e2', points: "15 18 9 12 15 6" })))), h("span", { key: '3b282148e95b8b1facde4a2ab370c6088b72bccd', class: this.getClassName("current-month") }, h("select", { key: 'f782b9d803abd5eb1add6c869b3ac302a717780d', "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), "aria-disabled": this.disabled, name: "month", onChange: this.onMonthSelect }, getMonths(this.locale).map((month, index) => {
|
|
336
346
|
return (h("option", { key: month, selected: this.currentDate.getMonth() === index, value: index + 1, disabled: monthIsDisabled(index, this.currentDate.getFullYear(), this.minDate, this.maxDate) }, month));
|
|
337
|
-
})), h("input", { key: '
|
|
347
|
+
})), h("input", { key: 'dcd8a96a130513d1cf34d900d6f8c09ce974ba15', "aria-label": this.labels.yearSelect, class: this.getClassName("year-select"), "aria-disabled": this.disabled, max: this.maxDate ? this.maxDate.slice(0, 4) : 9999, min: this.minDate ? this.minDate.slice(0, 4) : 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && (h("button", { key: '7de261689d242a0116e85f3c5fda265f49eaaf13', "aria-label": this.labels.nextMonthButton, class: this.getClassName("next-month-button"), "aria-disabled": disabled.month.next, innerHTML: this.nextMonthButtonContent || undefined, onClick: this.nextMonth, type: "button" }, h("svg", { key: '2033c731d98fd53088857a92bdd35e5e977137d7', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { key: 'dc88e8e5e4f79d5ae0b62ea51f6ba52d5e26ce9f', points: "9 18 15 12 9 6" })))), this.showYearStepper && (h("button", { key: 'e25bcd81e34e0e162954b2ab67876c148f50f5d4', "aria-label": this.labels.nextYearButton, class: this.getClassName("next-year-button"), "aria-disabled": disabled.year.next, innerHTML: this.nextYearButtonContent || undefined, onClick: this.nextYear, type: "button" }, h("svg", { key: '70df81cfd06bcb1e6571933b7a43a5071522159b', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { key: 'f8242866ca29743b19055d1ac53fcc8e84d68a35', points: "13 17 18 12 13 7" }), h("polyline", { key: '6bda80ff2eba82dac0d36e287976130e6b16113c', points: "6 17 11 12 6 7" }))))), h("div", { key: '6d5b0085437827c1db975f12dc5fe5927c7ba62f', class: this.getClassName("body") }, h("table", { key: '61975eac4e06c3a416fcb9503eef9c7a386a6b54', class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid", "aria-label": this.getTitle() }, h("thead", { key: 'fd259bd5ba6e12ff39dad5a31133913d17fdf276', class: this.getClassName("calendar-header") }, h("tr", { key: '410c84eabac58cf6139dd6c886b4803772abceb5', class: this.getClassName("weekday-row") }, (_a = this.weekdays) === null || _a === void 0 ? void 0 : _a.map((weekday) => (h("th", { role: "columnheader", abbr: weekday[1], class: this.getClassName("weekday"), key: weekday[0], scope: "col" }, h("span", { "aria-hidden": "true" }, weekday[0]), h("span", { class: "visually-hidden" }, weekday[1])))))), h("tbody", { key: '330d3b922d474b42edf0764556d2f2643b5b639d' }, this.getCalendarRows().map((calendarRow) => {
|
|
338
348
|
const rowKey = `row-${calendarRow[0].getMonth()}-${calendarRow[0].getDate()}`;
|
|
339
349
|
return (h("tr", { class: this.getClassName("calendar-row"), key: rowKey }, calendarRow.map((day) => {
|
|
340
350
|
var _a, _b, _c;
|
|
@@ -401,8 +411,14 @@ const TabworthyDatesCalendar = class {
|
|
|
401
411
|
? 0
|
|
402
412
|
: -1 }, h(Tag, { "aria-hidden": "true" }, day.getDate()), h("span", { class: "visually-hidden" }, getScreenReaderText())));
|
|
403
413
|
})));
|
|
404
|
-
})))), showFooter && (h("div", { key: '
|
|
405
|
-
|
|
414
|
+
})))), showFooter && (h("div", { key: '88362c2e1731e8813ad9c5da3b34f6afe16f2036', class: this.getClassName("footer") }, h("div", { key: 'e93a0b8fff1be09855ab87db159cb186b9339a39', class: this.getClassName("footer-buttons") }, this.showTodayButton && (h("button", { key: 'c1c9583c3d4cfdc70e0ca335e9dad603692050da', "aria-label": this.todayButtonContent
|
|
415
|
+
? this.labels.todayButton
|
|
416
|
+
: undefined, class: this.getClassName("today-button"), disabled: this.disabled, innerHTML: this.todayButtonContent || undefined, onClick: this.showToday, type: "button" }, !this.todayButtonContent && this.labels.todayButton)), this.showClearButton && (h("button", { key: '79a676ea7b12a62121367ce3226a321e0d6821a2', "aria-label": this.clearButtonContent
|
|
417
|
+
? this.labels.clearButton
|
|
418
|
+
: undefined, class: this.getClassName("clear-button"), disabled: this.disabled, innerHTML: this.clearButtonContent || undefined, onClick: this.clear, type: "button" }, !this.clearButtonContent && this.labels.clearButton)), this.showCloseButton && (h("button", { key: '51e4af6bb0ce2471491ef74b577c1f4404ae1b73', "aria-label": this.closeButtonContent
|
|
419
|
+
? this.labels.closeButton
|
|
420
|
+
: undefined, class: this.getClassName("close-button"), disabled: this.disabled, innerHTML: this.closeButtonContent || undefined, onClick: this.close, type: "button" }, !this.closeButtonContent && this.labels.closeButton))), this.showKeyboardHint &&
|
|
421
|
+
!window.matchMedia("(pointer: coarse)").matches && (h("button", { key: '89d2636eaca98ee89e38a1650db7f7a9c3ef0be5', type: "button", onClick: () => alert("Todo: Add Keyboard helper!"), class: this.getClassName("keyboard-hint") }, h("svg", { key: '0326ae480467bcb617827f29d84dffc4339f73dd', xmlns: "http://www.w3.org/2000/svg", height: "1em", width: "1em", viewBox: "0 0 48 48", fill: "currentColor" }, h("path", { key: '760d4c482eab6023fc43c69826ede1f5fbba145e', d: "M7 38q-1.2 0-2.1-.925Q4 36.15 4 35V13q0-1.2.9-2.1.9-.9 2.1-.9h34q1.2 0 2.1.9.9.9.9 2.1v22q0 1.15-.9 2.075Q42.2 38 41 38Zm0-3h34V13H7v22Zm8-3.25h18v-3H15Zm-4.85-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm-24.7-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3ZM7 35V13v22Z" })), this.labels.keyboardHint))))), h("slot", { key: '5ac974fba92a2afb8b13eaa5a06f560ed707a93f', name: "after-calendar" }))));
|
|
406
422
|
}
|
|
407
423
|
get el() { return getElement(this); }
|
|
408
424
|
static get watchers() { return {
|
|
@@ -10943,7 +10943,9 @@ const TabworthyDates = class {
|
|
|
10943
10943
|
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: {
|
|
10944
10944
|
[this.getClassName("input")]: true,
|
|
10945
10945
|
[this.inputClass]: !!this.inputClass
|
|
10946
|
-
}, 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
|
|
10946
|
+
}, 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
|
|
10947
|
+
? this.datesLabels.openCalendar
|
|
10948
|
+
: 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: () => {
|
|
10947
10949
|
if (!this.pickerRef)
|
|
10948
10950
|
return;
|
|
10949
10951
|
this.pickerRef.modalIsOpen = true;
|
|
@@ -10951,7 +10953,7 @@ const TabworthyDates = class {
|
|
|
10951
10953
|
if (!this.pickerRef)
|
|
10952
10954
|
return;
|
|
10953
10955
|
this.pickerRef.modalIsOpen = false;
|
|
10954
|
-
}, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", { 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 ? this.datesCalendarLabels : undefined, 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, showKeyboardHint: this.showKeyboardHint, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline })), this.showQuickButtons &&
|
|
10956
|
+
}, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", { 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 ? this.datesCalendarLabels : undefined, 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, showKeyboardHint: this.showKeyboardHint, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, nextMonthButtonContent: this.nextMonthButtonContent, nextYearButtonContent: this.nextYearButtonContent, previousMonthButtonContent: this.previousMonthButtonContent, previousYearButtonContent: this.previousYearButtonContent, todayButtonContent: this.todayButtonContent, clearButtonContent: this.clearButtonContent, closeButtonContent: this.closeButtonContent })), this.showQuickButtons &&
|
|
10955
10957
|
((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
10956
10958
|
this.chronoSupportedLocale && (h("div", { class: this.getClassName("quick-group"), role: "group", "aria-label": this.datesLabels.quickSelection }, this.quickButtons.map((buttonText) => {
|
|
10957
10959
|
return (h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
|
|
@@ -292,10 +292,12 @@ const TabworthyTimes = class {
|
|
|
292
292
|
}
|
|
293
293
|
render() {
|
|
294
294
|
var _a;
|
|
295
|
-
return (h(Host, { key: '
|
|
295
|
+
return (h(Host, { key: 'e07a561aa76dedbf8f8e28c491b3aac19f45c472', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '24e11901760a8c7f989f3d33df9cd58af899a8dc', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '17c4a53c621b66e62f857d49b4b8f4b52d51183d', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '7dd776e464533c7bb6c842a0332f0d667f52c7cc', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
|
|
296
296
|
[this.getClassName("input")]: true,
|
|
297
297
|
[this.inputClass]: !!this.inputClass
|
|
298
|
-
}, 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: '
|
|
298
|
+
}, 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: '0e84b4e3ae7f5abe1a59e939cccc227bf34ab992', type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState, "aria-label": this.calendarButtonContent
|
|
299
|
+
? this.timesLabels.openCalendar
|
|
300
|
+
: undefined }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: 'baebeeeda4200bf13fe8f023bb39e2c13fc58b0b', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
299
301
|
if (this.pickerRef) {
|
|
300
302
|
this.pickerRef.modalIsOpen = true;
|
|
301
303
|
}
|
|
@@ -303,7 +305,7 @@ const TabworthyTimes = class {
|
|
|
303
305
|
if (this.pickerRef) {
|
|
304
306
|
this.pickerRef.modalIsOpen = false;
|
|
305
307
|
}
|
|
306
|
-
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '
|
|
308
|
+
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '0fc94282af5f36ae9214e967dab2acac911bca14', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '4b0ef9c95058398d759fe913b22a84d5f22bd383', 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: 'b766d90c7bb4732c6ae26cadeb610a6e0c10a597', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: 'f98fc31d11a3bdd999a5dc0cc15bf1921f349b9b', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: 'cfe86bb9291d1a14d37ab7240ec2f2f7f9bece4d', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels }))))), this.errorState && (h("div", { key: '1c2d4b6469266b894402512612a71721acf28f7e', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
307
309
|
}
|
|
308
310
|
get el() { return getElement(this); }
|
|
309
311
|
static get watchers() { return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,H as n,g as s}from"./p-CwtZ_Lud.js";import{g as a,r as o,a as r,b as h,c,d,e as u,f as l,h as f,s as v,i as b,j as p,k as y,l as m,m as w,n as g,o as k,p as x,q as O,t as M,u as j,v as D,w as A}from"./p-BVHu5CWV.js";const C={clearButton:"Clear value",closeButton:"Close",monthSelect:"Select month",nextMonthButton:"Next month",nextYearButton:"Next year",picker:"Choose date",previousMonthButton:"Previous month",previousYearButton:"Previous year",todayButton:"Show today",yearSelect:"Select year",keyboardHint:"Keyboard commands",selected:"Selected date",chooseAsStartDate:"choose as start date",chooseAsEndDate:"choose as end date"},S=class{constructor(i){t(this,i),this.selectDate=e(this,"selectDate",3),this.changeMonth=e(this,"changeMonth",3),this.changeYear=e(this,"changeYear",3),this.requestClose=e(this,"requestClose",3),this.disabled=!1,this.modalIsOpen=!1,this.disableDate=()=>!1,this.elementClassName="tabworthy-dates-calendar",this.firstDayOfWeek=0,this.range=!1,this.labels=C,this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.inline=!1,this.showClearButton=!1,this.showCloseButton=!1,this.showMonthStepper=!0,this.showTodayButton=!0,this.showYearStepper=!1,this.showKeyboardHint=!1,this.showHiddenTitle=!0,this.startDate=a(new Date),this.init=()=>{this.currentDate=this.startDate?o(new Date(this.startDate)):new Date,this.updateWeekdays()},this.nextMonth=()=>{this.updateCurrentDate(r(this.currentDate))},this.nextYear=()=>{this.updateCurrentDate(h(this.currentDate),!1,!0)},this.previousMonth=()=>{this.updateCurrentDate(c(this.currentDate))},this.previousYear=()=>{this.updateCurrentDate(d(this.currentDate),!1,!0)},this.showToday=()=>{this.updateCurrentDate(new Date,!0)},this.clear=()=>{var t;this.value=void 0,null===(t=this.selectDate)||void 0===t||t.emit(void 0)},this.onClick=t=>{if(this.disabled)return;const e=t.target.closest("[data-date]");if(!Boolean(e))return;const i=o(new Date(e.dataset.date));this.updateCurrentDate(i),this.onSelectDate(i)},this.onMonthSelect=t=>{const e=+t.target.value-1,i=new Date(this.currentDate);u(i,this.minDate,this.maxDate)&&(i.setMonth(e),this.updateCurrentDate(i))},this.onYearSelect=t=>{var e;const i=+t.target.value,n=new Date(this.currentDate);u(n,this.minDate,this.maxDate)&&(n.setFullYear(i),null===(e=this.changeYear)||void 0===e||e.emit({year:i}),this.updateCurrentDate(n))},this.onKeyDown=t=>{this.disabled||("ArrowLeft"===t.code?(t.preventDefault(),this.updateCurrentDate(l(this.currentDate),!0)):"ArrowRight"===t.code?(t.preventDefault(),this.updateCurrentDate(f(this.currentDate),!0)):"ArrowUp"===t.code?(t.preventDefault(),this.updateCurrentDate(v(this.currentDate,7),!0)):"ArrowDown"===t.code?(t.preventDefault(),this.updateCurrentDate(b(this.currentDate,7),!0)):"PageUp"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?d(this.currentDate):c(this.currentDate),!0)):"PageDown"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?h(this.currentDate):r(this.currentDate),!0)):"Home"===t.code?(t.preventDefault(),this.updateCurrentDate(p(this.currentDate),!0)):"End"===t.code?(t.preventDefault(),this.updateCurrentDate(y(this.currentDate),!0)):"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),this.onSelectDate(this.currentDate)))},this.onMouseEnter=t=>{var e;if(this.disabled)return;const i=o(new Date(null===(e=t.target.closest("td"))||void 0===e?void 0:e.dataset.date));this.hoveredDate=i},this.onMouseLeave=()=>{this.hoveredDate=void 0},this.close=()=>{var t;null===(t=this.requestClose)||void 0===t||t.emit()}}componentWillLoad(){this.init()}watchModalIsOpen(){!0===this.modalIsOpen&&(this.moveFocusOnModalOpen=!0)}watchFirstDayOfWeek(){this.updateWeekdays()}watchLocale(){Boolean(this.locale)||(this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US"),this.updateWeekdays()}watchRange(){var t;this.value=void 0,null===(t=this.selectDate)||void 0===t||t.emit(void 0)}watchStartDate(){this.currentDate=this.startDate?o(new Date(this.startDate)):new Date}watchValue(){Boolean(this.value)&&(Array.isArray(this.value)&&this.value.length>=1?this.currentDate=this.value[0]:this.value instanceof Date&&(this.currentDate=this.value))}componentDidRender(){this.moveFocusAfterMonthChanged&&(this.focusDate(this.currentDate),this.moveFocusAfterMonthChanged=!1),this.moveFocusOnModalOpen&&setTimeout((()=>{this.focusDate(this.currentDate),this.moveFocusOnModalOpen=!1}),100)}updateWeekdays(){this.weekdays=m(this.firstDayOfWeek,this.locale)}getClassName(t){return Boolean(t)?`${this.elementClassName}__${t}`:this.elementClassName}getCalendarRows(){const t=w(this.currentDate,!0,0===this.firstDayOfWeek?7:this.firstDayOfWeek),e=[];for(let i=0;i<t.length;i+=7){const n=t.slice(i,i+7);e.push(n)}const i=e[e.length-1];let n=null==i?void 0:i[i.length-1];for(;e.length<6&&n;){const t=[];for(let e=0;e<7;e+=1)n=b(n,1),t.push(n);e.push(t)}return e}getTitle(){if(Boolean(this.currentDate))return Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(this.currentDate)}focusDate(t){var e;t&&(null===(e=this.el.querySelector(`[data-date="${a(t)}"]`))||void 0===e||e.focus())}updateCurrentDate(t,e,i=!1){var n,s,a;const o=t.getMonth(),r=t.getFullYear();g(t,this.minDate)||(t=new Date(this.minDate)),k(t,this.maxDate)||(t=new Date(this.maxDate)),(o!==(null===(n=this.currentDate)||void 0===n?void 0:n.getMonth())||r!==this.currentDate.getFullYear())&&(null===(s=this.changeMonth)||void 0===s||s.emit({month:O(t),year:x(t)}),e&&(this.moveFocusAfterMonthChanged=!0)),this.currentDate=t,e&&this.focusDate(this.currentDate),i&&(null===(a=this.changeYear)||void 0===a||a.emit({year:x(t)}))}onSelectDate(t){var e,i,n,s;if(!this.disableDate(t)&&u(t,this.minDate,this.maxDate))if(this.isRangeValue(this.value)){const n=void 0===(null===(e=this.value)||void 0===e?void 0:e[0])||2===this.value.length?[t]:[this.value[0],t];2===n.length&&n[0]>n[1]&&n.reverse();const s=void 0===n[1]?[a(n[0])]:[a(n[0]),a(n[1])];this.value=n,null===(i=this.selectDate)||void 0===i||i.emit(s)}else{if((null===(n=this.value)||void 0===n?void 0:n.getTime())===t.getTime())return;this.value=t,null===(s=this.selectDate)||void 0===s||s.emit(a(t))}}isRangeValue(t){return!!this.range}render(){var t;const e=this.showTodayButton||this.showClearButton||this.showCloseButton||this.showKeyboardHint,s={year:{prev:this.disabled||!!this.minDate&&new Date(this.minDate).getFullYear()>d(this.currentDate).getFullYear(),next:this.disabled||!!this.maxDate&&new Date(this.maxDate).getFullYear()<h(this.currentDate).getFullYear()},month:{prev:this.disabled||M(c(this.currentDate).getMonth(),c(this.currentDate).getFullYear(),this.minDate,this.maxDate),next:this.disabled||M(r(this.currentDate).getMonth(),r(this.currentDate).getFullYear(),this.minDate,this.maxDate)}};return i(n,{key:"1bda8d7a489d87cf27ecbcd978accf5363f32804"},i("div",{key:"7118660fbbdfac4a73a1ace99d96d4ac32a4b137",class:{[`${this.getClassName()}-wrapper`]:!0,[`${this.getClassName()}-wrapper--inline`]:this.inline}},i("div",{key:"41b62826cdff428aef8ad89844a50873f8853b5e",class:{[this.getClassName()]:!0,[`${this.getClassName()}--disabled`]:this.disabled}},i("div",{key:"7a9ee67778c6f48e65d88defc1ff620e995d75bc",class:this.getClassName("header")},this.showHiddenTitle&&i("span",{key:"404e50ab0f24235d6678af7c12f6b3cdd491e347","aria-atomic":"true","aria-live":"polite",class:"visually-hidden"},this.getTitle()),this.showYearStepper&&i("button",{key:"88552edc01ae9c4a7d8225c2aab078d2123bf9f6","aria-label":this.labels.previousYearButton,class:this.getClassName("previous-year-button"),"aria-disabled":s.year.prev,innerHTML:this.previousYearButtonContent||void 0,onClick:this.previousYear,type:"button"},i("svg",{key:"5daef016748f562ddf3866557774c87016887fc6",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"5b73b6ec2b5abcae4d2e5cd833b5de441938e533",points:"11 17 6 12 11 7"}),i("polyline",{key:"05e146e1c233c39403147e7af61948798db7c0f7",points:"18 17 13 12 18 7"}))),this.showMonthStepper&&i("button",{key:"6145f62f073563e9136ad454f4e9633e99b8d8a9","aria-label":this.labels.previousMonthButton,class:this.getClassName("previous-month-button"),"aria-disabled":s.month.prev,innerHTML:this.previousMonthButtonContent||void 0,onClick:this.previousMonth,type:"button"},i("svg",{key:"8ae9cc385a6fdbdd915a2717246752c7f2f17b01",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"9395192e65c1e550547220850b29a117569a79e2",points:"15 18 9 12 15 6"}))),i("span",{key:"3b282148e95b8b1facde4a2ab370c6088b72bccd",class:this.getClassName("current-month")},i("select",{key:"f782b9d803abd5eb1add6c869b3ac302a717780d","aria-label":this.labels.monthSelect,class:this.getClassName("month-select"),"aria-disabled":this.disabled,name:"month",onChange:this.onMonthSelect},j(this.locale).map(((t,e)=>i("option",{key:t,selected:this.currentDate.getMonth()===e,value:e+1,disabled:M(e,this.currentDate.getFullYear(),this.minDate,this.maxDate)},t)))),i("input",{key:"dcd8a96a130513d1cf34d900d6f8c09ce974ba15","aria-label":this.labels.yearSelect,class:this.getClassName("year-select"),"aria-disabled":this.disabled,max:this.maxDate?this.maxDate.slice(0,4):9999,min:this.minDate?this.minDate.slice(0,4):1,name:"year",onChange:this.onYearSelect,type:"number",value:this.currentDate.getFullYear()})),this.showMonthStepper&&i("button",{key:"7de261689d242a0116e85f3c5fda265f49eaaf13","aria-label":this.labels.nextMonthButton,class:this.getClassName("next-month-button"),"aria-disabled":s.month.next,innerHTML:this.nextMonthButtonContent||void 0,onClick:this.nextMonth,type:"button"},i("svg",{key:"2033c731d98fd53088857a92bdd35e5e977137d7",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"dc88e8e5e4f79d5ae0b62ea51f6ba52d5e26ce9f",points:"9 18 15 12 9 6"}))),this.showYearStepper&&i("button",{key:"e25bcd81e34e0e162954b2ab67876c148f50f5d4","aria-label":this.labels.nextYearButton,class:this.getClassName("next-year-button"),"aria-disabled":s.year.next,innerHTML:this.nextYearButtonContent||void 0,onClick:this.nextYear,type:"button"},i("svg",{key:"70df81cfd06bcb1e6571933b7a43a5071522159b",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"f8242866ca29743b19055d1ac53fcc8e84d68a35",points:"13 17 18 12 13 7"}),i("polyline",{key:"6bda80ff2eba82dac0d36e287976130e6b16113c",points:"6 17 11 12 6 7"})))),i("div",{key:"6d5b0085437827c1db975f12dc5fe5927c7ba62f",class:this.getClassName("body")},i("table",{key:"61975eac4e06c3a416fcb9503eef9c7a386a6b54",class:this.getClassName("calendar"),onKeyDown:this.onKeyDown,role:"grid","aria-label":this.getTitle()},i("thead",{key:"fd259bd5ba6e12ff39dad5a31133913d17fdf276",class:this.getClassName("calendar-header")},i("tr",{key:"410c84eabac58cf6139dd6c886b4803772abceb5",class:this.getClassName("weekday-row")},null===(t=this.weekdays)||void 0===t?void 0:t.map((t=>i("th",{role:"columnheader",abbr:t[1],class:this.getClassName("weekday"),key:t[0],scope:"col"},i("span",{"aria-hidden":"true"},t[0]),i("span",{class:"visually-hidden"},t[1])))))),i("tbody",{key:"330d3b922d474b42edf0764556d2f2643b5b639d"},this.getCalendarRows().map((t=>{const e=`row-${t[0].getMonth()}-${t[0].getDate()}`;return i("tr",{class:this.getClassName("calendar-row"),key:e},t.map((t=>{var e,n,s;const o=D(t,this.currentDate),r=t.getMonth()!==(null===(e=this.currentDate)||void 0===e?void 0:e.getMonth()),h=Array.isArray(this.value)?D(t,this.value[0])||this.value[1]&&u(t,a(this.value[0]),a(this.value[1])):D(t,this.value),c=this.disableDate(t)||!u(t,this.minDate,this.maxDate),d=!!this.isRangeValue(this.value)&&A(t,{from:null===(n=this.value)||void 0===n?void 0:n[0],to:(null===(s=this.value)||void 0===s?void 0:s[1])||this.hoveredDate||this.currentDate})&&!c,l=D(t,new Date),f=`cell-${t.getMonth()}-${t.getDate()}`,v={[this.getClassName("date")]:!0,[this.getClassName("date--current")]:o,[this.getClassName("date--disabled")]:c,[this.getClassName("date--overflowing")]:r,[this.getClassName("date--today")]:l,[this.getClassName("date--selected")]:h,[this.getClassName("date--in-range")]:d},b=h?"strong":l?"em":"span";return i("td",{"aria-disabled":String(c),"aria-selected":h?"true":void 0,class:v,"data-date":a(t),key:f,onClick:this.onClick,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,role:"gridcell",tabIndex:D(t,this.currentDate)&&!this.disabled?0:-1},i(b,{"aria-hidden":"true"},t.getDate()),i("span",{class:"visually-hidden"},(()=>{if(this.range){let e=this.value?"":`, ${this.labels.chooseAsStartDate}.`;return Array.isArray(this.value)&&(e={1:`, ${this.labels.chooseAsEndDate}.`,2:`, ${this.labels.chooseAsStartDate}.`}[this.value.length]),`${h?`${this.labels.selected}, `:""}${Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long",year:"numeric"}).format(t)}${e}`}return`${h?`${this.labels.selected}, `:""}${Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long",year:"numeric"}).format(t)}`})()))})))}))))),e&&i("div",{key:"88362c2e1731e8813ad9c5da3b34f6afe16f2036",class:this.getClassName("footer")},i("div",{key:"e93a0b8fff1be09855ab87db159cb186b9339a39",class:this.getClassName("footer-buttons")},this.showTodayButton&&i("button",{key:"c1c9583c3d4cfdc70e0ca335e9dad603692050da","aria-label":this.todayButtonContent?this.labels.todayButton:void 0,class:this.getClassName("today-button"),disabled:this.disabled,innerHTML:this.todayButtonContent||void 0,onClick:this.showToday,type:"button"},!this.todayButtonContent&&this.labels.todayButton),this.showClearButton&&i("button",{key:"79a676ea7b12a62121367ce3226a321e0d6821a2","aria-label":this.clearButtonContent?this.labels.clearButton:void 0,class:this.getClassName("clear-button"),disabled:this.disabled,innerHTML:this.clearButtonContent||void 0,onClick:this.clear,type:"button"},!this.clearButtonContent&&this.labels.clearButton),this.showCloseButton&&i("button",{key:"51e4af6bb0ce2471491ef74b577c1f4404ae1b73","aria-label":this.closeButtonContent?this.labels.closeButton:void 0,class:this.getClassName("close-button"),disabled:this.disabled,innerHTML:this.closeButtonContent||void 0,onClick:this.close,type:"button"},!this.closeButtonContent&&this.labels.closeButton)),this.showKeyboardHint&&!window.matchMedia("(pointer: coarse)").matches&&i("button",{key:"89d2636eaca98ee89e38a1650db7f7a9c3ef0be5",type:"button",onClick:()=>alert("Todo: Add Keyboard helper!"),class:this.getClassName("keyboard-hint")},i("svg",{key:"0326ae480467bcb617827f29d84dffc4339f73dd",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",viewBox:"0 0 48 48",fill:"currentColor"},i("path",{key:"760d4c482eab6023fc43c69826ede1f5fbba145e",d:"M7 38q-1.2 0-2.1-.925Q4 36.15 4 35V13q0-1.2.9-2.1.9-.9 2.1-.9h34q1.2 0 2.1.9.9.9.9 2.1v22q0 1.15-.9 2.075Q42.2 38 41 38Zm0-3h34V13H7v22Zm8-3.25h18v-3H15Zm-4.85-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm-24.7-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3ZM7 35V13v22Z"})),this.labels.keyboardHint))),i("slot",{key:"5ac974fba92a2afb8b13eaa5a06f560ed707a93f",name:"after-calendar"})))}get el(){return s(this)}static get watchers(){return{modalIsOpen:[{watchModalIsOpen:0}],firstDayOfWeek:[{watchFirstDayOfWeek:0}],locale:[{watchLocale:0}],range:[{watchRange:0}],startDate:[{watchStartDate:0}],value:[{watchValue:0}]}}};function L(t,e,i,n=20,s=0){let a=[];if(s>=n)return a;const o=t=>{const a=t.assignedNodes().filter((t=>1===t.nodeType));return a.length>0?L(a[0].parentElement,e,i,n,s+1):[]},r=Array.from(t.children||[]);for(const t of r)e(t)||(i(t)&&a.push(t),null!=t.shadowRoot?a.push(...L(t.shadowRoot,e,i,n,s+1)):"SLOT"===t.tagName?a.push(...o(t)):a.push(...L(t,e,i,n,s+1)));return a}function B(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function E(t){return"-1"!==t.getAttribute("tabindex")&&!B(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}S.style=".visually-hidden.sc-tabworthy-dates-calendar{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%)}";const T=new Map,H=document.createElement("template");H.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class $ extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(H.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return L(this,B,E)}trapFocus(t){if(this.inactive)return;let e=this.getFocusableElements();e.length>0?(t?e[e.length-1].focus():e[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,e,i){const n=T.get(i);null!=n&&window.clearTimeout(n),T.set(i,window.setTimeout((()=>{t(),T.delete(i)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",$);var P=new WeakMap,W=new WeakMap,I={},q=0,Z=function(t){return t&&(t.host||Z(t.parentNode))},F=function(t,e,i){void 0===i&&(i="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),function(t,e,i,n){var s=function(t,e){return e.map((function(e){if(t.contains(e))return e;var i=Z(e);return i&&t.contains(i)?i:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(e,Array.isArray(t)?t:[t]);I[i]||(I[i]=new WeakMap);var a=I[i],o=[],r=new Set,h=new Set(s),c=function(t){t&&!r.has(t)&&(r.add(t),c(t.parentNode))};s.forEach(c);var d=function(t){t&&!h.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(r.has(t))d(t);else{var e=t.getAttribute(n),s=null!==e&&"false"!==e,h=(P.get(t)||0)+1,c=(a.get(t)||0)+1;P.set(t,h),a.set(t,c),o.push(t),1===h&&s&&W.set(t,!0),1===c&&t.setAttribute(i,"true"),s||t.setAttribute(n,"true")}}))};return d(e),r.clear(),q++,function(){o.forEach((function(t){var e=P.get(t)-1,s=a.get(t)-1;P.set(t,e),a.set(t,s),e||(W.has(t)||t.removeAttribute(n),W.delete(t)),s||t.removeAttribute(i)})),--q||(P=new WeakMap,P=new WeakMap,W=new WeakMap,I={})}}(n,s,i,"aria-hidden")):function(){return null}},R="top",V="bottom",_="right",U="left",z="auto",K=[R,V,_,U],N="start",Y="end",Q="viewport",G="popper",J=K.reduce((function(t,e){return t.concat([e+"-"+N,e+"-"+Y])}),[]),X=[].concat(K,[z]).reduce((function(t,e){return t.concat([e,e+"-"+N,e+"-"+Y])}),[]),tt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function et(t){return t?(t.nodeName||"").toLowerCase():null}function it(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function nt(t){return t instanceof it(t).Element||t instanceof Element}function st(t){return t instanceof it(t).HTMLElement||t instanceof HTMLElement}function at(t){return"undefined"!=typeof ShadowRoot&&(t instanceof it(t).ShadowRoot||t instanceof ShadowRoot)}function ot(t){return t.split("-")[0]}var rt=Math.max,ht=Math.min,ct=Math.round;function dt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function ut(){return!/^((?!chrome|android).)*safari/i.test(dt())}function lt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,a=1;e&&st(t)&&(s=t.offsetWidth>0&&ct(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&ct(n.height)/t.offsetHeight||1);var o=(nt(t)?it(t):window).visualViewport,r=!ut()&&i,h=(n.left+(r&&o?o.offsetLeft:0))/s,c=(n.top+(r&&o?o.offsetTop:0))/a,d=n.width/s,u=n.height/a;return{width:d,height:u,top:c,right:h+d,bottom:c+u,left:h,x:h,y:c}}function ft(t){var e=lt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function vt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&at(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function bt(t){return it(t).getComputedStyle(t)}function pt(t){return["table","td","th"].indexOf(et(t))>=0}function yt(t){return((nt(t)?t.ownerDocument:t.document)||window.document).documentElement}function mt(t){return"html"===et(t)?t:t.assignedSlot||t.parentNode||(at(t)?t.host:null)||yt(t)}function wt(t){return st(t)&&"fixed"!==bt(t).position?t.offsetParent:null}function gt(t){for(var e=it(t),i=wt(t);i&&pt(i)&&"static"===bt(i).position;)i=wt(i);return i&&("html"===et(i)||"body"===et(i)&&"static"===bt(i).position)?e:i||function(t){var e=/firefox/i.test(dt());if(/Trident/i.test(dt())&&st(t)&&"fixed"===bt(t).position)return null;var i=mt(t);for(at(i)&&(i=i.host);st(i)&&["html","body"].indexOf(et(i))<0;){var n=bt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function kt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xt(t,e,i){return rt(t,ht(e,i))}function Ot(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Mt(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}function jt(t){return t.split("-")[1]}var Dt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function At(t){var e,i=t.popper,n=t.popperRect,s=t.placement,a=t.variation,o=t.offsets,r=t.position,h=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,l=o.x,f=void 0===l?0:l,v=o.y,b=void 0===v?0:v,p="function"==typeof d?d({x:f,y:b}):{x:f,y:b};f=p.x,b=p.y;var y=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),w=U,g=R,k=window;if(c){var x=gt(i),O="clientHeight",M="clientWidth";x===it(i)&&"static"!==bt(x=yt(i)).position&&"absolute"===r&&(O="scrollHeight",M="scrollWidth"),(s===R||(s===U||s===_)&&a===Y)&&(g=V,b-=(u&&x===k&&k.visualViewport?k.visualViewport.height:x[O])-n.height,b*=h?1:-1),s!==U&&(s!==R&&s!==V||a!==Y)||(w=_,f-=(u&&x===k&&k.visualViewport?k.visualViewport.width:x[M])-n.width,f*=h?1:-1)}var j,D=Object.assign({position:r},c&&Dt),A=!0===d?function(t,e){var i=t.y,n=e.devicePixelRatio||1;return{x:ct(t.x*n)/n||0,y:ct(i*n)/n||0}}({x:f,y:b},it(i)):{x:f,y:b};return f=A.x,b=A.y,Object.assign({},D,h?((j={})[g]=m?"0":"",j[w]=y?"0":"",j.transform=(k.devicePixelRatio||1)<=1?"translate("+f+"px, "+b+"px)":"translate3d("+f+"px, "+b+"px, 0)",j):((e={})[g]=m?b+"px":"",e[w]=y?f+"px":"",e.transform="",e))}var Ct={passive:!0},St={left:"right",right:"left",bottom:"top",top:"bottom"};function Lt(t){return t.replace(/left|right|bottom|top/g,(function(t){return St[t]}))}var Bt={start:"end",end:"start"};function Et(t){return t.replace(/start|end/g,(function(t){return Bt[t]}))}function Tt(t){var e=it(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ht(t){return lt(yt(t)).left+Tt(t).scrollLeft}function $t(t){var e=bt(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Pt(t){return["html","body","#document"].indexOf(et(t))>=0?t.ownerDocument.body:st(t)&&$t(t)?t:Pt(mt(t))}function Wt(t,e){var i;void 0===e&&(e=[]);var n=Pt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),a=it(n),o=s?[a].concat(a.visualViewport||[],$t(n)?n:[]):n,r=e.concat(o);return s?r:r.concat(Wt(mt(o)))}function It(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function qt(t,e,i){return e===Q?It(function(t,e){var i=it(t),n=yt(t),s=i.visualViewport,a=n.clientWidth,o=n.clientHeight,r=0,h=0;if(s){a=s.width,o=s.height;var c=ut();(c||!c&&"fixed"===e)&&(r=s.offsetLeft,h=s.offsetTop)}return{width:a,height:o,x:r+Ht(t),y:h}}(t,i)):nt(e)?function(t,e){var i=lt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):It(function(t){var e,i=yt(t),n=Tt(t),s=null==(e=t.ownerDocument)?void 0:e.body,a=rt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=rt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),r=-n.scrollLeft+Ht(t),h=-n.scrollTop;return"rtl"===bt(s||i).direction&&(r+=rt(i.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:r,y:h}}(yt(t)))}function Zt(t){var e,i=t.reference,n=t.element,s=t.placement,a=s?ot(s):null,o=s?jt(s):null,r=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2;switch(a){case R:e={x:r,y:i.y-n.height};break;case V:e={x:r,y:i.y+i.height};break;case _:e={x:i.x+i.width,y:h};break;case U:e={x:i.x-n.width,y:h};break;default:e={x:i.x,y:i.y}}var c=a?kt(a):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case N:e[c]=e[c]-(i[d]/2-n[d]/2);break;case Y:e[c]=e[c]+(i[d]/2-n[d]/2)}}return e}function Ft(t,e){void 0===e&&(e={});var i=e.placement,n=void 0===i?t.placement:i,s=e.strategy,a=void 0===s?t.strategy:s,o=e.boundary,r=void 0===o?"clippingParents":o,h=e.rootBoundary,c=void 0===h?Q:h,d=e.elementContext,u=void 0===d?G:d,l=e.altBoundary,f=void 0!==l&&l,v=e.padding,b=void 0===v?0:v,p=Ot("number"!=typeof b?b:Mt(b,K)),y=t.rects.popper,m=t.elements[f?u===G?"reference":G:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Wt(mt(t)),i=["absolute","fixed"].indexOf(bt(t).position)>=0&&st(t)?gt(t):t;return nt(i)?e.filter((function(t){return nt(t)&&vt(t,i)&&"body"!==et(t)})):[]}(t):[].concat(e),a=[].concat(s,[i]),o=a.reduce((function(e,i){var s=qt(t,i,n);return e.top=rt(s.top,e.top),e.right=ht(s.right,e.right),e.bottom=ht(s.bottom,e.bottom),e.left=rt(s.left,e.left),e}),qt(t,a[0],n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(nt(m)?m:m.contextElement||yt(t.elements.popper),r,c,a),g=lt(t.elements.reference),k=Zt({reference:g,element:y,placement:n}),x=It(Object.assign({},y,k)),O=u===G?x:g,M={top:w.top-O.top+p.top,bottom:O.bottom-w.bottom+p.bottom,left:w.left-O.left+p.left,right:O.right-w.right+p.right},j=t.modifiersData.offset;if(u===G&&j){var D=j[n];Object.keys(M).forEach((function(t){var e=[_,V].indexOf(t)>=0?1:-1,i=[R,V].indexOf(t)>=0?"y":"x";M[t]+=D[i]*e}))}return M}function Rt(t,e){void 0===e&&(e={});var i=e.boundary,n=e.rootBoundary,s=e.padding,a=e.flipVariations,o=e.allowedAutoPlacements,r=void 0===o?X:o,h=jt(e.placement),c=h?a?J:J.filter((function(t){return jt(t)===h})):K,d=c.filter((function(t){return r.indexOf(t)>=0}));0===d.length&&(d=c);var u=d.reduce((function(e,a){return e[a]=Ft(t,{placement:a,boundary:i,rootBoundary:n,padding:s})[ot(a)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}var Vt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0===o||o,h=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,l=i.altBoundary,f=i.flipVariations,v=void 0===f||f,b=i.allowedAutoPlacements,p=e.options.placement,y=ot(p),m=h||(y!==p&&v?function(t){if(ot(t)===z)return[];var e=Lt(t);return[Et(t),e,Et(e)]}(p):[Lt(p)]),w=[p].concat(m).reduce((function(t,i){return t.concat(ot(i)===z?Rt(e,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:v,allowedAutoPlacements:b}):i)}),[]),g=e.rects.reference,k=e.rects.popper,x=new Map,O=!0,M=w[0],j=0;j<w.length;j++){var D=w[j],A=ot(D),C=jt(D)===N,S=[R,V].indexOf(A)>=0,L=S?"width":"height",B=Ft(e,{placement:D,boundary:d,rootBoundary:u,altBoundary:l,padding:c}),E=S?C?_:U:C?V:R;g[L]>k[L]&&(E=Lt(E));var T=Lt(E),H=[];if(a&&H.push(B[A]<=0),r&&H.push(B[E]<=0,B[T]<=0),H.every((function(t){return t}))){M=D,O=!1;break}x.set(D,H)}if(O)for(var $=function(t){var e=w.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return M=e,"break"},P=v?3:1;P>0&&"break"!==$(P);P--);e.placement!==M&&(e.modifiersData[n]._skip=!0,e.placement=M,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ut(t){return[R,_,V,U].some((function(e){return t[e]>=0}))}function zt(t,e,i){void 0===i&&(i=!1);var n,s,a=st(e),o=st(e)&&function(t){var e=t.getBoundingClientRect(),i=ct(e.width)/t.offsetWidth||1,n=ct(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),r=yt(e),h=lt(t,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(a||!a&&!i)&&(("body"!==et(e)||$t(r))&&(c=(n=e)!==it(n)&&st(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Tt(n)),st(e)?((d=lt(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):r&&(d.x=Ht(r))),{x:h.left+c.scrollLeft-d.x,y:h.top+c.scrollTop-d.y,width:h.width,height:h.height}}function Kt(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var Nt={placement:"bottom",modifiers:[],strategy:"absolute"};function Yt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Qt(t){void 0===t&&(t={});var e=t.defaultModifiers,i=void 0===e?[]:e,n=t.defaultOptions,s=void 0===n?Nt:n;return function(t,e,n){void 0===n&&(n=s);var a,o,r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Nt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},h=[],c=!1,d={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;u(),r.options=Object.assign({},s,r.options,a),r.scrollParents={reference:nt(t)?Wt(t):t.contextElement?Wt(t.contextElement):[],popper:Wt(e)};var o,c,l=function(t){var e=Kt(t);return tt.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}((o=[].concat(i,r.options.modifiers),c=o.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return r.orderedModifiers=l.filter((function(t){return t.enabled})),r.orderedModifiers.forEach((function(t){var e=t.options,i=t.effect;if("function"==typeof i){var n=i({state:r,name:t.name,instance:d,options:void 0===e?{}:e});h.push(n||function(){})}})),d.update()},forceUpdate:function(){if(!c){var t=r.elements,e=t.reference,i=t.popper;if(Yt(e,i)){r.rects={reference:zt(e,gt(i),"fixed"===r.options.strategy),popper:ft(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var s=r.orderedModifiers[n],a=s.fn,o=s.options;"function"==typeof a&&(r=a({state:r,options:void 0===o?{}:o,name:s.name,instance:d})||r)}else r.reset=!1,n=-1}}},update:(a=function(){return new Promise((function(t){d.forceUpdate(),t(r)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(a())}))}))),o}),destroy:function(){u(),c=!0}};if(!Yt(t,e))return d;function u(){h.forEach((function(t){return t()})),h=[]}return d.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),d}}var Gt=Qt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,a=void 0===s||s,o=n.resize,r=void 0===o||o,h=it(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach((function(t){t.addEventListener("scroll",i.update,Ct)})),r&&h.addEventListener("resize",i.update,Ct),function(){a&&c.forEach((function(t){t.removeEventListener("scroll",i.update,Ct)})),r&&h.removeEventListener("resize",i.update,Ct)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Zt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,a=i.adaptive,o=void 0===a||a,r=i.roundOffsets,h=void 0===r||r,c={placement:ot(e.placement),variation:jt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,At(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:h})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,At(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];st(s)&&et(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});st(n)&&et(n)&&(Object.assign(n.style,a),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.name,n=t.options.offset,s=void 0===n?[0,0]:n,a=X.reduce((function(t,i){return t[i]=function(t,e,i){var n=ot(t),s=[U,R].indexOf(n)>=0?-1:1,a="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=a[0],r=a[1];return o=o||0,r=(r||0)*s,[U,_].indexOf(n)>=0?{x:r,y:o}:{x:o,y:r}}(i,e.rects,s),t}),{}),o=a[e.placement],r=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=r),e.modifiersData[i]=a}},Vt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0!==o&&o,h=i.tether,c=void 0===h||h,d=i.tetherOffset,u=void 0===d?0:d,l=Ft(e,{boundary:i.boundary,rootBoundary:i.rootBoundary,padding:i.padding,altBoundary:i.altBoundary}),f=ot(e.placement),v=jt(e.placement),b=!v,p=kt(f),y="x"===p?"y":"x",m=e.modifiersData.popperOffsets,w=e.rects.reference,g=e.rects.popper,k="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,x="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(m){if(a){var j,D="y"===p?R:U,A="y"===p?V:_,C="y"===p?"height":"width",S=m[p],L=S+l[D],B=S-l[A],E=c?-g[C]/2:0,T=v===N?w[C]:g[C],H=v===N?-g[C]:-w[C],$=e.elements.arrow,P=c&&$?ft($):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},I=W[D],q=W[A],Z=xt(0,w[C],P[C]),F=b?w[C]/2-E-Z-I-x.mainAxis:T-Z-I-x.mainAxis,z=b?-w[C]/2+E+Z+q+x.mainAxis:H+Z+q+x.mainAxis,K=e.elements.arrow&>(e.elements.arrow),Y=null!=(j=null==O?void 0:O[p])?j:0,Q=S+z-Y,G=xt(c?ht(L,S+F-Y-(K?"y"===p?K.clientTop||0:K.clientLeft||0:0)):L,S,c?rt(B,Q):B);m[p]=G,M[p]=G-S}if(r){var J,X=m[y],tt="y"===y?"height":"width",et=X+l["x"===p?R:U],it=X-l["x"===p?V:_],nt=-1!==[R,U].indexOf(f),st=null!=(J=null==O?void 0:O[y])?J:0,at=nt?et:X-w[tt]-g[tt]-st+x.altAxis,ct=nt?X+w[tt]+g[tt]-st-x.altAxis:it,dt=c&&nt?function(t,e,i){var n=xt(t,e,i);return n>i?i:n}(at,X,ct):xt(c?at:et,X,c?ct:it);m[y]=dt,M[y]=dt-X}e.modifiersData[n]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,a=i.elements.arrow,o=i.modifiersData.popperOffsets,r=ot(i.placement),h=kt(r),c=[U,_].indexOf(r)>=0?"height":"width";if(a&&o){var d=function(t,e){return Ot("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Mt(t,K))}(s.padding,i),u=ft(a),l="y"===h?R:U,f="y"===h?V:_,v=i.rects.reference[c]+i.rects.reference[h]-o[h]-i.rects.popper[c],b=o[h]-i.rects.reference[h],p=gt(a),y=p?"y"===h?p.clientHeight||0:p.clientWidth||0:0,m=y/2-u[c]/2+(v/2-b/2),w=xt(d[l],m,y-u[c]-d[f]);i.modifiersData[n]=((e={})[h]=w,e.centerOffset=w-m,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&vt(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,a=e.modifiersData.preventOverflow,o=Ft(e,{elementContext:"reference"}),r=Ft(e,{altBoundary:!0}),h=_t(o,n),c=_t(r,s,a),d=Ut(h),u=Ut(c);e.modifiersData[i]={referenceClippingOffsets:h,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});const Jt=class{constructor(i){t(this,i),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,e=t?"viewport":"clippingParents";this.popperInstance=Gt(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:e}},{name:"preventOverflow",options:{boundary:e,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=F(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var e;if(this.showing){const i=t.target;this.hostElement.contains(i)||(null===(e=this.triggerElement)||void 0===e?void 0:e.contains(i))||this.originalParent&&this.originalParent.contains(i)||this.close()}}render(){return i(n,{key:"488fb845bb3a168c45f715b5f7315a80e1857589",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"d6263beffa3dbeaa7f0e5e65c1f2627c07164648",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},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},i("focus-trap",{key:"7ffb9cc684198ab9f3b127a4abe5f60f3241cd49"},i("div",{key:"c6c7c14220c01969f3a5c92dda882685f4c43268",part:"content"},i("slot",{key:"a1e6ce7ed152f61b3970e20b40e36bb13ee7580a"})))),this.inline&&i("div",{key:"632750cfce76139771642e03051f5c4a654db56a",part:"content"},i("slot",{key:"c1aa297a6ffdeee55840a9e05adddb7220e7f954"})))}get hostElement(){return s(this)}static get watchers(){return{showing:[{watchShowing:0}]}}};Jt.style=":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}";export{S as tabworthy_dates_calendar,Jt as tabworthy_dates_modal}
|