@tabworthy/components 0.8.6 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/{index-w-Wtojyv.js → index-B1s0tI-Z.js} +21 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tabworthy-components.cjs.js +2 -2
  4. package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +1960 -8
  5. package/dist/cjs/tabworthy-dates.cjs.entry.js +9 -8
  6. package/dist/cjs/tabworthy-times-picker.cjs.entry.js +1 -1
  7. package/dist/cjs/tabworthy-times.cjs.entry.js +6 -5
  8. package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +32 -7
  9. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.css +4 -1
  10. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +257 -5
  11. package/dist/collection/components/tabworthy-times/tabworthy-times.js +29 -4
  12. package/dist/components/index.js +1 -1
  13. package/dist/components/{p-DT8TK_a8.js → p-B8sG1vGD.js} +1 -1
  14. package/dist/components/{p-Bnmroodq.js → p-B9YA6avR.js} +1 -1
  15. package/dist/components/p-B9fGfjA-.js +1 -0
  16. package/dist/components/p-BiJ0HZVY.js +1 -0
  17. package/dist/components/tabworthy-dates-calendar.js +1 -1
  18. package/dist/components/tabworthy-dates-modal.js +1 -1
  19. package/dist/components/tabworthy-dates.js +1 -1
  20. package/dist/components/tabworthy-times-picker.js +1 -1
  21. package/dist/components/tabworthy-times.js +1 -1
  22. package/dist/esm/{index-CDFauf_3.js → index-CwtZ_Lud.js} +21 -0
  23. package/dist/esm/loader.js +3 -3
  24. package/dist/esm/tabworthy-components.js +3 -3
  25. package/dist/esm/tabworthy-dates-calendar_2.entry.js +1960 -8
  26. package/dist/esm/tabworthy-dates.entry.js +9 -8
  27. package/dist/esm/tabworthy-times-picker.entry.js +1 -1
  28. package/dist/esm/tabworthy-times.entry.js +6 -5
  29. package/dist/tabworthy-components/{p-8416e0a9.entry.js → p-4eec41e5.entry.js} +1 -1
  30. package/dist/tabworthy-components/{p-dcb3ea8d.entry.js → p-90de04dd.entry.js} +1 -1
  31. package/dist/tabworthy-components/p-CwtZ_Lud.js +2 -0
  32. package/dist/tabworthy-components/{p-224503da.entry.js → p-c0f957f5.entry.js} +1 -1
  33. package/dist/tabworthy-components/p-ee41beed.entry.js +1 -0
  34. package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
  35. package/dist/themes/light.css +1 -1
  36. package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +6 -1
  37. package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +27 -0
  38. package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +6 -1
  39. package/dist/types/components.d.ts +54 -0
  40. package/package.json +2 -1
  41. package/dist/components/p-CGobNAdR.js +0 -1
  42. package/dist/components/p-Kr35QPhi.js +0 -1
  43. package/dist/tabworthy-components/p-CDFauf_3.js +0 -2
  44. package/dist/tabworthy-components/p-e66c010b.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CDFauf_3.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CwtZ_Lud.js';
2
2
  import { h as hooks } from './moment-Mki5YqAR.js';
3
3
  import { r as removeTimezoneOffset, x as extractDates, y as isValidISODate, e as dateIsWithinBounds, n as dateIsWithinLowerBounds, o as dateIsWithinUpperBounds, g as getISODateString } from './utils-BVHu5CWV.js';
4
4
 
@@ -10549,8 +10549,9 @@ const TabworthyDates = class {
10549
10549
  this.handleCalendarButtonClick = async () => {
10550
10550
  var _a, _b, _c, _d, _e;
10551
10551
  await customElements.whenDefined("tabworthy-dates-modal");
10552
- this.calendarButtonRef &&
10553
- (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.calendarButtonRef)));
10552
+ // Use input container as trigger for proper dropdown alignment
10553
+ this.inputContainerRef &&
10554
+ (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.inputContainerRef)));
10554
10555
  if ((await ((_b = this.modalRef) === null || _b === void 0 ? void 0 : _b.getState())) === false)
10555
10556
  await ((_c = this.modalRef) === null || _c === void 0 ? void 0 : _c.open());
10556
10557
  else if ((await ((_d = this.modalRef) === null || _d === void 0 ? void 0 : _d.getState())) === true)
@@ -10908,10 +10909,10 @@ const TabworthyDates = class {
10908
10909
  }
