@tabworthy/components 0.8.7 → 0.9.1

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 +11 -9
  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 +34 -8
  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 +11 -9
  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-224503da.entry.js → p-0e77d058.entry.js} +1 -1
  30. package/dist/tabworthy-components/{p-8416e0a9.entry.js → p-4eec41e5.entry.js} +1 -1
  31. package/dist/tabworthy-components/p-CwtZ_Lud.js +2 -0
  32. package/dist/tabworthy-components/p-ee41beed.entry.js +1 -0
  33. package/dist/tabworthy-components/{p-dcb3ea8d.entry.js → p-fdb3b911.entry.js} +1 -1
  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 +7 -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 +7 -2
  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
 
@@ -10480,7 +10480,8 @@ const defaultLabels = {
10480
10480
  rangeOutOfBoundsError: `Please enter a valid range of dates`,
10481
10481
  disabledDateError: `Please choose an available date`,
10482
10482
  to: "to",
10483
- startDate: "Start date"
10483
+ startDate: "Start date",
10484
+ quickSelection: "Quick selection"
10484
10485
  };
10485
10486
  const TabworthyDates = class {
10486
10487
  constructor(hostRef) {
@@ -10549,8 +10550,9 @@ const TabworthyDates = class {
10549
10550
  this.handleCalendarButtonClick = async () => {
10550
10551
  var _a, _b, _c, _d, _e;
10551
10552
  await customElements.whenDefined("tabworthy-dates-modal");
10552
- this.calendarButtonRef &&
10553
- (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.calendarButtonRef)));
10553
+ // Use input container as trigger for proper dropdown alignment
10554
+ this.inputContainerRef &&
10555
+ (await ((_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.setTriggerElement(this.inputContainerRef)));
10554
10556
  if ((await ((_b = this.modalRef) === null || _b === void 0 ? void 0 : _b.getState())) === false)
10555
10557
  await ((_c = this.modalRef) === null || _c === void 0 ? void 0 : _c.open());
10556
10558
  else if ((await ((_d = this.modalRef) === null || _d === void 0 ? void 0 : _d.getState())) === true)
@@ -10908,10 +10910,10 @@ const TabworthyDates = class {
10908
10910
  }
10909
10911
  render() {
10910
10912
  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: {
10913
+ return (h(Host, { key: 'b85c1909fe1480911c45c35a2df8c01e5f7a09d3' }, h("label", { key: '3b41928ed705bdeeee9cb0d6e13d58a767d00b26', htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", { key: '3c8b0017ab9604956ac4e1c452fdc1a6a4e4a786' }), h("div", { key: '5a389a5f7be57c19d11d4a565a61130d5fd3b5ff', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '7c1b10e5811f0797c67673f2d8c13fb2ea6b10d0', disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
10912
10914
  [this.getClassName("input")]: true,
10913
10915
  [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: () => {
10916
+ }, 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: '892a308b551d55b8e027f2dde48cc0cc22e00018', 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: 'e2e90d92503ca129ed2017c2321590bdee12ce20', label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
10915
10917
  if (!this.pickerRef)
10916
10918
  return;
10917
10919
  this.pickerRef.modalIsOpen = true;
@@ -10919,11 +10921,11 @@ const TabworthyDates = class {
10919
10921
  if (!this.pickerRef)
10920
10922
  return;
10921
10923
  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 &&
10924
+ }, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", { key: '0b8aa3324fedbd8f63c856fe5e5662cdc011db1f', 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
10925
  ((_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) => {
10926
+ this.chronoSupportedLocale && (h("div", { key: '26e0dc9ae8e91b308b9f159e5428ae3e0ac9a8c8', class: this.getClassName("quick-group"), role: "group", "aria-label": this.datesLabels.quickSelection }, this.quickButtons.map((buttonText) => {
10925
10927
  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))));
10928
+ }))), this.errorState && (h("div", { key: '434fecd9962fe0360536c6f0d96cb52e77034399', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
10927
10929
  }
10928
10930
  get el() { return getElement(this); }
10929
10931
  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: 'bb2dfac0bb47e71d31aae0af5a864ad46970baf1', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: 'ac7a24801c515a6411dc123ca1f976e5d791efb7', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '75368fdfabad0cbe08196013573b827602655335', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: '6ca23bd4504a10d2bcfa54d194b7ea3bf94ccb57', 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: '1e8348e12dbe8e87d17d137721c3903ea8f95ae1', 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: 'd361f887baa7ac18b901862ea4aa240b614ba210', 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: '207708dc4997d068e1d10c08d97551c1037c38d5', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: 'b16f50c72789b5d98c629668c655e10a6ce1e84b', 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: 'b8ca24c7f7437dfce513fbc6d7c28b4dc887e4c2', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: 'fc353c6db72e547f044bee19c02eeb6207a8af0b', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: 'c77b51e4a60978c3706ead492e972db81b72aa73', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange }))))), this.errorState && (h("div", { key: '7d3e27a0d9bb0b54642873205bc6bf140126d894', 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 {