@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.
- package/dist/cjs/{index-w-Wtojyv.js → index-B1s0tI-Z.js} +21 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tabworthy-components.cjs.js +2 -2
- package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +1960 -8
- package/dist/cjs/tabworthy-dates.cjs.entry.js +11 -9
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +1 -1
- package/dist/cjs/tabworthy-times.cjs.entry.js +6 -5
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +34 -8
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.css +4 -1
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +257 -5
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +29 -4
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DT8TK_a8.js → p-B8sG1vGD.js} +1 -1
- package/dist/components/{p-Bnmroodq.js → p-B9YA6avR.js} +1 -1
- package/dist/components/p-B9fGfjA-.js +1 -0
- package/dist/components/p-BiJ0HZVY.js +1 -0
- package/dist/components/tabworthy-dates-calendar.js +1 -1
- package/dist/components/tabworthy-dates-modal.js +1 -1
- package/dist/components/tabworthy-dates.js +1 -1
- package/dist/components/tabworthy-times-picker.js +1 -1
- package/dist/components/tabworthy-times.js +1 -1
- package/dist/esm/{index-CDFauf_3.js → index-CwtZ_Lud.js} +21 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/tabworthy-components.js +3 -3
- package/dist/esm/tabworthy-dates-calendar_2.entry.js +1960 -8
- package/dist/esm/tabworthy-dates.entry.js +11 -9
- package/dist/esm/tabworthy-times-picker.entry.js +1 -1
- package/dist/esm/tabworthy-times.entry.js +6 -5
- package/dist/tabworthy-components/{p-224503da.entry.js → p-0e77d058.entry.js} +1 -1
- package/dist/tabworthy-components/{p-8416e0a9.entry.js → p-4eec41e5.entry.js} +1 -1
- package/dist/tabworthy-components/p-CwtZ_Lud.js +2 -0
- package/dist/tabworthy-components/p-ee41beed.entry.js +1 -0
- package/dist/tabworthy-components/{p-dcb3ea8d.entry.js → p-fdb3b911.entry.js} +1 -1
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/dist/themes/light.css +1 -1
- package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +7 -1
- package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +27 -0
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +7 -2
- package/dist/types/components.d.ts +54 -0
- package/package.json +2 -1
- package/dist/components/p-CGobNAdR.js +0 -1
- package/dist/components/p-Kr35QPhi.js +0 -1
- package/dist/tabworthy-components/p-CDFauf_3.js +0 -2
- 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-
|
|
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
|
-
|
|
10553
|
-
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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-
|
|
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
|
-
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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 {
|