10909
10910
  render() {
10910
10911
  var _a;
10911
- return (h(Host, { key: 'e88b264159dd97824a678fd47e735daa7d6e7937' }, h("label", { key: 'bd130dbe90559f0f02760c0cd98069121208ead8', htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", { key: 'e32218a5fd45461d589d10f7ed24b4512475f5e7' }), h("div", { key: '6a17c542843f1cbe42a17a6c437422773f17da5c', class: this.getClassName("input-container") }, h("input", { key: '72688ef25cd185f1c64e385602af5ac758eef488', disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
10912
+ return (h(Host, { key: '3e36f57e5d9f085e0175e79ce7a962e5ec338769' }, h("label", { key: 'ab7c37d2f5becd4caefade892cc6a2b14ffe517d', htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", { key: '8c0a95500aeb784e6f9bf9295aa09077dc6801ca' }), h("div", { key: '63e8a6ee083b12791b52ecb2da15a736fb40611a', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '06a92d32ad8c629567fcacb4022a5a60ccd4f3d7', disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
10912
10913
  [this.getClassName("input")]: true,
10913
10914
  [this.inputClass]: !!this.inputClass
10914
- }, 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: '89acd9aa82cb8c10b7f73e351620babfc13bc96f', 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: '3a853a44a3637007547aba3f55d41f8c4f4ce363', label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
10915
+ }, 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: '1925a172f3fb59c02563495d038f0e9dd806662a', type: "button", 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: 'fb65c2d4e5e9b6daab3b9029315d751214c4a1d3', label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
10915
10916
  if (!this.pickerRef)
10916
10917
  return;
10917
10918
  this.pickerRef.modalIsOpen = true;
@@ -10919,11 +10920,11 @@ const TabworthyDates = class {
10919
10920
  if (!this.pickerRef)
10920
10921
  return;
10921
10922
  this.pickerRef.modalIsOpen = false;
10922
- }, inline: this.inline }, h("tabworthy-dates-calendar", { key: '12900a935aebd37116e805a0528966ab3bbff699', 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 &&
10923
+ }, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", { key: '4f48512b4647749af1f9d2d8bcc31c29f8833e1f', 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 &&
10923
10924
  ((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
10924
- this.chronoSupportedLocale && (h("div", { key: 'db492a4c33d882a7f056dd66d669cd639894a714', class: this.getClassName("quick-group"), role: "group", "aria-label": "Quick selection" }, this.quickButtons.map((buttonText) => {
10925
+ this.chronoSupportedLocale && (h("div", { key: 'c22bb344f5fd2668d8f09f4fb410baec74e1d047', class: this.getClassName("quick-group"), role: "group", "aria-label": "Quick selection" }, this.quickButtons.map((buttonText) => {
10925
10926
  return (h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
10926
- }))), this.errorState && (h("div", { key: '8a4a4d89be39da4438beda996b2f1f3b785d9010', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
10927
+ }))), this.errorState && (h("div", { key: '0c6cacc8d5a536c5a79a9899627c6318c3c85800', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
10927
10928
  }
10928
10929
  get el() { return getElement(this); }
10929
10930
  static get watchers() { return {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CDFauf_3.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CwtZ_Lud.js';
2
2
 
3
3
  const defaultLabels = {
4
4
  hours: "Hours",
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CDFauf_3.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CwtZ_Lud.js';
2
2
  import { h as hooks } from './moment-Mki5YqAR.js';
3
3
  import { g as getISODateString, r as removeTimezoneOffset } from './utils-BVHu5CWV.js';
4
4
 
@@ -98,7 +98,8 @@ const InclusiveTimes = class {
98
98
  };
99
99
  this.handleCalendarButtonClick = async () => {
100
100
  if (this.modalRef) {
101
- await this.modalRef.setTriggerElement(this.calendarButtonRef);
101
+ // Use input container as trigger for proper dropdown alignment
102
+ await this.modalRef.setTriggerElement(this.inputContainerRef);
102
103
  await this.modalRef.open();
103
104
  }
104
105
  };
@@ -235,10 +236,10 @@ const InclusiveTimes = class {
235
236
  }
236
237
  render() {
237
238
  var _a;
238
- return (h(Host, { key: '82b7e3ac499f9b8bea87955bfe55bbe645aa9d5a', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '19a9a6cf34bccd49e6d079a4d9d7d5f3e527f1c7', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '20a4dae28141bb9d3d124653df0f8f3a152a2ee8', class: this.getClassName("input-container") }, h("input", { key: '64779c1b8d59ecff3c9ddcbe0e67025e9bcbd325', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
239
+ return (h(Host, { key: '5dab8801e9296bb948cef7aea77b03bf40a74089', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '4325a32a8a68423db7e287e759684c925dbffa6d', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '618590fadfa9d63a54b7a545d7377003510e85fc', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: 'fd0716e2cea9ede2cac51f1cd7ba1a6167157837', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
239
240
  [this.getClassName("input")]: true,
240
241
  [this.inputClass]: !!this.inputClass
241
- }, 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: '503fb34dfa3b5328c1dfae06647601729d0c634d', 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: '915841d3053aae0e856b19ae24dafc8870c3d746', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
242
+ }, 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: '9dc03047b232cb7286701d4f83daabc0f71c8a3b', type: "button", 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: '9b3321ec4b767d804766d43820b3938862aba46f', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
242
243
  if (this.pickerRef) {
243
244
  this.pickerRef.modalIsOpen = true;
244
245
  }
@@ -246,7 +247,7 @@ const InclusiveTimes = class {
246
247
  if (this.pickerRef) {
247
248
  this.pickerRef.modalIsOpen = false;
248
249
  }
249
- }, inline: this.inline }, h("div", { key: 'b7ead351553fa42af52be2ab8e461b49d6f63b56', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '9397be905159540b8645428d7624c4c6f2dd5133', 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, value: this.value ? this.toDate(this.value) : undefined }, h("div", { key: '6aa58750a3a13fc3e1ddadee0a9c4631220bb399', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: '17943c66cef11e8a4335cb0c0711d5ae327076e9', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: 'f356db7d523202ee5a72089cf57cf072787c32ee', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange }))))), this.errorState && (h("div", { key: 'db47877aa13a91f6441dfd371cc7da70375aa1ea', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
250
+ }, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '8cd6f661951ad17c95ad6cd8fe5482afa699e824', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '85644573834a86c977b36dc71430f5f9b6a9da95', 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, value: this.value ? this.toDate(this.value) : undefined }, h("div", { key: 'f13b4a24fcc3b4b2914a80db7e087082c9d2743f', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: '5b2641318160e08f1a4a3fdad849647c0a50affa', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: 'fba59fa7bd2a0e119b28b69eff15445f972924d6', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange }))))), this.errorState && (h("div", { key: '4018611f9e51219a3ee1497f871e83c51b6bc29b', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
250
251
  }
251
252
  get el() { return getElement(this); }
252
253
  static get watchers() { return {
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as e,g as h}from"./p-CDFauf_3.js";const a={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},c=class{constructor(s){t(this,s),this.timeChanged=i(this,"timeChanged",7),this.hours=12,this.minutes=0,this.useTwelveHourFormat=!1,this.labels=a,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 i=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===i?0:i:12===i?12:i+12:i,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const i=this.getDisplayHours();this.internalHours="AM"===t?12===i?0:i:12===i?12:i+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=12===t?1:t+1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=1===t?12:t-1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+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.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)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.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),i=this.useTwelveHourFormat?12:23,h=this.useTwelveHourFormat?1:0;return s(e,{key:"6ccec0415bd1c35275e125355f69e871a2b3dc18",class:this.elementClassName,"aria-label":this.labels.timePicker},s("div",{key:"52849e2d4e8ad6183d3017277f11fbd5bc3643c5",class:`${this.elementClassName}__container`},s("div",{key:"9aa3980e371db20ae4ed4f590a0e9f49aa3d40cd",class:`${this.elementClassName}__field`},s("label",{key:"77ea146e2d05b4bedec83a8d03096a6c51b6fd36",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),s("div",{key:"cf88cc85dce2a2e11e5e0ca61ab23d5bcc71b7be",class:`${this.elementClassName}__control`},s("button",{key:"e2e68d9e5ed00a2a72f4a019a59d7fa683a8d56c",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},s("svg",{key:"269a5595fd1baf1ace113beb3147542353927c75",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"1d2c3fca6e81b9fdaab6f9b9f2c19f55b1af0ef5",points:"18 15 12 9 6 15"}))),s("input",{key:"53a57e4c6e1a40dcb89ecd11cd1cba0f6205c470",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:h,max:i,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),s("button",{key:"ab36448a4f79a29592124dee72fa8e96f121f646",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},s("svg",{key:"705e207ffc41a38bff7d8739e02605e536e75a92",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"c8c08acec53576456b330c4f40a7879556704d0f",points:"6 9 12 15 18 9"}))))),s("div",{key:"3b8c0125c18518463de020682de4620d918a3463",class:`${this.elementClassName}__separator`},":"),s("div",{key:"c54430db728d8f48320f4e4983a1d67a1ec8c78e",class:`${this.elementClassName}__field`},s("label",{key:"b47c7ae65c0b34b70673a8bd60c3b1496acf9540",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),s("div",{key:"9a4434d935f34bfd910e2ab7656fc125c05de9ca",class:`${this.elementClassName}__control`},s("button",{key:"fcc7800df89c4739c257a5733affdabc8aca1e25",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},s("svg",{key:"80b692e16555612a179fec5734c79966d0c5967a",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"086fbe45c600657c2f6bf37e8415b87e8d763c3e",points:"18 15 12 9 6 15"}))),s("input",{key:"dc610011944c2ad1bf3aa68937265bdf835ba009",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}),s("button",{key:"d2cabe46d53e0cbd2b58140f6a55217dd69a3c5e",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},s("svg",{key:"2e5e67efccb2a66a0c4a1377d3941d12b4bd7947",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"3da5561fb1f5bf1b07eb48de6e020047c1956158",points:"6 9 12 15 18 9"}))))),this.useTwelveHourFormat&&s("div",{key:"24c87e5e371f8a10816afcebb3dc2f7843fa89f5",class:`${this.elementClassName}__period`},s("button",{key:"014126a0d5470d56ae384e12b2e196c3a9132700",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),s("button",{key:"cf9f1f261456d7b5f64bf4b7d9ddbbb2e86d4447",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 h(this)}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}}};export{c as tabworthy_times_picker}
1
+ import{r as t,c as i,h as s,H as e,g as h}from"./p-CwtZ_Lud.js";const a={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},c=class{constructor(s){t(this,s),this.timeChanged=i(this,"timeChanged",7),this.hours=12,this.minutes=0,this.useTwelveHourFormat=!1,this.labels=a,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 i=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===i?0:i:12===i?12:i+12:i,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const i=this.getDisplayHours();this.internalHours="AM"===t?12===i?0:i:12===i?12:i+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=12===t?1:t+1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=1===t?12:t-1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+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.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)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.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),i=this.useTwelveHourFormat?12:23,h=this.useTwelveHourFormat?1:0;return s(e,{key:"6ccec0415bd1c35275e125355f69e871a2b3dc18",class:this.elementClassName,"aria-label":this.labels.timePicker},s("div",{key:"52849e2d4e8ad6183d3017277f11fbd5bc3643c5",class:`${this.elementClassName}__container`},s("div",{key:"9aa3980e371db20ae4ed4f590a0e9f49aa3d40cd",class:`${this.elementClassName}__field`},s("label",{key:"77ea146e2d05b4bedec83a8d03096a6c51b6fd36",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),s("div",{key:"cf88cc85dce2a2e11e5e0ca61ab23d5bcc71b7be",class:`${this.elementClassName}__control`},s("button",{key:"e2e68d9e5ed00a2a72f4a019a59d7fa683a8d56c",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},s("svg",{key:"269a5595fd1baf1ace113beb3147542353927c75",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"1d2c3fca6e81b9fdaab6f9b9f2c19f55b1af0ef5",points:"18 15 12 9 6 15"}))),s("input",{key:"53a57e4c6e1a40dcb89ecd11cd1cba0f6205c470",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:h,max:i,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),s("button",{key:"ab36448a4f79a29592124dee72fa8e96f121f646",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},s("svg",{key:"705e207ffc41a38bff7d8739e02605e536e75a92",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"c8c08acec53576456b330c4f40a7879556704d0f",points:"6 9 12 15 18 9"}))))),s("div",{key:"3b8c0125c18518463de020682de4620d918a3463",class:`${this.elementClassName}__separator`},":"),s("div",{key:"c54430db728d8f48320f4e4983a1d67a1ec8c78e",class:`${this.elementClassName}__field`},s("label",{key:"b47c7ae65c0b34b70673a8bd60c3b1496acf9540",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),s("div",{key:"9a4434d935f34bfd910e2ab7656fc125c05de9ca",class:`${this.elementClassName}__control`},s("button",{key:"fcc7800df89c4739c257a5733affdabc8aca1e25",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},s("svg",{key:"80b692e16555612a179fec5734c79966d0c5967a",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"086fbe45c600657c2f6bf37e8415b87e8d763c3e",points:"18 15 12 9 6 15"}))),s("input",{key:"dc610011944c2ad1bf3aa68937265bdf835ba009",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}),s("button",{key:"d2cabe46d53e0cbd2b58140f6a55217dd69a3c5e",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},s("svg",{key:"2e5e67efccb2a66a0c4a1377d3941d12b4bd7947",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"3da5561fb1f5bf1b07eb48de6e020047c1956158",points:"6 9 12 15 18 9"}))))),this.useTwelveHourFormat&&s("div",{key:"24c87e5e371f8a10816afcebb3dc2f7843fa89f5",class:`${this.elementClassName}__period`},s("button",{key:"014126a0d5470d56ae384e12b2e196c3a9132700",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),s("button",{key:"cf9f1f261456d7b5f64bf4b7d9ddbbb2e86d4447",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 h(this)}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}}};export{c as tabworthy_times_picker}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e,g as h}from"./p-CDFauf_3.js";import{h as a}from"./p-Mki5YqAR.js";import{g as r,r as o}from"./p-BVHu5CWV.js";const d={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"},n=class{constructor(i){t(this,i),this.selectDateTime=s(this,"selectDateTime",7),this.changeYear=s(this,"changeYear",7),this.componentReady=s(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=r(new Date),this.referenceDate=r(new Date),this.useTwelveHourFormat=!0,this.timesLabels=d,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.disableFreeformInput=!1,this.inputClass="",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=o(new Date(s[0])),i=o(new Date(s[1]));this.updateValue([t,i]),this.pickerRef&&(this.pickerRef.value=[t,i])}else{const t=o(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=a(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=a(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=a(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=a(t);s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0);const i=s.format(this.format);this.internalValue=i,this.value=i,this.selectedDate=t,this.selectDateTime.emit(i)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>a(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=a(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>a(t,this.format).toDate())):a(t,this.format).toDate():null}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(e,{key:"82b7e3ac499f9b8bea87955bfe55bbe645aa9d5a",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"19a9a6cf34bccd49e6d079a4d9d7d5f3e527f1c7",htmlFor:`${this.id}-input`,class:this.getClassName("label")},this.label),i("div",{key:"20a4dae28141bb9d3d124653df0f8f3a152a2ee8",class:this.getClassName("input-container")},i("input",{key:"64779c1b8d59ecff3c9ddcbe0e67025e9bcbd325",id:`${this.id}-input`,ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:t.toString(),onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?`${this.id}-error`:void 0,"aria-invalid":this.errorState}),!this.inline&&i("button",{key:"503fb34dfa3b5328c1dfae06647601729d0c634d",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:"915841d3053aae0e856b19ae24dafc8870c3d746",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:"b7ead351553fa42af52be2ab8e461b49d6f63b56",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"9397be905159540b8645428d7624c4c6f2dd5133",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,value:this.value?this.toDate(this.value):void 0},i("div",{key:"6aa58750a3a13fc3e1ddadee0a9c4631220bb399",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"17943c66cef11e8a4335cb0c0711d5ae327076e9",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"f356db7d523202ee5a72089cf57cf072787c32ee",hours:this.selectedHours,minutes:this.selectedMinutes,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange}))))),this.errorState&&i("div",{key:"db47877aa13a91f6441dfd371cc7da70375aa1ea",class:this.getClassName("input-error"),id:this.id?`${this.id}-error`:void 0,role:"status"},this.errorMessage))}get el(){return h(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}};export{n as tabworthy_times}
1
+ import{r as t,c as s,h as i,H as h,g as e}from"./p-CwtZ_Lud.js";import{h as a}from"./p-Mki5YqAR.js";import{g as r,r as o}from"./p-BVHu5CWV.js";const n={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"},d=class{constructor(i){t(this,i),this.selectDateTime=s(this,"selectDateTime",7),this.changeYear=s(this,"changeYear",7),this.componentReady=s(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=r(new Date),this.referenceDate=r(new Date),this.useTwelveHourFormat=!0,this.timesLabels=n,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.disableFreeformInput=!1,this.inputClass="",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=o(new Date(s[0])),i=o(new Date(s[1]));this.updateValue([t,i]),this.pickerRef&&(this.pickerRef.value=[t,i])}else{const t=o(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.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=a(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=a(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=a(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=a(t);s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0);const i=s.format(this.format);this.internalValue=i,this.value=i,this.selectedDate=t,this.selectDateTime.emit(i)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>a(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=a(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>a(t,this.format).toDate())):a(t,this.format).toDate():null}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(h,{key:"5dab8801e9296bb948cef7aea77b03bf40a74089",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"4325a32a8a68423db7e287e759684c925dbffa6d",htmlFor:`${this.id}-input`,class:this.getClassName("label")},this.label),i("div",{key:"618590fadfa9d63a54b7a545d7377003510e85fc",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},i("input",{key:"fd0716e2cea9ede2cac51f1cd7ba1a6167157837",id:`${this.id}-input`,ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:t.toString(),onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?`${this.id}-error`:void 0,"aria-invalid":this.errorState}),!this.inline&&i("button",{key:"9dc03047b232cb7286701d4f83daabc0f71c8a3b",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:"9b3321ec4b767d804766d43820b3938862aba46f",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:"8cd6f661951ad17c95ad6cd8fe5482afa699e824",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"85644573834a86c977b36dc71430f5f9b6a9da95",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,value:this.value?this.toDate(this.value):void 0},i("div",{key:"f13b4a24fcc3b4b2914a80db7e087082c9d2743f",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"5b2641318160e08f1a4a3fdad849647c0a50affa",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"fba59fa7bd2a0e119b28b69eff15445f972924d6",hours:this.selectedHours,minutes:this.selectedMinutes,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange}))))),this.errorState&&i("div",{key:"4018611f9e51219a3ee1497f871e83c51b6bc29b",class:this.getClassName("input-error"),id:this.id?`${this.id}-error`:void 0,role:"status"},this.errorMessage))}get el(){return e(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}};export{d as tabworthy_times}
@@ -0,0 +1,2 @@
1
+ var t,n=(t,n)=>{var e;Object.entries(null!=(e=n.o.t)?e:{}).map((([e,[o]])=>{if(31&o||32&o){const o=t[e],l=function(t,n){for(;t;){const e=Object.getOwnPropertyDescriptor(t,n);if(null==e?void 0:e.get)return e;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);l&&Object.defineProperty(t,e,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),t[e]=n.l.has(e)?n.l.get(e):o}}))},e=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},l=(t,n)=>n in t,s=(t,n)=>(0,console.error)(t,n),i=new Map,r=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},f={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,o)=>t.addEventListener(n,e,o),rel:(t,n,e,o)=>t.removeEventListener(n,e,o),ce:(t,n)=>new CustomEvent(t,n)},a=t=>Promise.resolve(t),d=(()=>{try{return!!u.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!d&&(()=>!!u.document&&Object.getOwnPropertyDescriptor(u.document.adoptedStyleSheets,"length").writable)(),v=!1,h=[],m=[],y=(t,n)=>e=>{t.push(e),v||(v=!0,n&&4&f.u?w($):f.raf($))},b=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){s(t)}t.length=0},$=()=>{b(h),b(m),(v=h.length>0)&&f.raf($)},w=t=>a().then(t),g=y(m,!0);function j(){const n=this.attachShadow({mode:"open"});void 0===t&&(t=null),t&&(p?n.adoptedStyleSheets.push(t):n.adoptedStyleSheets=[...n.adoptedStyleSheets,t])}var O=t=>{const n=E(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&S(n,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!k(t,C(t),!1).length)}));let e=0;for(e=0;e<n.length;e++){const t=n[e];1===t.nodeType&&E(t,"childNodes").length&&O(t)}};function S(t,n,e){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&(!n||o["s-hn"]===n)&&(void 0===e||C(o)===e)&&(s.push(o),void 0!==e))return s;s=[...s,...S(o.childNodes,n,e)]}return s}var k=(t,n,e=!0)=>{const o=[];(e&&t["s-sr"]||!t["s-sr"])&&o.push(t);let l=t;for(;l=l.nextSibling;)C(l)!==n||!e&&l["s-sr"]||o.push(l);return o},N=(t,n)=>1===t.nodeType?null===t.getAttribute("slot")&&""===n||t.getAttribute("slot")===n:t["s-sn"]===n||""===n,C=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function E(t,n){if("__"+n in t){const e=t["__"+n];return"function"!=typeof e?e:e.bind(t)}return"function"!=typeof t[n]?t[n]:t[n].bind(t)}function M(t){var n,e,o;return null!=(o=null==(e=null==(n=t.head)?void 0:n.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?o:void 0}var R,x,T,A=new WeakMap,L=t=>"sc-"+t.v,F=t=>"object"==(t=typeof t)||"function"===t,P=(t,n,...e)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],u=n=>{for(let e=0;e<n.length;e++)o=n[e],Array.isArray(o)?u(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!F(o))&&(o+=""),i&&r?c[c.length-1].h+=o:c.push(i?D(null,o):o),r=i)};if(u(e),n){n.key&&(l=n.key),n.name&&(s=n.name);{const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}}if("function"==typeof t)return t(null===n?{}:n,c,_);const f=D(t,null);return f.m=n,c.length>0&&(f.$=c),f.j=l,f.O=s,f},D=(t,n)=>({u:0,S:t,h:null!=n?n:null,k:null,$:null,m:null,j:null,O:null}),U={},_={forEach:(t,n)=>t.map(H).forEach(n),map:(t,n)=>t.map(H).map(n).map(W)},H=t=>({vattrs:t.m,vchildren:t.$,vkey:t.j,vname:t.O,vtag:t.S,vtext:t.h}),W=t=>{if("function"==typeof t.vtag){const n={...t.vattrs};return t.vkey&&(n.key=t.vkey),t.vname&&(n.name=t.vname),P(t.vtag,n,...t.vchildren||[])}const n=D(t.vtag,t.vtext);return n.m=t.vattrs,n.$=t.vchildren,n.j=t.vkey,n.O=t.vname,n},z=(t,n)=>null==t||F(t)?t:4&n?"false"!==t&&(""===t||!!t):2&n?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&n?t+"":t,B=t=>{var n;return null==(n=e(t))?void 0:n.$hostElement$},V=(t,n,e)=>{const o=B(t);return{emit:t=>q(o,n,{bubbles:!!(4&e),composed:!!(2&e),cancelable:!!(1&e),detail:t})}},q=(t,n,e)=>{const o=f.ce(n,e);return t.dispatchEvent(o),o},Y=(t,n,o,s,i,r)=>{if(o===s)return;let c=l(t,n),a=n.toLowerCase();if("class"===n){const n=t.classList,e=I(o);let l=I(s);n.remove(...e.filter((t=>t&&!l.includes(t)))),n.add(...l.filter((t=>t&&!e.includes(t))))}else if("style"===n){for(const n in o)s&&null!=s[n]||(n.includes("-")?t.style.removeProperty(n):t.style[n]="");for(const n in s)o&&s[n]===o[n]||(n.includes("-")?t.style.setProperty(n,s[n]):t.style[n]=s[n])}else if("key"===n);else if("ref"===n)s&&mt(s,t);else if(c||"o"!==n[0]||"n"!==n[1]){if("a"===n[0]&&n.startsWith("attr:")){const o=n.slice(5);let l;{const n=e(t);if(n&&n.o&&n.o.t){const t=n.o.t[o];t&&t[1]&&(l=t[1])}}return l||(l=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===n[0]&&n.startsWith("prop:")){const e=n.slice(5);try{t[e]=s}catch(t){}return}{const e=F(s);if((c||e&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[n]!==s&&(t[n]=s);else{const e=null==s?"":s;"list"===n?c=!1:null!=o&&t[n]===e||("function"==typeof t.__lookupSetter__(n)?t[n]=e:t.setAttribute(n,e))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(n)||t.removeAttribute(n):(!c||4&r||i)&&!e&&1===t.nodeType&&t.setAttribute(n,s=!0===s?"":s)}}else if(n="-"===n[2]?n.slice(3):l(u,a)?a.slice(2):a[2]+n.slice(3),o||s){const e=n.endsWith(Z);n=n.replace(J,""),o&&f.rel(t,n,o,e),s&&f.ael(t,n,s,e)}},G=/\s/,I=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(G):[]),Z="Capture",J=RegExp(Z+"$"),K=(t,n,e)=>{const o=11===n.k.nodeType&&n.k.host?n.k.host:n.k,l=t&&t.m||{},s=n.m||{};for(const t of Q(Object.keys(l)))t in s||Y(o,t,l[t],void 0,e,n.u);for(const t of Q(Object.keys(s)))Y(o,t,l[t],s[t],e,n.u)};function Q(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var X=!1,tt=!1,nt=!1,et=!1,ot=[],lt=[],st=(t,n,e)=>{var o;const l=n.$[e];let s,i,r,c=0;if(X||(nt=!0,"slot"===l.S&&(l.u|=l.$?2:1)),null!=l.h)s=l.k=u.document.createTextNode(l.h);else if(1&l.u)s=l.k=u.document.createTextNode(""),K(null,l,et);else{if(et||(et="svg"===l.S),!u.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=l.k=u.document.createElementNS(et?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!X&&2&l.u?"slot-fb":l.S),et&&"foreignObject"===l.S&&(et=!1),K(null,l,et),null!=R&&void 0!==R&&s["s-si"]!==R&&s.classList.add(s["s-si"]=R),l.$){const n="template"===l.S?s.content:s;for(c=0;c<l.$.length;++c)i=st(t,l,c),i&&n.appendChild(i)}"svg"===l.S?et=!1:"foreignObject"===s.tagName&&(et=!0)}return s["s-hn"]=T,3&l.u&&(s["s-sr"]=!0,s["s-cr"]=x,s["s-sn"]=l.O||"",s["s-rf"]=null==(o=l.m)?void 0:o.ref,function(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const n=n=>function(t){const e=[],o=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const l=this["s-cr"].parentElement;return(l.__childNodes?l.childNodes:(t=>{const n=[];for(let e=0;e<t.length;e++){const o=t[e]["s-nr"]||void 0;o&&o.isConnected&&n.push(o)}return n})(l.childNodes)).forEach((t=>{o===C(t)&&e.push(t)})),n?e.filter((t=>1===t.nodeType)):e}.bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}(s),r=t&&t.$&&t.$[e],r&&r.S===l.S&&t.k&&it(t.k),bt(x,s,n.k,null==t?void 0:t.k)),s},it=t=>{f.u|=1;const n=t.closest(T.toLowerCase());if(null!=n){const e=Array.from(n.__childNodes||n.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of e?o.reverse():o)null!=t["s-sh"]&&(yt(n,t,null!=e?e:null),t["s-sh"]=void 0,nt=!0)}f.u&=-2},rt=(t,n)=>{f.u|=1;const e=Array.from(t.__childNodes||t.childNodes);if(t["s-sr"]){let n=t;for(;n=n.nextSibling;)n&&n["s-sn"]===t["s-sn"]&&n["s-sh"]===T&&e.push(n)}for(let t=e.length-1;t>=0;t--){const o=e[t];o["s-hn"]!==T&&o["s-ol"]&&(yt(at(o).parentNode,o,at(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,nt=!0),n&&rt(o,n)}f.u&=-2},ct=(t,n,e,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for(r.shadowRoot&&r.tagName===T&&(r=r.shadowRoot),"template"===e.S&&(r=r.content);l<=s;++l)o[l]&&(i=st(null,e,l),i&&(o[l].k=i,yt(r,i,at(n))))},ut=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.k;ht(n),t&&(tt=!0,t["s-ol"]?t["s-ol"].remove():rt(t,!0),t.remove())}}},ft=(t,n,e=!1)=>t.S===n.S&&("slot"===t.S?t.O===n.O:e?(e&&!t.j&&n.j&&(t.j=n.j),!0):t.j===n.j),at=t=>t&&t["s-ol"]||t,dt=(t,n,e=!1)=>{const o=n.k=t.k,l=t.$,s=n.$,i=n.S,r=n.h;let c;null==r?(et="svg"===i||"foreignObject"!==i&&et,"slot"!==i||X||t.O!==n.O&&(n.k["s-sn"]=n.O||"",it(n.k.parentElement)),K(t,n,et),null!==l&&null!==s?((t,n,e,o,l=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=n.length-1,d=n[0],p=n[a],v=o.length-1,h=o[0],m=o[v];const y="template"===e.S?t.content:t;for(;r<=a&&c<=v;)if(null==d)d=n[++r];else if(null==p)p=n[--a];else if(null==h)h=o[++c];else if(null==m)m=o[--v];else if(ft(d,h,l))dt(d,h,l),d=n[++r],h=o[++c];else if(ft(p,m,l))dt(p,m,l),p=n[--a],m=o[--v];else if(ft(d,m,l))"slot"!==d.S&&"slot"!==m.S||rt(d.k.parentNode,!1),dt(d,m,l),yt(y,d.k,p.k.nextSibling),d=n[++r],m=o[--v];else if(ft(p,h,l))"slot"!==d.S&&"slot"!==m.S||rt(p.k.parentNode,!1),dt(p,h,l),yt(y,p.k,d.k),p=n[--a],h=o[++c];else{for(u=-1,f=r;f<=a;++f)if(n[f]&&null!==n[f].j&&n[f].j===h.j){u=f;break}u>=0?(i=n[u],i.S!==h.S?s=st(n&&n[c],e,u):(dt(i,h,l),n[u]=void 0,s=i.k),h=o[++c]):(s=st(n&&n[c],e,c),h=o[++c]),s&&yt(at(d.k).parentNode,s,at(d.k))}r>a?ct(t,null==o[v+1]?null:o[v+1].k,e,o,c,v):c>v&&ut(n,r,a)})(o,l,n,s,e):null!==s?(null!==t.h&&(o.textContent=""),ct(o,null,n,s,0,s.length-1)):!e&&null!==l&&ut(l,0,l.length-1),et&&"svg"===i&&(et=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.h!==r&&(o.data=r)},pt=[],vt=t=>{let n,e,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(n=t["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const l=t["s-sn"];for(o=e.length-1;o>=0;o--)if(n=e[o],!(n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||n["s-sh"]&&n["s-sh"]===t["s-hn"]))if(N(n,l)){let e=pt.find((t=>t.N===n));tt=!0,n["s-sn"]=n["s-sn"]||l,e?(e.N["s-sh"]=t["s-hn"],e.C=t):(n["s-sh"]=t["s-hn"],pt.push({C:t,N:n})),n["s-sr"]&&pt.map((t=>{N(t.N,n["s-sn"])&&(e=pt.find((t=>t.N===n)),e&&!t.C&&(t.C=e.C))}))}else pt.some((t=>t.N===n))||pt.push({N:n})}1===t.nodeType&&vt(t)}},ht=t=>{t.m&&t.m.ref&&ot.push((()=>t.m.ref(null))),t.$&&t.$.map(ht)},mt=(t,n)=>{lt.push((()=>t(n)))},yt=(t,n,e,o)=>{if("string"==typeof n["s-sn"]&&n["s-sr"]&&n["s-cr"])bt(n["s-cr"],n,t,n.parentElement);else if("string"==typeof n["s-sn"]){t.insertBefore(n,e);const{slotNode:l}=function(t,n){var e;if(!(n=n||(null==(e=t["s-ol"])?void 0:e.parentElement)))return{slotNode:null,slotName:""};const o=t["s-sn"]=C(t)||"";return{slotNode:S(E(n,"childNodes"),n.tagName,o)[0],slotName:o}}(n);return l&&!o&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(l),n}return t.__insertBefore?t.__insertBefore(n,e):null==t?void 0:t.insertBefore(n,e)};function bt(t,n,e,o){var l,s;let i;if(t&&"string"==typeof n["s-sn"]&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=n["s-si"]||t.parentNode["s-sc"])){const t=n["s-sn"],r=n["s-hn"];if(null==(l=e.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let n=(o.__childNodes||o.childNodes)[0],e=!1;for(;n;){if(n["s-sn"]!==t&&n["s-hn"]===r&&n["s-sr"]){e=!0;break}n=n.nextSibling}e||o.classList.remove(i+"-s")}}}var $t=(t,n)=>{if(n&&!t.M&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t.M=()=>{n["s-p"].splice(e-1,1),o()})))}},wt=(t,n)=>{if(t.u|=16,4&t.u)return void(t.u|=512);$t(t,t.R);const e=()=>gt(t,n);if(!n)return g(e);queueMicrotask((()=>{e()}))},gt=(t,n)=>{const e=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return n?(t.T&&(t.T=!1,Et(o,"connectedCallback",void 0,e)),t.u|=256,t.A&&(t.A.map((([t,n])=>Et(o,t,n,e))),t.A=void 0),t.L.length&&t.L.forEach((t=>t(e))),l=Et(o,"componentWillLoad",void 0,e)):l=Et(o,"componentWillUpdate",void 0,e),l=jt(l,(()=>Et(o,"componentWillRender",void 0,e))),jt(l,(()=>St(t,o,n)))},jt=(t,n)=>Ot(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),Ot=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,St=async(t,n,e)=>{var o;const l=t.$hostElement$,s=l["s-rc"];e&&(t=>{const n=t.o,e=t.$hostElement$,o=n.u,l=((t,n)=>{var e,o,l;const s=L(n),i=r.get(s);if(!u.document)return s;if(t=11===t.nodeType?t:u.document,i)if("string"==typeof i){let l,r=A.get(t=t.head||t);if(r||A.set(t,r=new Set),!r.has(s)){l=u.document.createElement("style"),l.textContent=i;const a=null!=(e=f.F)?e:M(u.document);if(null!=a&&l.setAttribute("nonce",a),!(1&n.u))if("HEAD"===t.nodeName){const n=t.querySelectorAll("link[rel=preconnect]"),e=n.length>0?n[n.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==e?void 0:e.parentNode)===t?e:null)}else if("host"in t)if(d){const n=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;n.replaceSync(i),p?t.adoptedStyleSheets.unshift(n):t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}else{const n=t.querySelector("style");n?n.textContent=i+n.textContent:t.prepend(l)}else t.append(l);1&n.u&&t.insertBefore(l,null),4&n.u&&(l.textContent+=c),r&&r.add(s)}}else{let n=A.get(t);if(n||A.set(t,n=new Set),!n.has(s)){const e=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(i.constructor===e.CSSStyleSheet)o=i;else{o=new e.CSSStyleSheet;for(let t=0;t<i.cssRules.length;t++)o.insertRule(i.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],n.add(s)}}return s})(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);10&o&&(e["s-sc"]=l,e.classList.add(l+"-h"))})(t);kt(t,n,l,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const n=null!=(o=l["s-p"])?o:[],e=()=>Nt(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.u|=4,n.length=0)}},kt=(t,n,e,o)=>{try{n=n.render(),t.u&=-17,t.u|=2,((t,n,e=!1)=>{var o,l,s,i,r;const c=t.$hostElement$,a=t.o,d=t.P||D(null,null),p=(t=>t&&t.S===U)(n)?n:P(null,null,n);if(T=c.tagName,a.D&&(p.m=p.m||{},a.D.forEach((([t,n])=>{p.m[n]=c[t]}))),e&&p.m)for(const t of Object.keys(p.m))c.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(p.m[t]=c[t]);if(p.S=null,p.u|=4,t.P=p,p.k=d.k=c.shadowRoot||c,R=c["s-sc"],X=!(!(1&a.u)||128&a.u),x=c["s-cr"],tt=!1,dt(d,p,e),f.u|=1,nt){vt(p.k);for(const t of pt){const n=t.N;if(!n["s-ol"]&&u.document){const t=u.document.createTextNode("");t["s-nr"]=n,yt(n.parentNode,n["s-ol"]=t,n,e)}}for(const t of pt){const n=t.N,r=t.C;if(1===n.nodeType&&e&&(n["s-ih"]=null!=(o=n.hidden)&&o),r){const t=r.parentNode;let o=r.nextSibling;if(o&&1===o.nodeType){let e=null==(l=n["s-ol"])?void 0:l.previousSibling;for(;e;){let l=null!=(s=e["s-nr"])?s:null;if(l&&l["s-sn"]===n["s-sn"]&&t===(l.__parentNode||l.parentNode)){for(l=l.nextSibling;l===n||(null==l?void 0:l["s-sr"]);)l=null==l?void 0:l.nextSibling;if(!l||!l["s-nr"]){o=l;break}}e=e.previousSibling}}if((!o&&t!==(n.__parentNode||n.parentNode)||(n.__nextSibling||n.nextSibling)!==o)&&n!==o){if(yt(t,n,o,e),8===n.nodeType&&n.nodeValue.startsWith("s-nt-")){const t=u.document.createTextNode(n.nodeValue.replace(/^s-nt-/,""));t["s-hn"]=n["s-hn"],t["s-sn"]=n["s-sn"],t["s-sh"]=n["s-sh"],t["s-sr"]=n["s-sr"],t["s-ol"]=n["s-ol"],t["s-ol"]["s-nr"]=t,yt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}1===n.nodeType&&"SLOT-FB"!==n.tagName&&(n.hidden=null!=(i=n["s-ih"])&&i)}n&&"function"==typeof r["s-rf"]&&r["s-rf"](r)}else 1===n.nodeType&&(n.hidden=!0)}}if(tt&&O(p.k),f.u&=-2,pt.length=0,!X&&!(1&a.u)&&c["s-cr"]){const t=p.k.__childNodes||p.k.childNodes;for(const n of t)if(n["s-hn"]!==T&&!n["s-sh"])if(e&&null==n["s-ih"]&&(n["s-ih"]=null!=(r=n.hidden)&&r),1===n.nodeType)n.hidden=!0;else if(3===n.nodeType&&n.nodeValue.trim()){const t=u.document.createComment("s-nt-"+n.nodeValue);t["s-sn"]=n["s-sn"],yt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}}x=void 0,ot.forEach((t=>t())),ot.length=0,lt.forEach((t=>t())),lt.length=0})(t,n,o)}catch(n){s(n,t.$hostElement$)}return null},Nt=t=>{const n=t.$hostElement$,e=t.i,o=t.R;Et(e,"componentDidRender",void 0,n),64&t.u?Et(e,"componentDidUpdate",void 0,n):(t.u|=64,Mt(n),Et(e,"componentDidLoad",void 0,n),t.U(n),o||Ct()),t._(n),t.M&&(t.M(),t.M=void 0),512&t.u&&w((()=>wt(t,!1))),t.u&=-517},Ct=()=>{w((()=>q(u,"appload",{detail:{namespace:"tabworthy-components"}})))},Et=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){s(t,o)}},Mt=t=>t.classList.add("hydrated"),Rt=(t,n,o,l)=>{const i=e(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=i.$hostElement$,c=i.l.get(n),u=i.u,f=i.i;if(o=z(o,l.t[n][0]),!(8&u&&void 0!==c||o===c||Number.isNaN(c)&&Number.isNaN(o))){if(i.l.set(n,o),l.H){const t=l.H[n];t&&t.map((t=>{try{const[[e,l]]=Object.entries(t);(128&u||1&l)&&(f?f[e](o,c,n):i.L.push((()=>{i.i[e](o,c,n)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(o,c,n)&&!(16&u))return;16&u||wt(i,!1)}}},xt=(t,n,o)=>{var l,s;const i=t.prototype;{t.watchers&&!n.H&&(n.H=t.watchers),t.deserializers&&!n.W&&(n.W=t.deserializers),t.serializers&&!n.B&&(n.B=t.serializers);const r=Object.entries(null!=(l=n.t)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:s,set:r}=Object.getOwnPropertyDescriptor(i,t)||{};s&&(n.t[t][0]|=2048),r&&(n.t[t][0]|=4096),(1&o||!s)&&Object.defineProperty(i,t,{get(){{if(!(2048&n.t[t][0]))return((t,n)=>e(this).l.get(n))(0,t);const o=e(this),l=o?o.i:i;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(s){const i=e(this);if(i){if(r)return void 0===(32&l?this[t]:i.$hostElement$[t])&&i.l.get(t)&&(s=i.l.get(t)),r.call(this,z(s,l)),void Rt(this,t,s=32&l?this[t]:i.$hostElement$[t],n);{if(!(1&o&&4096&n.t[t][0]))return Rt(this,t,s,n),void(1&o&&!i.i&&i.L.push((()=>{4096&n.t[t][0]&&i.i[t]!==i.l.get(t)&&(i.i[t]=s)})));const e=()=>{const e=i.i[t];!i.l.get(t)&&e&&i.l.set(t,e),i.i[t]=z(s,l),Rt(this,t,i.i[t],n)};i.i?e():i.L.push((()=>{e()}))}}}})}else 1&o&&64&l&&Object.defineProperty(i,t,{value(...n){var o;const l=e(this);return null==(o=null==l?void 0:l.V)?void 0:o.then((()=>{var e;return null==(e=l.i)?void 0:e[t](...n)}))}})})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,s){f.jmp((()=>{var c;const u=o.get(t),f=e(this);if(this.hasOwnProperty(u)&&(s=this[u],delete this[u]),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const e=null==f?void 0:f.u;if(f&&e&&!(8&e)&&s!==l){const o=f.i,i=null==(c=n.H)?void 0:c[t];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&e||1&r)&&o[i].call(o,s,l,t)}))}return}const a=r.find((([t])=>t===u));a&&4&a[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(i,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.H)?s:{}),...r.filter((([t,n])=>31&n[0])).map((([t,e])=>{var l;const s=e[1]||t;return o.set(s,t),512&e[0]&&(null==(l=n.D)||l.push([t,s])),s}))]))}}return t},Tt=(t,n)=>{Et(t,"connectedCallback",void 0,n)},At=(t,n)=>{Et(t,"disconnectedCallback",void 0,n||t)},Lt=(t,n={})=>{var o;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],a=n.exclude||[],p=u.customElements,v=u.document.head,h=v.querySelector("meta[charset]"),m=u.document.createElement("style"),y=[];let b,$=!0;Object.assign(f,n),f.p=new URL(n.resourcesUrl||"./",u.document.baseURI).href;let w=!1;if(t.map((t=>{t[1].map((n=>{var o,c,v;const h={u:n[0],v:n[1],t:n[2],q:n[3]};4&h.u&&(w=!0),h.t=n[2],h.q=n[3],h.D=[],h.H=null!=(o=n[4])?o:{},h.B=null!=(c=n[5])?c:{},h.W=null!=(v=n[6])?v:{};const m=h.v,g=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,n)=>{const e={u:0,$hostElement$:t,o:n,l:new Map,Y:new Map};e.V=new Promise((t=>e._=t)),e.G=new Promise((t=>e.U=t)),t["s-p"]=[],t["s-rc"]=[],e.L=[];const o=e;t.__stencil__getHostRef=()=>o})(t=this,h),1&h.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${h.v}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(t,h)}connectedCallback(){const t=e(this);t&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,Ft(this,t,h.q)),b&&(clearTimeout(b),b=null),$?y.push(this):f.jmp((()=>(t=>{if(!(1&f.u)){const n=e(t);if(!n)return;const o=n.o,l=()=>{};if(1&n.u)Ft(t,n,o.q),(null==n?void 0:n.i)?Tt(n.i,t):(null==n?void 0:n.G)&&n.G.then((()=>Tt(n.i,t)));else{n.u|=1,12&o.u&&(t=>{if(!u.document)return;const n=t["s-cr"]=u.document.createComment("");n["s-cn"]=!0,yt(t,n,t.firstChild)})(t);{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){$t(n,n.R=e);break}}o.t&&Object.entries(o.t).map((([n,[e]])=>{if(31&e&&n in t&&t[n]!==Object.prototype[n]){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e)=>{let o;try{if(!(32&n.u)){if(n.u|=32,e.I){const l=((t,n)=>{const e=t.v.replace(/-/g,"_"),o=t.I;if(!o)return;const l=i.get(o);return l?l[e]:import(`./${o}.entry.js`).then((t=>(i.set(o,t),t[e])),(t=>{s(t,n.$hostElement$)}))
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(e,n);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${e.v}#${n.Z}" was not found`);o.isProxied||(e.H=o.watchers,e.B=o.serializers,e.W=o.deserializers,xt(o,e,2),o.isProxied=!0);const r=()=>{};n.u|=8;try{new o(n)}catch(n){s(n,t)}n.u&=-9,n.u|=128,r(),4&e.u?n.T=!0:Tt(n.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>n.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const n=L(e);if(!r.has(n)){const o=()=>{};((t,n,e)=>{let o=r.get(t);d&&e?(o=o||new CSSStyleSheet,"string"==typeof o?o=n:o.replaceSync(n)):o=n,r.set(t,o)})(n,t,!!(1&e.u)),o()}}}const l=n.R,c=()=>wt(n,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()}catch(e){s(e,t),n.M&&(n.M(),n.M=void 0),n.U&&n.U(t)}})(t,n,o)}l()}})(this))))}disconnectedCallback(){f.jmp((()=>(async t=>{if(!(1&f.u)){const n=e(t);(null==n?void 0:n.J)&&(n.J.map((t=>t())),n.J=void 0),(null==n?void 0:n.i)?At(n.i,t):(null==n?void 0:n.G)&&n.G.then((()=>At(n.i,t)))}A.has(t)&&A.delete(t),t.shadowRoot&&A.has(t.shadowRoot)&&A.delete(t.shadowRoot)})(this))),f.raf((()=>{var t;const n=e(this);if(!n)return;const o=y.findIndex((t=>t===this));o>-1&&y.splice(o,1),(null==(t=null==n?void 0:n.P)?void 0:t.k)instanceof Node&&!n.P.k.isConnected&&delete n.P.k}))}componentOnReady(){var t;return null==(t=e(this))?void 0:t.G}};h.I=t[0],a.includes(m)||p.get(m)||(l.push(m),p.define(m,xt(g,h,1)))}))})),l.length>0&&(w&&(m.textContent+=c),m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(o=f.F)?o:M(u.document);null!=t&&m.setAttribute("nonce",t),v.insertBefore(m,h?h.nextSibling:v.firstChild)}$=!1,y.length?y.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(Ct,30)))},Ft=(t,n,e)=>{e&&u.document&&e.map((([e,o,l])=>{const s=Dt(u.document,t,e),i=Pt(n,l),r=Ut(e);f.ael(s,o,i,r),(n.J=n.J||[]).push((()=>f.rel(s,o,i,r)))}))},Pt=(t,n)=>e=>{var o;try{256&t.u?null==(o=t.i)||o[n](e):(t.A=t.A||[]).push([n,e])}catch(n){s(n,t.$hostElement$)}},Dt=(t,n,e)=>8&e?u:n,Ut=t=>({passive:!!(1&t),capture:!!(2&t)}),_t=t=>f.F=t;export{U as H,Lt as b,V as c,B as g,P as h,a as p,o as r,_t as s}