@tabworthy/components 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tabworthy-dates.cjs.entry.js +11 -6
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +11 -6
- package/dist/components/tabworthy-dates.js +1 -1
- package/dist/esm/tabworthy-dates.entry.js +11 -6
- package/dist/tabworthy-components/{p-6986ab96.entry.js → p-d3ca80db.entry.js} +1 -1
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/package.json +1 -1
|
@@ -10813,7 +10813,9 @@ const TabworthyDates = class {
|
|
|
10813
10813
|
else {
|
|
10814
10814
|
(_b = this.modalRef) === null || _b === void 0 ? void 0 : _b.close();
|
|
10815
10815
|
// Convert ISO date to specified format
|
|
10816
|
-
const formattedDate =
|
|
10816
|
+
const formattedDate = newValue
|
|
10817
|
+
? hooks(newValue).format(this.format)
|
|
10818
|
+
: "";
|
|
10817
10819
|
this.inputRef.value = formattedDate;
|
|
10818
10820
|
this.internalValue = formattedDate;
|
|
10819
10821
|
this.errorState = false;
|
|
@@ -10825,6 +10827,9 @@ const TabworthyDates = class {
|
|
|
10825
10827
|
this.selectDate.emit(this.internalValue);
|
|
10826
10828
|
}
|
|
10827
10829
|
announceDateChange(newValue) {
|
|
10830
|
+
if (!newValue || (Array.isArray(newValue) && newValue.length === 0)) {
|
|
10831
|
+
return;
|
|
10832
|
+
}
|
|
10828
10833
|
const newValueInIsoFormat = Array.isArray(newValue)
|
|
10829
10834
|
? newValue.map((date) => hooks(date, this.format).toISOString())
|
|
10830
10835
|
: hooks(newValue, this.format).toISOString();
|
|
@@ -10894,10 +10899,10 @@ const TabworthyDates = class {
|
|
|
10894
10899
|
}
|
|
10895
10900
|
render() {
|
|
10896
10901
|
var _a;
|
|
10897
|
-
return (h(Host, { key: '
|
|
10902
|
+
return (h(Host, { key: '16c9966e45f0084e805bb11cb1292a47869a2626' }, h("label", { key: '69d95cfdf481252fb684b8d071af97b26a10f466', htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", { key: '0b5c2fff7c26dbfe40d75f8f488ccf39e89b1ca3' }), h("div", { key: 'ecda94423965415e62da7a973ecf4b197104296f', class: this.getClassName("input-container") }, h("input", { key: '5c0e5276b82e69d68ebf14983918318fa2c33162', disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
|
|
10898
10903
|
[this.getClassName("input")]: true,
|
|
10899
10904
|
[this.inputClass]: !!this.inputClass
|
|
10900
|
-
}, 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: '
|
|
10905
|
+
}, 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: 'b8652ae391a12962aac5eb620ecddf23fed9a47b', 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: '358993a42e0401f33f2bc602f83241c53a0f7ef9', label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
10901
10906
|
if (!this.pickerRef)
|
|
10902
10907
|
return;
|
|
10903
10908
|
this.pickerRef.modalIsOpen = true;
|
|
@@ -10905,11 +10910,11 @@ const TabworthyDates = class {
|
|
|
10905
10910
|
if (!this.pickerRef)
|
|
10906
10911
|
return;
|
|
10907
10912
|
this.pickerRef.modalIsOpen = false;
|
|
10908
|
-
}, inline: this.inline }, h("tabworthy-dates-calendar", { key: '
|
|
10913
|
+
}, inline: this.inline }, h("tabworthy-dates-calendar", { key: 'a9a1376d1d0a0f8213d8be3426d333257cc60be7', 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 &&
|
|
10909
10914
|
((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
10910
|
-
this.chronoSupportedLocale && (h("div", { key: '
|
|
10915
|
+
this.chronoSupportedLocale && (h("div", { key: '3130ee18874ab44cb4de0b9c47289ea4de4f51b8', class: this.getClassName("quick-group"), role: "group", "aria-label": "Quick selection" }, this.quickButtons.map((buttonText) => {
|
|
10911
10916
|
return (h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
|
|
10912
|
-
}))), this.errorState && (h("div", { key: '
|
|
10917
|
+
}))), this.errorState && (h("div", { key: '62a9c3115a69430c8a6b1f646612c250c527449b', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
10913
10918
|
}
|
|
10914
10919
|
get el() { return getElement(this); }
|
|
10915
10920
|
static get watchers() { return {
|