@tabworthy/components 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +21 -13
- package/dist/cjs/tabworthy-dates.cjs.entry.js +17 -9
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +8 -6
- package/dist/cjs/tabworthy-times.cjs.entry.js +10 -4
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +18 -12
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +20 -12
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +1 -1
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +14 -8
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +8 -6
- package/dist/components/tabworthy-dates-calendar2.js +1 -1
- package/dist/components/tabworthy-dates-modal2.js +1 -1
- package/dist/components/tabworthy-dates.js +1 -1
- package/dist/components/tabworthy-times-picker2.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 +21 -13
- package/dist/esm/tabworthy-dates.entry.js +17 -9
- package/dist/esm/tabworthy-times-picker.entry.js +8 -6
- package/dist/esm/tabworthy-times.entry.js +10 -4
- package/dist/shared/utils/chrono-parser/chrono-parser.js +3 -1
- package/dist/tabworthy-components/{p-46b71504.entry.js → p-1072baac.entry.js} +1 -1
- package/dist/tabworthy-components/{p-3ce9a767.entry.js → p-841f3e8f.entry.js} +1 -1
- package/dist/tabworthy-components/p-9aa97b54.entry.js +1 -0
- package/dist/tabworthy-components/{p-ebbb4c46.entry.js → p-cedac657.entry.js} +1 -1
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +2 -1
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +2 -1
- package/dist/types/components.d.ts +16 -12
- package/package.json +1 -1
- package/dist/tabworthy-components/p-28acdfa7.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as h,transformTag as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as h,transformTag as a}from"@stencil/core/internal/client";const n={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},o=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.timeChanged=s(this,"timeChanged",7),this.hours=12,this.minutes=0,this.use12HourFormat=!1,this.labels=n,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const e=parseInt(t.target.value,10);this.internalHours=this.use12HourFormat?"AM"===this.period?12===e?0:e:12===e?12:e+12:e,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.use12HourFormat)return;this.period=t;const e=this.getDisplayHours();this.internalHours="AM"===t?12===e?0:e:12===e?12:e+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.use12HourFormat){const t=this.getDisplayHours(),e=12===t?1:t+1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.use12HourFormat){const t=this.getDisplayHours(),e=1===t?12:t-1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()}}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM"}getDisplayHours(){return this.use12HourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.use12HourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,period:this.use12HourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),e=this.use12HourFormat?12:23,s=this.use12HourFormat?1:0;return i(h,{key:"22eb745a93c68e4e4f78c11d2941681897aa73ef",class:this.elementClassName,"aria-label":this.labels.timePicker},i("div",{key:"ccb05b5d5793442b63aa4c25d5120db8b60bedf3",class:`${this.elementClassName}__container`},i("div",{key:"3fc4ede2d685e43edcfefe8c88de19f705e94478",class:`${this.elementClassName}__field`},i("label",{key:"fb04e846fc9807155c4390e92722850cdaa4bba2",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),i("div",{key:"d5ed4a06ea4ce2eaaefda2fa316a4789aa4a210a",class:`${this.elementClassName}__control`},i("button",{key:"193c89e3b50934225c05f3241546bc3e7063b1b8",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},i("svg",{key:"f6cefeb18839bce2b644d92608f802bc001377b3",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"58519a5d7a8cddfe2273f5c8beec3eab7307b43c",points:"18 15 12 9 6 15"}))),i("input",{key:"187ace01f2d83ad59766159d6509e30100b7f812",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:s,max:e,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),i("button",{key:"3bbe5b73ac8a85c165f0332d3c70d30aede096e6",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},i("svg",{key:"fd7c431618e09d4326c95398f83f22ea2258695e",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"99aab5a584aed4d8fc1b30dcada0c76e42ba6ac7",points:"6 9 12 15 18 9"}))))),i("div",{key:"a8958b60136f6220bbd944beaa6cf73c7660e3fb",class:`${this.elementClassName}__separator`},":"),i("div",{key:"72b46b517876dc8bc3490afef1860514b46efc46",class:`${this.elementClassName}__field`},i("label",{key:"e09788653c3873e97e1922fcda3076878f9b1ca7",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),i("div",{key:"7bf9642b58249014b2ad802c3fe30f67e5354f4d",class:`${this.elementClassName}__control`},i("button",{key:"71c889d966bceb4aa9e7b6f78c57e968b207ddda",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},i("svg",{key:"3aad10f2b79e5e819277d4566ab7d336449162f9",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"68dfdfc6cd2bd1f8f916dbf60155eb2cc4a8328d",points:"18 15 12 9 6 15"}))),i("input",{key:"15eb767d9318c6d3e7aa0075bf9c3362adf75dd3",id:`${this.elementClassName}-minutes`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalMinutes),min:0,max:59,onInput:this.handleMinuteChange,disabled:this.disabled,"aria-label":this.labels.minutes}),i("button",{key:"5c808f40c040e8ff3e4632738f58e9941e69ec03",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},i("svg",{key:"bad9dba94e622c208cb26823963664ff77fc7799",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"92eb0d63e7be970b2207cc0c47964eef48005baf",points:"6 9 12 15 18 9"}))))),this.use12HourFormat&&i("div",{key:"8a3235abb0bf0764993271ff4969ca6aaac83bd7",class:`${this.elementClassName}__period`},i("button",{key:"d8f0679faadf7f0cf04e2f57bed4e9c202d0a056",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),i("button",{key:"393802044645d205a71ae593227df550adce2970",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return this}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}}},[2,"tabworthy-times-picker",{hours:[1026],minutes:[1026],use12HourFormat:[4,"use-1-2-hour-format"],labels:[16],labelsSrOnly:[4,"labels-sr-only"],disabled:[4],elementClassName:[1,"element-class-name"],internalHours:[32],internalMinutes:[32],period:[32]},void 0,{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}]);function c(){"undefined"!=typeof customElements&&["tabworthy-times-picker"].forEach((t=>{"tabworthy-times-picker"===t&&(customElements.get(a(t))||customElements.define(a(t),o))}))}export{o as I,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as a,transformTag as h}from"@stencil/core/internal/client";import{h as r}from"./moment.js";import{g as o,r as n,d}from"./tabworthy-dates-calendar2.js";import{d as l}from"./tabworthy-dates-modal2.js";import{d as c}from"./tabworthy-times-picker2.js";const b={selected:"selected",openCalendar:"Open date and time picker",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"},m=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=o(new Date),this.referenceDate=o(new Date),this.use12HourFormat=!0,this.timesLabels=b,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.selectedHours=12,this.selectedMinutes=0,this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{const s=t.split(",");if(this.range&&2===s.length){const t=n(new Date(s[0])),e=n(new Date(s[1]));this.updateValue([t,e]),this.pickerRef&&(this.pickerRef.value=[t,e])}else{const t=n(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,this.selectedDate&&this.updateValue(this.selectedDate)},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.calendarButtonRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as a,transformTag as h}from"@stencil/core/internal/client";import{h as r}from"./moment.js";import{g as o,r as n,d}from"./tabworthy-dates-calendar2.js";import{d as l}from"./tabworthy-dates-modal2.js";import{d as c}from"./tabworthy-times-picker2.js";const b={selected:"selected",openCalendar:"Open date and time picker",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"},m=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=o(new Date),this.referenceDate=o(new Date),this.use12HourFormat=!0,this.timesLabels=b,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.selectedHours=12,this.selectedMinutes=0,this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{const s=t.split(",");if(this.range&&2===s.length){const t=n(new Date(s[0])),e=n(new Date(s[1]));this.updateValue([t,e]),this.pickerRef&&(this.pickerRef.value=[t,e])}else{const t=n(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,this.selectedDate&&this.updateValue(this.selectedDate)},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.calendarButtonRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const s=r(t.target.value);s.isValid()&&(this.selectedHours=s.hours(),this.selectedMinutes=s.minutes(),this.updateValue(s.toDate()))}}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=r(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hours(),this.selectedMinutes=s.minutes())}}else this.internalValue=null}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>{const s=r(t);return s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0),s.format(this.format)}));this.internalValue=s,this.value=s,this.selectDateTime.emit(s)}else{const s=r(t);s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0);const e=s.format(this.format);this.internalValue=e,this.value=e,this.selectedDate=t,this.selectDateTime.emit(e)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>r(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=r(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef.value="",this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return i(a,{key:"4c2b4df711aef3ecab43e101650d8af27088813b",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"bd4a9fcbfb146dac1bf856cfc3f5b5e250714f9c",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),i("div",{key:"845800995b3d9b88f6f0a0d02486de2821fdaaef",class:this.getClassName("input-container")},i("input",{key:"bc8033523f88c72205d62068bda4199b666ef674",id:this.id+"-input",ref:t=>this.inputRef=t,type:"text",class:this.getClassName("input"),placeholder:this.placeholder,disabled:this.disabledState,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:"02d49c8b78edfbdd3cbbb6a738323d4de10ac46d",type:"button",ref:t=>this.calendarButtonRef=t,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:"6e03950ffd59ce6d7391e878479359d5d8ecf665",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},i("div",{key:"8e29281638aaa80d71220ad08dab482bf5a3c1e4",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"5e0129fe76d1de0b760201d462ce446132fc7003",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),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,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline},i("div",{key:"4d2da22f4da3460a9626c886b61e22eb66c0a23f",slot:"after-calendar",class:this.getClassName("time-section")},i("tabworthy-times-picker",{key:"2d9a9a8ce12e0659f4f1c82f1f8d64d829fc183b",hours:this.selectedHours,minutes:this.selectedMinutes,use12HourFormat:this.use12HourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange}))))),this.errorState&&i("div",{key:"df2cdfcd866f26108032c75a3f8c2f55ba5c9b10",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"],use12HourFormat:[4,"use-1-2-hour-format"],timesLabels:[16],datesCalendarLabels:[16],inline:[4],hasError:[1028,"has-error"],showYearStepper:[4,"show-year-stepper"],showMonthStepper:[4,"show-month-stepper"],showClearButton:[4,"show-clear-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"],internalValue:[32],selectedDate:[32],selectedHours:[32],selectedMinutes:[32],errorState:[32],disabledState:[32],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),u=m,f=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),m);break;case"tabworthy-dates-calendar":customElements.get(h(t))||d();break;case"tabworthy-dates-modal":customElements.get(h(t))||l();break;case"tabworthy-times-picker":customElements.get(h(t))||c()}}))};export{u as TabworthyTimes,f 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],"use12HourFormat":[4,"use-1-2-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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],"closing":[32],"showing":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64]},[[10,"click","handleClick"]]]]],["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"],"use12HourFormat":[4,"use-1-2-hour-format"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"use12HourFormat":[4,"use-1-2-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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],"closing":[32],"showing":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64]},[[10,"click","handleClick"]]]]],["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"],"use12HourFormat":[4,"use-1-2-hour-format"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[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],"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"],"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"],"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],"use12HourFormat":[4,"use-1-2-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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],"closing":[32],"showing":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64]},[[10,"click","handleClick"]]]]],["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"],"use12HourFormat":[4,"use-1-2-hour-format"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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":[
|
|
20
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"use12HourFormat":[4,"use-1-2-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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],"closing":[32],"showing":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64]},[[10,"click","handleClick"]]]]],["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"],"use12HourFormat":[4,"use-1-2-hour-format"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[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],"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"],"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"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -237,8 +237,9 @@ const InclusiveDatesCalendar = class {
|
|
|
237
237
|
}
|
|
238
238
|
focusDate(date) {
|
|
239
239
|
var _a;
|
|
240
|
-
date &&
|
|
241
|
-
|
|
240
|
+
date &&
|
|
241
|
+
((_a = this.el
|
|
242
|
+
.querySelector(`[data-date="${getISODateString(date)}"]`)) === null || _a === void 0 ? void 0 : _a.focus());
|
|
242
243
|
}
|
|
243
244
|
updateCurrentDate(date, moveFocus) {
|
|
244
245
|
var _a, _b;
|
|
@@ -296,8 +297,14 @@ const InclusiveDatesCalendar = class {
|
|
|
296
297
|
const showFooter = this.showTodayButton || this.showClearButton || this.showKeyboardHint;
|
|
297
298
|
const disabled = {
|
|
298
299
|
year: {
|
|
299
|
-
prev: this.disabled ||
|
|
300
|
-
|
|
300
|
+
prev: this.disabled ||
|
|
301
|
+
(!!this.minDate &&
|
|
302
|
+
new Date(this.minDate).getFullYear() >
|
|
303
|
+
getPreviousYear(this.currentDate).getFullYear()),
|
|
304
|
+
next: this.disabled ||
|
|
305
|
+
(!!this.maxDate &&
|
|
306
|
+
new Date(this.maxDate).getFullYear() <
|
|
307
|
+
getNextYear(this.currentDate).getFullYear())
|
|
301
308
|
},
|
|
302
309
|
month: {
|
|
303
310
|
prev: this.disabled ||
|
|
@@ -306,15 +313,15 @@ const InclusiveDatesCalendar = class {
|
|
|
306
313
|
monthIsDisabled(getNextMonth(this.currentDate).getMonth(), getNextMonth(this.currentDate).getFullYear(), this.minDate, this.maxDate)
|
|
307
314
|
}
|
|
308
315
|
};
|
|
309
|
-
return (h(Host, { key: '
|
|
316
|
+
return (h(Host, { key: '537927e765bb4b5e3b0fda109fca55278f16e980' }, h("div", { key: 'a46f37e038fb6d615785e2d7b871269ea9a6784d', class: {
|
|
310
317
|
[`${this.getClassName()}-wrapper`]: true,
|
|
311
318
|
[`${this.getClassName()}-wrapper--inline`]: this.inline
|
|
312
|
-
} }, h("div", { key: '
|
|
319
|
+
} }, h("div", { key: 'd45b18e90cabf14175eacf2b86ffc4ccb261e6e1', class: {
|
|
313
320
|
[this.getClassName()]: true,
|
|
314
|
-
[`${this.getClassName()}--disabled`]: this.disabled
|
|
315
|
-
} }, h("div", { key: '
|
|
321
|
+
[`${this.getClassName()}--disabled`]: this.disabled
|
|
322
|
+
} }, h("div", { key: '2ae05963eec49c2202d045d0b1076358ce7024c9', class: this.getClassName("header") }, this.showHiddenTitle && (h("span", { key: 'c0590d1799610f4f2bcc566f58ea4496c4a04ce2', "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle())), this.showYearStepper && (h("button", { key: '55facf0c12e4529de9f6154e7ed171a36c3f9374', "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: '28be8dd1f26ee0975ee715ac057ea67a4f8cf55e', 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: '22edd595edf1ce12ecfafc0c9e9074eb4b57a8f1', points: "11 17 6 12 11 7" }), h("polyline", { key: '1eddb5fb1d11e2bb51dde46a7e24835a3444552d', points: "18 17 13 12 18 7" })))), this.showMonthStepper && (h("button", { key: 'cd338dd018484e40fbc1526c54b4bef0007db39f', "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: '2c8b84702e3276f3d93acff76e87fdbb8453d0bd', 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: '7d6da26c8abf2193dd0596053dcf6eaf1d0022e0', points: "15 18 9 12 15 6" })))), h("span", { key: 'bb77047688ea6f766fb66700e1e824b21e835c21', class: this.getClassName("current-month") }, h("select", { key: '57ff448ad512c487382bcba5208eae221d712a14', "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) => {
|
|
316
323
|
return (h("option", { key: month, selected: this.currentDate.getMonth() === index, value: index + 1, disabled: monthIsDisabled(index, this.currentDate.getFullYear(), this.minDate, this.maxDate) }, month));
|
|
317
|
-
})), h("input", { key: '
|
|
324
|
+
})), h("input", { key: 'cb894dcf8007f4aa4e166b08602c35143b9c582d', "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: '7ac8e4ad643f4da536142cdca8104ecc4f5e739f', "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: 'ac31e4bb473fb0fb18d16c67b24601313d60104b', 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: 'c611342212d7ec1441f4d395b65fa1bee50f8701', points: "9 18 15 12 9 6" })))), this.showYearStepper && (h("button", { key: '0123d1421e2af85b7cfaa524d3df545493112856', "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: '38a75dcba7d4aa040da52d3a9c10792e0f48eeea', 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: 'da2a0780d240ccf266aacc538f1e90db5b758c34', points: "13 17 18 12 13 7" }), h("polyline", { key: '5299b9a1211e860300c62d32338ce49d129d3cce', points: "6 17 11 12 6 7" }))))), h("div", { key: '6c3aa5ab44b987b12425f3e205c62706b52b957a', class: this.getClassName("body") }, h("table", { key: 'ff27e4773d83c96657c99314bebed5786ccde4c6', class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid", "aria-label": this.getTitle() }, h("thead", { key: '8a20159ac1fc8e86273ef9b4652514df1eedf049', class: this.getClassName("calendar-header") }, h("tr", { key: 'd8e330c6149c3e49e387ac2084f985e14aad5e2e', 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: '659aa92ae94aa8904289be27821be2ec1b1e469c' }, this.getCalendarRows().map((calendarRow) => {
|
|
318
325
|
const rowKey = `row-${calendarRow[0].getMonth()}-${calendarRow[0].getDate()}`;
|
|
319
326
|
return (h("tr", { class: this.getClassName("calendar-row"), key: rowKey }, calendarRow.map((day) => {
|
|
320
327
|
var _a, _b, _c;
|
|
@@ -376,12 +383,13 @@ const InclusiveDatesCalendar = class {
|
|
|
376
383
|
: isToday
|
|
377
384
|
? "em"
|
|
378
385
|
: "span";
|
|
379
|
-
return (h("td", { "aria-disabled": String(isDisabled), "aria-selected": isSelected ? "true" : undefined, class: className, "data-date": getISODateString(day), key: cellKey, onClick: this.onClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "gridcell", tabIndex: isSameDay(day, this.currentDate) &&
|
|
386
|
+
return (h("td", { "aria-disabled": String(isDisabled), "aria-selected": isSelected ? "true" : undefined, class: className, "data-date": getISODateString(day), key: cellKey, onClick: this.onClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "gridcell", tabIndex: isSameDay(day, this.currentDate) &&
|
|
387
|
+
!this.disabled
|
|
380
388
|
? 0
|
|
381
389
|
: -1 }, h(Tag, { "aria-hidden": "true" }, day.getDate()), h("span", { class: "visually-hidden" }, getScreenReaderText())));
|
|
382
390
|
})));
|
|
383
|
-
})))), showFooter && (h("div", { key: '
|
|
384
|
-
!window.matchMedia("(pointer: coarse)").matches && (h("button", { key: '
|
|
391
|
+
})))), showFooter && (h("div", { key: '142e1eb18019ede50c8e7da056ff365a10478849', class: this.getClassName("footer") }, h("div", { key: '2d6b06ed8a2fddadb107521730c71b97ce0c0a05', class: this.getClassName("footer-buttons") }, this.showTodayButton && (h("button", { key: '516d186b77c0d9229b6d96cfa6f07067fbd83d15', class: this.getClassName("today-button"), disabled: this.disabled, innerHTML: this.todayButtonContent || undefined, onClick: this.showToday, type: "button" }, this.labels.todayButton)), this.showClearButton && (h("button", { key: '30a0c6b46efe755b96fef443e6f52de8e558e43a', class: this.getClassName("clear-button"), disabled: this.disabled, innerHTML: this.clearButtonContent || undefined, onClick: this.clear, type: "button" }, this.labels.clearButton))), this.showKeyboardHint &&
|
|
392
|
+
!window.matchMedia("(pointer: coarse)").matches && (h("button", { key: 'f0a1d1a382ca37b3810888aa1244a090f9b94e93', type: "button", onClick: () => alert("Todo: Add Keyboard helper!"), class: this.getClassName("keyboard-hint") }, h("svg", { key: 'fa193bf2bafc73e3db2720e87fecbc25ab6b5a7c', xmlns: "http://www.w3.org/2000/svg", height: "1em", width: "1em", viewBox: "0 0 48 48", fill: "currentColor" }, h("path", { key: 'a3fba5ad5c0e5faf74b49d81bc57ee3e98596df5', 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: '11c329aa5161b2720b1e9246fa1f2883f92c6783', name: "after-calendar" }))));
|
|
385
393
|
}
|
|
386
394
|
get el() { return getElement(this); }
|
|
387
395
|
static get watchers() { return {
|
|
@@ -873,7 +881,7 @@ const InclusiveDatesModal = class {
|
|
|
873
881
|
}
|
|
874
882
|
}
|
|
875
883
|
render() {
|
|
876
|
-
return (h(Host, { key: '
|
|
884
|
+
return (h(Host, { key: '773d9edf7cf6598394c1210a1fab91af0bcb951e', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (h("div", { key: 'c456932007f7ea9a9c3727d9d08fd8fbea5b8670', part: "body", onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: 'c1355fe48117067d62ede321afd1f90bf9bf4c22' }, h("div", { key: 'fbd3ec5e0e7069574f1dbd6c38b40e409b837045', part: "content" }, h("slot", { key: 'bad04015cc3945efbb68a52de623ee1f4b584868' }))))), this.inline && (h("div", { key: 'b0577b12dd1bec091de967ccd0ac297451576ad8', part: "content" }, h("slot", { key: '5457a9bd5d08feac90adb2ee061d60fb5fb94657' })))));
|
|
877
885
|
}
|
|
878
886
|
};
|
|
879
887
|
InclusiveDatesModal.style = tabworthyDatesModalCss();
|
|
@@ -10447,7 +10447,9 @@ const chronoParseRange = async (dateString, options) => {
|
|
|
10447
10447
|
parsedRange[0].end &&
|
|
10448
10448
|
parsedRange[0].end.date() instanceof Date)
|
|
10449
10449
|
endDate = parsedRange[0].end.date();
|
|
10450
|
-
const returnValue = {
|
|
10450
|
+
const returnValue = {
|
|
10451
|
+
value: { start: null, end: null }
|
|
10452
|
+
};
|
|
10451
10453
|
// TODO: fix this
|
|
10452
10454
|
// @ts-ignore
|
|
10453
10455
|
if (startDate instanceof Date || endDate instanceof Date) {
|
|
@@ -10521,7 +10523,7 @@ const TabworthyDates = class {
|
|
|
10521
10523
|
// Show or hide the today button
|
|
10522
10524
|
this.showTodayButton = true;
|
|
10523
10525
|
// Enable or disable input field formatting for accepted dates (eg. "Tuesday May 2, 2021" instead of "2021-05-02")
|
|
10524
|
-
this.
|
|
10526
|
+
this.inputShouldFormat = true;
|
|
10525
10527
|
// Show or hide the keyboard hints
|
|
10526
10528
|
this.showKeyboardHint = false;
|
|
10527
10529
|
// Function to disable individual dates
|
|
@@ -10693,6 +10695,12 @@ const TabworthyDates = class {
|
|
|
10693
10695
|
}
|
|
10694
10696
|
};
|
|
10695
10697
|
}
|
|
10698
|
+
shouldInputFormat() {
|
|
10699
|
+
if (typeof this.inputShouldFormat === "string") {
|
|
10700
|
+
return this.inputShouldFormat === "true";
|
|
10701
|
+
}
|
|
10702
|
+
return !!this.inputShouldFormat;
|
|
10703
|
+
}
|
|
10696
10704
|
componentDidLoad() {
|
|
10697
10705
|
this.syncFromValueProp();
|
|
10698
10706
|
this.componentReady.emit();
|
|
@@ -10743,7 +10751,7 @@ const TabworthyDates = class {
|
|
|
10743
10751
|
this.announceDateChange(this.internalValue);
|
|
10744
10752
|
}
|
|
10745
10753
|
formatInput(enabled, useInputValue = true) {
|
|
10746
|
-
if (this.
|
|
10754
|
+
if (this.shouldInputFormat() === false || enabled === false) {
|
|
10747
10755
|
if (this.internalValue) {
|
|
10748
10756
|
if (this.internalValue.length === 0)
|
|
10749
10757
|
return;
|
|
@@ -10754,7 +10762,7 @@ const TabworthyDates = class {
|
|
|
10754
10762
|
return;
|
|
10755
10763
|
}
|
|
10756
10764
|
if (this.internalValue &&
|
|
10757
|
-
this.
|
|
10765
|
+
this.shouldInputFormat() === true &&
|
|
10758
10766
|
this.errorState === false) {
|
|
10759
10767
|
if (Array.isArray(this.internalValue)) {
|
|
10760
10768
|
if (this.internalValue.length === 0)
|
|
@@ -10879,12 +10887,12 @@ const TabworthyDates = class {
|
|
|
10879
10887
|
}
|
|
10880
10888
|
// update text input (useInputValue=false so it formats from internalValue, not from input's current text)
|
|
10881
10889
|
if (this.inputRef) {
|
|
10882
|
-
this.formatInput(!!this.
|
|
10890
|
+
this.formatInput(!!this.shouldInputFormat(), false);
|
|
10883
10891
|
}
|
|
10884
10892
|
}
|
|
10885
10893
|
render() {
|
|
10886
10894
|
var _a;
|
|
10887
|
-
return (h(Host, { key: '
|
|
10895
|
+
return (h(Host, { key: 'af18409cc70d00e832941ec2cb0ba6e8de54b4bc' }, h("label", { key: '776ac232cd674198f307511edacfc25ee7ea073b', htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", { key: '012a806feffe904a5e492c79822575b10e02c47c' }), h("div", { key: '194798eb7f62c065f757dfdb4a4f4087a6321d33', class: this.getClassName("input-container") }, h("input", { key: '89fb2f8b6e669c126ca1b905f054af360880010f', disabled: this.disabledState, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: this.getClassName("input"), 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", { key: 'fd20cc4fa19942211058ec32df5c40ab1076f3e4', type: "button", ref: (r) => (this.calendarButtonRef = r), onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.datesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: 'ed649175c4b0b9f2fd84fc9ca90657a8fa202dd8', label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
10888
10896
|
if (!this.pickerRef)
|
|
10889
10897
|
return;
|
|
10890
10898
|
this.pickerRef.modalIsOpen = true;
|
|
@@ -10892,11 +10900,11 @@ const TabworthyDates = class {
|
|
|
10892
10900
|
if (!this.pickerRef)
|
|
10893
10901
|
return;
|
|
10894
10902
|
this.pickerRef.modalIsOpen = false;
|
|
10895
|
-
}, inline: this.inline }, h("tabworthy-dates-calendar", { key: '
|
|
10903
|
+
}, inline: this.inline }, h("tabworthy-dates-calendar", { key: '7f77e44188b8521ad0f8c7a5c4cd91ac8f72d58c', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), 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, showKeyboardHint: this.showKeyboardHint, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline })), this.showQuickButtons &&
|
|
10896
10904
|
((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
10897
|
-
this.chronoSupportedLocale && (h("div", { key: '
|
|
10905
|
+
this.chronoSupportedLocale && (h("div", { key: '9ac2426141cfcebc38db079a90b99fe46cb76267', class: this.getClassName("quick-group"), role: "group", "aria-label": "Quick selection" }, this.quickButtons.map((buttonText) => {
|
|
10898
10906
|
return (h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
|
|
10899
|
-
}))), this.errorState && (h("div", { key: '
|
|
10907
|
+
}))), this.errorState && (h("div", { key: 'e9043f07596f0dea2092593bb2a3966e33a04a78', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
10900
10908
|
}
|
|
10901
10909
|
get el() { return getElement(this); }
|
|
10902
10910
|
static get watchers() { return {
|
|
@@ -90,7 +90,8 @@ const InclusiveTimesPicker = class {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
|
-
this.internalHours =
|
|
93
|
+
this.internalHours =
|
|
94
|
+
this.internalHours === 0 ? 23 : this.internalHours - 1;
|
|
94
95
|
}
|
|
95
96
|
this.emitTimeChange();
|
|
96
97
|
};
|
|
@@ -99,7 +100,8 @@ const InclusiveTimesPicker = class {
|
|
|
99
100
|
this.emitTimeChange();
|
|
100
101
|
};
|
|
101
102
|
this.handleMinuteDecrement = () => {
|
|
102
|
-
this.internalMinutes =
|
|
103
|
+
this.internalMinutes =
|
|
104
|
+
this.internalMinutes === 0 ? 59 : this.internalMinutes - 1;
|
|
103
105
|
this.emitTimeChange();
|
|
104
106
|
};
|
|
105
107
|
}
|
|
@@ -151,16 +153,16 @@ const InclusiveTimesPicker = class {
|
|
|
151
153
|
const displayHours = this.getDisplayHours();
|
|
152
154
|
const maxHours = this.use12HourFormat ? 12 : 23;
|
|
153
155
|
const minHours = this.use12HourFormat ? 1 : 0;
|
|
154
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '22eb745a93c68e4e4f78c11d2941681897aa73ef', class: this.elementClassName, "aria-label": this.labels.timePicker }, h("div", { key: 'ccb05b5d5793442b63aa4c25d5120db8b60bedf3', class: `${this.elementClassName}__container` }, h("div", { key: '3fc4ede2d685e43edcfefe8c88de19f705e94478', class: `${this.elementClassName}__field` }, h("label", { key: 'fb04e846fc9807155c4390e92722850cdaa4bba2', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
155
157
|
[`${this.elementClassName}__label`]: true,
|
|
156
158
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
157
|
-
} }, this.labels.hours), h("div", { key: '
|
|
159
|
+
} }, this.labels.hours), h("div", { key: 'd5ed4a06ea4ce2eaaefda2fa316a4789aa4a210a', class: `${this.elementClassName}__control` }, h("button", { key: '193c89e3b50934225c05f3241546bc3e7063b1b8', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, h("svg", { key: 'f6cefeb18839bce2b644d92608f802bc001377b3', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '58519a5d7a8cddfe2273f5c8beec3eab7307b43c', points: "18 15 12 9 6 15" }))), h("input", { key: '187ace01f2d83ad59766159d6509e30100b7f812', id: `${this.elementClassName}-hours`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(displayHours), min: minHours, max: maxHours, onInput: this.handleHourChange, disabled: this.disabled, "aria-label": this.labels.hours }), h("button", { key: '3bbe5b73ac8a85c165f0332d3c70d30aede096e6', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, h("svg", { key: 'fd7c431618e09d4326c95398f83f22ea2258695e', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '99aab5a584aed4d8fc1b30dcada0c76e42ba6ac7', points: "6 9 12 15 18 9" }))))), h("div", { key: 'a8958b60136f6220bbd944beaa6cf73c7660e3fb', class: `${this.elementClassName}__separator` }, ":"), h("div", { key: '72b46b517876dc8bc3490afef1860514b46efc46', class: `${this.elementClassName}__field` }, h("label", { key: 'e09788653c3873e97e1922fcda3076878f9b1ca7', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
158
160
|
[`${this.elementClassName}__label`]: true,
|
|
159
161
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
160
|
-
} }, this.labels.minutes), h("div", { key: '
|
|
162
|
+
} }, this.labels.minutes), h("div", { key: '7bf9642b58249014b2ad802c3fe30f67e5354f4d', class: `${this.elementClassName}__control` }, h("button", { key: '71c889d966bceb4aa9e7b6f78c57e968b207ddda', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, h("svg", { key: '3aad10f2b79e5e819277d4566ab7d336449162f9', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '68dfdfc6cd2bd1f8f916dbf60155eb2cc4a8328d', points: "18 15 12 9 6 15" }))), h("input", { key: '15eb767d9318c6d3e7aa0075bf9c3362adf75dd3', id: `${this.elementClassName}-minutes`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(this.internalMinutes), min: 0, max: 59, onInput: this.handleMinuteChange, disabled: this.disabled, "aria-label": this.labels.minutes }), h("button", { key: '5c808f40c040e8ff3e4632738f58e9941e69ec03', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, h("svg", { key: 'bad9dba94e622c208cb26823963664ff77fc7799', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '92eb0d63e7be970b2207cc0c47964eef48005baf', points: "6 9 12 15 18 9" }))))), this.use12HourFormat && (h("div", { key: '8a3235abb0bf0764993271ff4969ca6aaac83bd7', class: `${this.elementClassName}__period` }, h("button", { key: 'd8f0679faadf7f0cf04e2f57bed4e9c202d0a056', type: "button", class: {
|
|
161
163
|
[`${this.elementClassName}__period-button`]: true,
|
|
162
164
|
[`${this.elementClassName}__period-button--active`]: this.period === "AM"
|
|
163
|
-
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '
|
|
165
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '393802044645d205a71ae593227df550adce2970', type: "button", class: {
|
|
164
166
|
[`${this.elementClassName}__period-button`]: true,
|
|
165
167
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
166
168
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|
|
@@ -109,7 +109,7 @@ const InclusiveTimes = class {
|
|
|
109
109
|
// Can be used for month change tracking
|
|
110
110
|
};
|
|
111
111
|
this.handleInputBlur = () => {
|
|
112
|
-
if (this.
|
|
112
|
+
if (this.shouldInputFormat()) {
|
|
113
113
|
this.formatInput();
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -124,6 +124,12 @@ const InclusiveTimes = class {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
+
shouldInputFormat() {
|
|
128
|
+
if (typeof this.inputShouldFormat === "string") {
|
|
129
|
+
return this.inputShouldFormat === "true";
|
|
130
|
+
}
|
|
131
|
+
return !!this.inputShouldFormat;
|
|
132
|
+
}
|
|
127
133
|
watchValue(_newValue) {
|
|
128
134
|
this.syncFromValueProp();
|
|
129
135
|
}
|
|
@@ -185,7 +191,7 @@ const InclusiveTimes = class {
|
|
|
185
191
|
this.selectDateTime.emit(formatted);
|
|
186
192
|
}
|
|
187
193
|
this.errorState = false;
|
|
188
|
-
if (this.
|
|
194
|
+
if (this.shouldInputFormat()) {
|
|
189
195
|
this.formatInput();
|
|
190
196
|
}
|
|
191
197
|
}
|
|
@@ -219,7 +225,7 @@ const InclusiveTimes = class {
|
|
|
219
225
|
}
|
|
220
226
|
render() {
|
|
221
227
|
var _a;
|
|
222
|
-
return (h(Host, { key: '
|
|
228
|
+
return (h(Host, { key: '4c2b4df711aef3ecab43e101650d8af27088813b', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: 'bd4a9fcbfb146dac1bf856cfc3f5b5e250714f9c', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '845800995b3d9b88f6f0a0d02486de2821fdaaef', class: this.getClassName("input-container") }, h("input", { key: 'bc8033523f88c72205d62068bda4199b666ef674', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: this.getClassName("input"), placeholder: this.placeholder, disabled: this.disabledState, 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: '02d49c8b78edfbdd3cbbb6a738323d4de10ac46d', type: "button", ref: (r) => (this.calendarButtonRef = r), onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: '6e03950ffd59ce6d7391e878479359d5d8ecf665', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
223
229
|
if (this.pickerRef) {
|
|
224
230
|
this.pickerRef.modalIsOpen = true;
|
|
225
231
|
}
|
|
@@ -227,7 +233,7 @@ const InclusiveTimes = class {
|
|
|
227
233
|
if (this.pickerRef) {
|
|
228
234
|
this.pickerRef.modalIsOpen = false;
|
|
229
235
|
}
|
|
230
|
-
}, inline: this.inline }, h("div", { key: '
|
|
236
|
+
}, inline: this.inline }, h("div", { key: '8e29281638aaa80d71220ad08dab482bf5a3c1e4', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '5e0129fe76d1de0b760201d462ce446132fc7003', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), 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, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline }, h("div", { key: '4d2da22f4da3460a9626c886b61e22eb66c0a23f', slot: "after-calendar", class: this.getClassName("time-section") }, h("tabworthy-times-picker", { key: '2d9a9a8ce12e0659f4f1c82f1f8d64d829fc183b', hours: this.selectedHours, minutes: this.selectedMinutes, use12HourFormat: this.use12HourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange }))))), this.errorState && (h("div", { key: 'df2cdfcd866f26108032c75a3f8c2f55ba5c9b10', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
231
237
|
}
|
|
232
238
|
get el() { return getElement(this); }
|
|
233
239
|
static get watchers() { return {
|
|
@@ -126,7 +126,9 @@ export const chronoParseRange = async (dateString, options) => {
|
|
|
126
126
|
parsedRange[0].end &&
|
|
127
127
|
parsedRange[0].end.date() instanceof Date)
|
|
128
128
|
endDate = parsedRange[0].end.date();
|
|
129
|
-
const returnValue = {
|
|
129
|
+
const returnValue = {
|
|
130
|
+
value: { start: null, end: null }
|
|
131
|
+
};
|
|
130
132
|
// TODO: fix this
|
|
131
133
|
// @ts-ignore
|
|
132
134
|
if (startDate instanceof Date || endDate instanceof Date) {
|