@tabworthy/components 0.11.4 → 0.12.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/loader.cjs.js +1 -1
- package/dist/cjs/tabworthy-components.cjs.js +1 -1
- package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +8 -8
- package/dist/cjs/tabworthy-dates.cjs.entry.js +36 -5
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +8 -8
- package/dist/cjs/tabworthy-times.cjs.entry.js +30 -7
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +56 -5
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +1 -1
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +3 -3
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +29 -6
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +8 -8
- package/dist/components/{p-B6lbpNd2.js → p-BTQaxOHo.js} +1 -1
- package/dist/components/{p-CIQgnOXj.js → p-CMIEIvTW.js} +1 -1
- package/dist/components/{p-CGo5md1l.js → p-M03P4DAz.js} +1 -1
- 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/loader.js +1 -1
- package/dist/esm/tabworthy-components.js +1 -1
- package/dist/esm/tabworthy-dates-calendar_2.entry.js +7 -7
- package/dist/esm/tabworthy-dates.entry.js +36 -5
- package/dist/esm/tabworthy-times-picker.entry.js +8 -8
- package/dist/esm/tabworthy-times.entry.js +30 -7
- package/dist/tabworthy-components/{p-60793499.entry.js → p-1743bf7a.entry.js} +1 -1
- package/dist/tabworthy-components/{p-c378a069.entry.js → p-744ffef9.entry.js} +1 -1
- package/dist/tabworthy-components/{p-f1688c61.entry.js → p-df93e5d4.entry.js} +1 -1
- package/dist/tabworthy-components/p-e45412de.entry.js +1 -0
- 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 +3 -0
- package/dist/types/components/tabworthy-dates-calendar/tabworthy-dates-calendar.d.ts +1 -1
- package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +1 -1
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +1 -1
- package/dist/types/components.d.ts +9 -0
- package/package.json +1 -1
- package/dist/tabworthy-components/p-6335f1a7.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["tabworthy-times-picker.cjs",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times.cjs",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"timesLabels":[16],"datesCalendarLabels":[16],"timesPickerLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"calendarButtonContent":[1,"calendar-button-content"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"inputShouldFormat":[8,"input-should-format"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[32],"selectedSeconds":[32],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates.cjs",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["tabworthy-times-picker.cjs",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times.cjs",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"timesLabels":[16],"datesCalendarLabels":[16],"timesPickerLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"calendarButtonContent":[1,"calendar-button-content"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"inputShouldFormat":[8,"input-should-format"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[32],"selectedSeconds":[32],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates.cjs",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-only"],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["tabworthy-times-picker.cjs",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times.cjs",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"timesLabels":[16],"datesCalendarLabels":[16],"timesPickerLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"calendarButtonContent":[1,"calendar-button-content"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"inputShouldFormat":[8,"input-should-format"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[32],"selectedSeconds":[32],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates.cjs",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["tabworthy-times-picker.cjs",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"seconds":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"internalSeconds":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}],"seconds":[{"watchSeconds":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-button-content"],"disabled":[4],"modalIsOpen":[4,"modal-is-open"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"range":[4],"labels":[16],"locale":[1],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"inline":[4],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showMonthStepper":[4,"show-month-stepper"],"showTodayButton":[4,"show-today-button"],"showYearStepper":[4,"show-year-stepper"],"showKeyboardHint":[4,"show-keyboard-hint"],"showHiddenTitle":[4,"show-hidden-title"],"startDate":[1,"start-date"],"todayButtonContent":[1,"today-button-content"],"value":[1040],"currentDate":[32],"hoveredDate":[32],"weekdays":[32]},null,{"modalIsOpen":[{"watchModalIsOpen":0}],"firstDayOfWeek":[{"watchFirstDayOfWeek":0}],"locale":[{"watchLocale":0}],"range":[{"watchRange":0}],"startDate":[{"watchStartDate":0}],"value":[{"watchValue":0}]}],[257,"tabworthy-dates-modal",{"label":[1],"inline":[4],"placement":[1],"offset":[16],"appendTo":[1,"append-to"],"closing":[32],"showing":[32],"positioned":[32],"open":[64],"close":[64],"getState":[64],"setTriggerElement":[64],"updatePosition":[64]},[[10,"click","handleClick"]],{"showing":[{"watchShowing":0}]}]]],["tabworthy-times.cjs",[[2,"tabworthy-times",{"id":[513],"value":[1025],"range":[4],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"showSeconds":[4,"show-seconds"],"timesLabels":[16],"datesCalendarLabels":[16],"timesPickerLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"calendarButtonContent":[1,"calendar-button-content"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"inputShouldFormat":[8,"input-should-format"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"selectedDate":[32],"selectedHours":[32],"selectedMinutes":[32],"selectedSeconds":[32],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates.cjs",[[2,"tabworthy-dates",{"id":[513],"value":[1025],"range":[4],"yearOnly":[4,"year-only"],"label":[1],"placeholder":[1],"locale":[1],"disabled":[4],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"startDate":[1,"start-date"],"referenceDate":[1,"reference-date"],"useStrictDateParsing":[4,"use-strict-date-parsing"],"datesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-button"],"showCloseButton":[4,"show-close-button"],"showTodayButton":[4,"show-today-button"],"inputShouldFormat":[8,"input-should-format"],"showKeyboardHint":[4,"show-keyboard-hint"],"disableDate":[16],"elementClassName":[1,"element-class-name"],"firstDayOfWeek":[2,"first-day-of-week"],"format":[1],"quickButtons":[16],"todayButtonContent":[1,"today-button-content"],"calendarButtonContent":[1,"calendar-button-content"],"showQuickButtons":[4,"show-quick-buttons"],"disableFreeformInput":[4,"disable-freeform-input"],"inputClass":[1,"input-class"],"appendTo":[1,"append-to"],"internalValue":[32],"errorState":[32],"disabledState":[32],"parseDate":[64]},null,{"disabled":[{"watchDisabled":0}],"value":[{"watchValue":0}]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -21,7 +21,7 @@ const defaultLabels = {
|
|
|
21
21
|
chooseAsStartDate: "choose as start date",
|
|
22
22
|
chooseAsEndDate: "choose as end date"
|
|
23
23
|
};
|
|
24
|
-
const
|
|
24
|
+
const TabworthyDatesCalendar = class {
|
|
25
25
|
constructor(hostRef) {
|
|
26
26
|
index.registerInstance(this, hostRef);
|
|
27
27
|
this.selectDate = index.createEvent(this, "selectDate", 3);
|
|
@@ -428,7 +428,7 @@ const InclusiveDatesCalendar = class {
|
|
|
428
428
|
}]
|
|
429
429
|
}; }
|
|
430
430
|
};
|
|
431
|
-
|
|
431
|
+
TabworthyDatesCalendar.style = tabworthyDatesCalendarCss();
|
|
432
432
|
|
|
433
433
|
/**
|
|
434
434
|
* Traverses the slots of the open shadowroots and returns all children matching the query.
|
|
@@ -2637,7 +2637,7 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
2637
2637
|
|
|
2638
2638
|
const tabworthyDatesModalCss = () => `:host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}`;
|
|
2639
2639
|
|
|
2640
|
-
const
|
|
2640
|
+
const TabworthyDatesModal = class {
|
|
2641
2641
|
constructor(hostRef) {
|
|
2642
2642
|
index.registerInstance(this, hostRef);
|
|
2643
2643
|
this.opened = index.createEvent(this, "opened", 7);
|
|
@@ -2825,7 +2825,7 @@ const InclusiveDatesModal = class {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
}
|
|
2827
2827
|
render() {
|
|
2828
|
-
return (index.h(index.Host, { key: '
|
|
2828
|
+
return (index.h(index.Host, { key: '488fb845bb3a168c45f715b5f7315a80e1857589', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (index.h("div", { key: 'd6263beffa3dbeaa7f0e5e65c1f2627c07164648', part: "body", ref: (r) => {
|
|
2829
2829
|
if (r) {
|
|
2830
2830
|
this.bodyRef = r;
|
|
2831
2831
|
// Setup portal and create popper when ref is set
|
|
@@ -2842,7 +2842,7 @@ const InclusiveDatesModal = class {
|
|
|
2842
2842
|
});
|
|
2843
2843
|
}
|
|
2844
2844
|
}
|
|
2845
|
-
}, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, index.h("focus-trap", { key: '
|
|
2845
|
+
}, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, index.h("focus-trap", { key: '7ffb9cc684198ab9f3b127a4abe5f60f3241cd49' }, index.h("div", { key: 'c6c7c14220c01969f3a5c92dda882685f4c43268', part: "content" }, index.h("slot", { key: 'a1e6ce7ed152f61b3970e20b40e36bb13ee7580a' }))))), this.inline && (index.h("div", { key: '632750cfce76139771642e03051f5c4a654db56a', part: "content" }, index.h("slot", { key: 'c1aa297a6ffdeee55840a9e05adddb7220e7f954' })))));
|
|
2846
2846
|
}
|
|
2847
2847
|
get hostElement() { return index.getElement(this); }
|
|
2848
2848
|
static get watchers() { return {
|
|
@@ -2851,7 +2851,7 @@ const InclusiveDatesModal = class {
|
|
|
2851
2851
|
}]
|
|
2852
2852
|
}; }
|
|
2853
2853
|
};
|
|
2854
|
-
|
|
2854
|
+
TabworthyDatesModal.style = tabworthyDatesModalCss();
|
|
2855
2855
|
|
|
2856
|
-
exports.tabworthy_dates_calendar =
|
|
2857
|
-
exports.tabworthy_dates_modal =
|
|
2856
|
+
exports.tabworthy_dates_calendar = TabworthyDatesCalendar;
|
|
2857
|
+
exports.tabworthy_dates_modal = TabworthyDatesModal;
|
|
@@ -10476,6 +10476,7 @@ const defaultLabels = {
|
|
|
10476
10476
|
invalidDateError: "We could not find a matching date",
|
|
10477
10477
|
minDateError: `Please fill in a date after `,
|
|
10478
10478
|
maxDateError: `Please fill in a date before `,
|
|
10479
|
+
yearSelect: "Select year",
|
|
10479
10480
|
rangeOutOfBoundsError: `Please enter a valid range of dates`,
|
|
10480
10481
|
disabledDateError: `Please choose an available date`,
|
|
10481
10482
|
to: "to",
|
|
@@ -10490,6 +10491,8 @@ const TabworthyDates = class {
|
|
|
10490
10491
|
this.componentReady = index$1.createEvent(this, "componentReady", 7);
|
|
10491
10492
|
// Enable or disable range mode
|
|
10492
10493
|
this.range = false;
|
|
10494
|
+
// Enable year-only mode (shows only year input, no calendar)
|
|
10495
|
+
this.yearOnly = false;
|
|
10493
10496
|
// A label for the text field
|
|
10494
10497
|
this.label = this.range
|
|
10495
10498
|
? "Choose a date range (any way you like)"
|
|
@@ -10599,6 +10602,23 @@ const TabworthyDates = class {
|
|
|
10599
10602
|
var _a;
|
|
10600
10603
|
(_a = this.changeYear) === null || _a === void 0 ? void 0 : _a.emit(yearDetail);
|
|
10601
10604
|
};
|
|
10605
|
+
this.handleYearInputChange = (event) => {
|
|
10606
|
+
var _a;
|
|
10607
|
+
const year = +event.target.value;
|
|
10608
|
+
if (!year || isNaN(year))
|
|
10609
|
+
return;
|
|
10610
|
+
const minYear = this.minDate ? parseInt(this.minDate.slice(0, 4), 10) : 1;
|
|
10611
|
+
const maxYear = this.maxDate
|
|
10612
|
+
? parseInt(this.maxDate.slice(0, 4), 10)
|
|
10613
|
+
: 9999;
|
|
10614
|
+
if (year < minYear || year > maxYear)
|
|
10615
|
+
return;
|
|
10616
|
+
const newValue = customParseFormat.dayjs().year(year).startOf("year").format(this.format);
|
|
10617
|
+
this.internalValue = newValue;
|
|
10618
|
+
this.value = newValue;
|
|
10619
|
+
(_a = this.changeYear) === null || _a === void 0 ? void 0 : _a.emit({ year });
|
|
10620
|
+
this.selectDate.emit(newValue);
|
|
10621
|
+
};
|
|
10602
10622
|
this.handleRangeChange = async (value) => {
|
|
10603
10623
|
this.errorState = false;
|
|
10604
10624
|
if (value.length === 0) {
|
|
@@ -10911,10 +10931,21 @@ const TabworthyDates = class {
|
|
|
10911
10931
|
}
|
|
10912
10932
|
render() {
|
|
10913
10933
|
var _a;
|
|
10914
|
-
|
|
10934
|
+
// Year-only mode: show just a year number input
|
|
10935
|
+
if (this.yearOnly) {
|
|
10936
|
+
const currentYear = this.value
|
|
10937
|
+
? parseInt(String(this.value).slice(0, 4), 10)
|
|
10938
|
+
: new Date().getFullYear();
|
|
10939
|
+
return (index$1.h(index$1.Host, null, index$1.h("label", { htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), index$1.h("br", null), index$1.h("div", { class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, index$1.h("input", { "aria-label": this.datesLabels.yearSelect, class: {
|
|
10940
|
+
[this.getClassName("year-select")]: true,
|
|
10941
|
+
[this.getClassName("input")]: true,
|
|
10942
|
+
[this.inputClass]: !!this.inputClass
|
|
10943
|
+
}, "aria-disabled": this.disabledState, disabled: this.disabledState, max: this.maxDate ? this.maxDate.slice(0, 4) : 9999, min: this.minDate ? this.minDate.slice(0, 4) : 1, name: "year", id: this.id ? `${this.id}-input` : undefined, onChange: this.handleYearInputChange, type: "number", value: currentYear, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState })), this.errorState && (index$1.h("div", { class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
10944
|
+
}
|
|
10945
|
+
return (index$1.h(index$1.Host, null, index$1.h("label", { htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), index$1.h("br", null), index$1.h("div", { class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, index$1.h("input", { disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
|
|
10915
10946
|
[this.getClassName("input")]: true,
|
|
10916
10947
|
[this.inputClass]: !!this.inputClass
|
|
10917
|
-
}, 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 && (index$1.h("button", {
|
|
10948
|
+
}, 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 && (index$1.h("button", { type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (index$1.h("span", { innerHTML: this.calendarButtonContent })) : (this.datesLabels.openCalendar)))), index$1.h("tabworthy-dates-modal", { label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
10918
10949
|
if (!this.pickerRef)
|
|
10919
10950
|
return;
|
|
10920
10951
|
this.pickerRef.modalIsOpen = true;
|
|
@@ -10922,11 +10953,11 @@ const TabworthyDates = class {
|
|
|
10922
10953
|
if (!this.pickerRef)
|
|
10923
10954
|
return;
|
|
10924
10955
|
this.pickerRef.modalIsOpen = false;
|
|
10925
|
-
}, inline: this.inline, appendTo: this.appendTo }, index$1.h("tabworthy-dates-calendar", {
|
|
10956
|
+
}, inline: this.inline, appendTo: this.appendTo }, index$1.h("tabworthy-dates-calendar", { range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), onRequestClose: () => { var _a; return (_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close(); }, 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, showCloseButton: this.showCloseButton, showKeyboardHint: this.showKeyboardHint, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline })), this.showQuickButtons &&
|
|
10926
10957
|
((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
10927
|
-
this.chronoSupportedLocale && (index$1.h("div", {
|
|
10958
|
+
this.chronoSupportedLocale && (index$1.h("div", { class: this.getClassName("quick-group"), role: "group", "aria-label": this.datesLabels.quickSelection }, this.quickButtons.map((buttonText) => {
|
|
10928
10959
|
return (index$1.h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
|
|
10929
|
-
}))), this.errorState && (index$1.h("div", {
|
|
10960
|
+
}))), this.errorState && (index$1.h("div", { class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
10930
10961
|
}
|
|
10931
10962
|
get el() { return index$1.getElement(this); }
|
|
10932
10963
|
static get watchers() { return {
|
|
@@ -179,22 +179,22 @@ const TabworthyTimesPicker = class {
|
|
|
179
179
|
const displayHours = this.getDisplayHours();
|
|
180
180
|
const maxHours = this.useTwelveHourFormat ? 12 : 23;
|
|
181
181
|
const minHours = this.useTwelveHourFormat ? 1 : 0;
|
|
182
|
-
return (index.h(index.Host, { key: '
|
|
182
|
+
return (index.h(index.Host, { key: '878156f105b2fb61aae67f866c1c436f038d1671', class: this.elementClassName, "aria-label": this.labels.timePicker }, index.h("div", { key: '7b6265d1de95da5423d0d7fcfc6da5e283b64650', class: `${this.elementClassName}__container` }, index.h("div", { key: '6e64ffa764916fb2bad7b88c30eed4ce3de141ed', class: `${this.elementClassName}__field` }, index.h("label", { key: '0b9f82f319299fc3f177ec131f3bcb2d911cae6c', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
183
183
|
[`${this.elementClassName}__label`]: true,
|
|
184
184
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
185
|
-
} }, this.labels.hours), index.h("div", { key: '
|
|
185
|
+
} }, this.labels.hours), index.h("div", { key: '0b7c4a24255319fe373aacf275583a6ccf1415ea', class: `${this.elementClassName}__control` }, index.h("button", { key: '24aff5877ad7cb189a6a9118f45e912ee2f97bec', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, index.h("svg", { key: '681c818b4e10bc442aca0795024153dda43e6e27', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: '0f86f34c93f99536623d793429bae7109aa29996', points: "18 15 12 9 6 15" }))), index.h("input", { key: '26043b87943641bdab9322413a36e0019980ef87', id: `${this.elementClassName}-hours`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(displayHours), min: minHours, max: maxHours, onInput: this.handleHourChange, disabled: this.disabled, "aria-label": this.labels.hours }), index.h("button", { key: 'd9617f2300e5457bd6480136d33905b35a2c2aba', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, index.h("svg", { key: '468f599326f2a01c873e963ef30904e66dead729', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: '0c54d3e34df989d2514dc95c3e660d94bda4819d', points: "6 9 12 15 18 9" }))))), index.h("div", { key: '0435c24eb991f0746f1388d440e175d20ba4230a', class: `${this.elementClassName}__separator` }, ":"), index.h("div", { key: '1dfb26b32d394101e9a85845d7cb2588c7c2fc63', class: `${this.elementClassName}__field` }, index.h("label", { key: '06e3318c7cd7cd56bc9b1f2616520af38e22501e', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
186
186
|
[`${this.elementClassName}__label`]: true,
|
|
187
187
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
188
|
-
} }, this.labels.minutes), index.h("div", { key: '
|
|
189
|
-
index.h("div", { key: '
|
|
190
|
-
index.h("div", { key: '
|
|
188
|
+
} }, this.labels.minutes), index.h("div", { key: '933a0911a02b79fbcd573e0f0ed942fe1f23b7e8', class: `${this.elementClassName}__control` }, index.h("button", { key: 'e3a124aab9297ae89ed8deafdc1f2e4066ede58b', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, index.h("svg", { key: 'cb33d7fd82b3e9e0293a83c80d0f4c750e381e03', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: 'd4fe518f8a5872da32e7093c0e5e6e7f168f7bfe', points: "18 15 12 9 6 15" }))), index.h("input", { key: '74bb5772b8c12697148e68fbf203184e097bfe40', 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 }), index.h("button", { key: 'c93e42de64a96a379405942fd7bcd2e4c9430c77', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, index.h("svg", { key: '0d9eb6746bf467c2275447ec8d6a63f8b17f63a4', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: 'beb0425b60d2277477c6ffb5b72ce89ccd7bed20', points: "6 9 12 15 18 9" }))))), this.showSeconds && [
|
|
189
|
+
index.h("div", { key: 'b686b7c464e70764bb8dcbec246c72bee6fa51b6', class: `${this.elementClassName}__separator` }, ":"),
|
|
190
|
+
index.h("div", { key: '9dadc9f5a410e40775bd5b28144ee62971448680', class: `${this.elementClassName}__field` }, index.h("label", { key: '233e50d7ddf4ea413ee652d20b917081485dbf93', htmlFor: `${this.elementClassName}-seconds`, class: {
|
|
191
191
|
[`${this.elementClassName}__label`]: true,
|
|
192
192
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
193
|
-
} }, this.labels.seconds), index.h("div", { key: '
|
|
194
|
-
], this.useTwelveHourFormat && (index.h("div", { key: '
|
|
193
|
+
} }, this.labels.seconds), index.h("div", { key: 'df35e6750eeef49671e6a5f233e00a253459554d', class: `${this.elementClassName}__control` }, index.h("button", { key: '521ba9fa8eb10dbf5981c4bab9687479f7888ac9', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleSecondIncrement, disabled: this.disabled, "aria-label": this.labels.incrementSeconds }, index.h("svg", { key: '84d4ac4697aaf7c9042e301b629a254e4ceffc6a', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: '2af46da2a6c4c994ae67c44edb0b4180a6125336', points: "18 15 12 9 6 15" }))), index.h("input", { key: 'bee75b6dd68f723482c295af51250a94df35ab30', id: `${this.elementClassName}-seconds`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(this.internalSeconds), min: 0, max: 59, onInput: this.handleSecondChange, disabled: this.disabled, "aria-label": this.labels.seconds }), index.h("button", { key: 'fe1288605003497b92e739f4cec01f160e5a161a', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleSecondDecrement, disabled: this.disabled, "aria-label": this.labels.decrementSeconds }, index.h("svg", { key: 'ca3a8aa73620bc12095f4c6c9bdfd2c33901a6ff', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, index.h("polyline", { key: '3b68faee709705c929791e9cc7f9e24738f035a1', points: "6 9 12 15 18 9" })))))
|
|
194
|
+
], this.useTwelveHourFormat && (index.h("div", { key: '13f65cc5b94a8c498fd233bc72cbd3c9977c7541', class: `${this.elementClassName}__period` }, index.h("button", { key: '3d854b9b5aee10039b38af52513f12cf68e4c657', type: "button", class: {
|
|
195
195
|
[`${this.elementClassName}__period-button`]: true,
|
|
196
196
|
[`${this.elementClassName}__period-button--active`]: this.period === "AM"
|
|
197
|
-
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), index.h("button", { key: '
|
|
197
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), index.h("button", { key: 'de12f50f898625cbd5b6afb65e2f396441ab5cf0', type: "button", class: {
|
|
198
198
|
[`${this.elementClassName}__period-button`]: true,
|
|
199
199
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
200
200
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|
|
@@ -35,9 +35,10 @@ const defaultLabels = {
|
|
|
35
35
|
disabledDateError: `Please choose an available date`,
|
|
36
36
|
to: "to",
|
|
37
37
|
startDate: "Start date",
|
|
38
|
+
yearSelect: "Select year",
|
|
38
39
|
timeLabel: "Time"
|
|
39
40
|
};
|
|
40
|
-
const
|
|
41
|
+
const TabworthyTimes = class {
|
|
41
42
|
constructor(hostRef) {
|
|
42
43
|
index.registerInstance(this, hostRef);
|
|
43
44
|
this.selectDateTime = index.createEvent(this, "selectDateTime", 7);
|
|
@@ -151,13 +152,35 @@ const InclusiveTimes = class {
|
|
|
151
152
|
};
|
|
152
153
|
this.handleInputChange = (event) => {
|
|
153
154
|
const value = event.target.value;
|
|
154
|
-
//
|
|
155
|
-
|
|
155
|
+
// Handle empty input
|
|
156
|
+
if (value.length === 0) {
|
|
157
|
+
this.errorState = false;
|
|
158
|
+
this.internalValue = "";
|
|
159
|
+
if (this.pickerRef) {
|
|
160
|
+
this.pickerRef.value = null;
|
|
161
|
+
}
|
|
162
|
+
this.value = this.internalValue;
|
|
163
|
+
return this.selectDateTime.emit(this.internalValue);
|
|
164
|
+
}
|
|
165
|
+
// Try to parse the input value using the component's format first (strict mode)
|
|
166
|
+
// This prevents dayjs from misinterpreting date formats (e.g., DD/MM/YYYY as MM/DD/YYYY)
|
|
167
|
+
let parsed = customParseFormat.dayjs(value, this.format, true);
|
|
168
|
+
// Fall back to loose parsing if strict format doesn't match
|
|
169
|
+
if (!parsed.isValid()) {
|
|
170
|
+
parsed = customParseFormat.dayjs(value);
|
|
171
|
+
}
|
|
156
172
|
if (parsed.isValid()) {
|
|
173
|
+
this.errorState = false;
|
|
157
174
|
this.selectedHours = parsed.hour();
|
|
158
175
|
this.selectedMinutes = parsed.minute();
|
|
176
|
+
this.selectedSeconds = parsed.second();
|
|
159
177
|
this.updateValue(parsed.toDate());
|
|
160
178
|
}
|
|
179
|
+
else {
|
|
180
|
+
// Set error state for invalid/garbage input
|
|
181
|
+
this.errorState = true;
|
|
182
|
+
this.errorMessage = this.timesLabels.invalidDateError;
|
|
183
|
+
}
|
|
161
184
|
};
|
|
162
185
|
}
|
|
163
186
|
shouldInputFormat() {
|
|
@@ -272,10 +295,10 @@ const InclusiveTimes = class {
|
|
|
272
295
|
}
|
|
273
296
|
render() {
|
|
274
297
|
var _a;
|
|
275
|
-
return (index.h(index.Host, { key: '
|
|
298
|
+
return (index.h(index.Host, { key: '87a26428aa34838553ab9d888d59bdd662912d4d', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, index.h("label", { key: '5e9168376f6f770edc72718843e3d393e3a8c8df', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), index.h("div", { key: 'ca9b0ce61d685fea6a547043e3e345958d893473', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, index.h("input", { key: '35a57d49bd8660abf1aef8f496df0df0fc357712', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
|
|
276
299
|
[this.getClassName("input")]: true,
|
|
277
300
|
[this.inputClass]: !!this.inputClass
|
|
278
|
-
}, 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 && (index.h("button", { key: '
|
|
301
|
+
}, 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 && (index.h("button", { key: '3144ec32c0866b120c27963a253fff87f8a73285', type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (index.h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), index.h("tabworthy-dates-modal", { key: '6a5e765432ebe1eda8a02333d699033ec9f392ea', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
279
302
|
if (this.pickerRef) {
|
|
280
303
|
this.pickerRef.modalIsOpen = true;
|
|
281
304
|
}
|
|
@@ -283,7 +306,7 @@ const InclusiveTimes = class {
|
|
|
283
306
|
if (this.pickerRef) {
|
|
284
307
|
this.pickerRef.modalIsOpen = false;
|
|
285
308
|
}
|
|
286
|
-
}, inline: this.inline, appendTo: this.appendTo }, index.h("div", { key: '
|
|
309
|
+
}, inline: this.inline, appendTo: this.appendTo }, index.h("div", { key: 'ed1f2484ba3c2541009e86d1e0500e76561007fa', class: this.getClassName("picker-container") }, index.h("tabworthy-dates-calendar", { key: 'db96a7d4e2844c8825f5f774616b449164de3273', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), onRequestClose: () => { var _a; return (_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close(); }, 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, showCloseButton: this.showCloseButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined }, index.h("div", { key: '146f445a91fae0d132cbf90ee5a23c457773857a', slot: "after-calendar", class: this.getClassName("time-section") }, index.h("hr", { key: 'e55e8dddbddca29d720d343d7ee8fa8fac80f2f4', class: this.getClassName("divider") }), index.h("tabworthy-times-picker", { key: '23857ca0f4874d5b2c0da426d8063072e1eee4a8', hours: this.selectedHours, minutes: this.selectedMinutes, seconds: this.selectedSeconds, showSeconds: this.showSeconds, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels }))))), this.errorState && (index.h("div", { key: '93cd7dcd8101e0bf9f5f4f81dd1dc8cb19997fd5', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
287
310
|
}
|
|
288
311
|
get el() { return index.getElement(this); }
|
|
289
312
|
static get watchers() { return {
|
|
@@ -299,4 +322,4 @@ const InclusiveTimes = class {
|
|
|
299
322
|
}; }
|
|
300
323
|
};
|
|
301
324
|
|
|
302
|
-
exports.tabworthy_times =
|
|
325
|
+
exports.tabworthy_times = TabworthyTimes;
|
|
@@ -12,6 +12,7 @@ const defaultLabels = {
|
|
|
12
12
|
invalidDateError: "We could not find a matching date",
|
|
13
13
|
minDateError: `Please fill in a date after `,
|
|
14
14
|
maxDateError: `Please fill in a date before `,
|
|
15
|
+
yearSelect: "Select year",
|
|
15
16
|
rangeOutOfBoundsError: `Please enter a valid range of dates`,
|
|
16
17
|
disabledDateError: `Please choose an available date`,
|
|
17
18
|
to: "to",
|
|
@@ -22,6 +23,8 @@ export class TabworthyDates {
|
|
|
22
23
|
constructor() {
|
|
23
24
|
// Enable or disable range mode
|
|
24
25
|
this.range = false;
|
|
26
|
+
// Enable year-only mode (shows only year input, no calendar)
|
|
27
|
+
this.yearOnly = false;
|
|
25
28
|
// A label for the text field
|
|
26
29
|
this.label = this.range
|
|
27
30
|
? "Choose a date range (any way you like)"
|
|
@@ -131,6 +134,23 @@ export class TabworthyDates {
|
|
|
131
134
|
var _a;
|
|
132
135
|
(_a = this.changeYear) === null || _a === void 0 ? void 0 : _a.emit(yearDetail);
|
|
133
136
|
};
|
|
137
|
+
this.handleYearInputChange = (event) => {
|
|
138
|
+
var _a;
|
|
139
|
+
const year = +event.target.value;
|
|
140
|
+
if (!year || isNaN(year))
|
|
141
|
+
return;
|
|
142
|
+
const minYear = this.minDate ? parseInt(this.minDate.slice(0, 4), 10) : 1;
|
|
143
|
+
const maxYear = this.maxDate
|
|
144
|
+
? parseInt(this.maxDate.slice(0, 4), 10)
|
|
145
|
+
: 9999;
|
|
146
|
+
if (year < minYear || year > maxYear)
|
|
147
|
+
return;
|
|
148
|
+
const newValue = dayjs().year(year).startOf("year").format(this.format);
|
|
149
|
+
this.internalValue = newValue;
|
|
150
|
+
this.value = newValue;
|
|
151
|
+
(_a = this.changeYear) === null || _a === void 0 ? void 0 : _a.emit({ year });
|
|
152
|
+
this.selectDate.emit(newValue);
|
|
153
|
+
};
|
|
134
154
|
this.handleRangeChange = async (value) => {
|
|
135
155
|
this.errorState = false;
|
|
136
156
|
if (value.length === 0) {
|
|
@@ -443,10 +463,21 @@ export class TabworthyDates {
|
|
|
443
463
|
}
|
|
444
464
|
render() {
|
|
445
465
|
var _a;
|
|
446
|
-
|
|
466
|
+
// Year-only mode: show just a year number input
|
|
467
|
+
if (this.yearOnly) {
|
|
468
|
+
const currentYear = this.value
|
|
469
|
+
? parseInt(String(this.value).slice(0, 4), 10)
|
|
470
|
+
: new Date().getFullYear();
|
|
471
|
+
return (h(Host, null, h("label", { htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", null), h("div", { class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { "aria-label": this.datesLabels.yearSelect, class: {
|
|
472
|
+
[this.getClassName("year-select")]: true,
|
|
473
|
+
[this.getClassName("input")]: true,
|
|
474
|
+
[this.inputClass]: !!this.inputClass
|
|
475
|
+
}, "aria-disabled": this.disabledState, disabled: this.disabledState, max: this.maxDate ? this.maxDate.slice(0, 4) : 9999, min: this.minDate ? this.minDate.slice(0, 4) : 1, name: "year", id: this.id ? `${this.id}-input` : undefined, onChange: this.handleYearInputChange, type: "number", value: currentYear, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState })), this.errorState && (h("div", { class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
476
|
+
}
|
|
477
|
+
return (h(Host, null, h("label", { htmlFor: this.id ? `${this.id}-input` : undefined, class: this.getClassName("label") }, this.label), h("br", null), h("div", { class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { disabled: this.disabledState || this.disableFreeformInput, id: this.id ? `${this.id}-input` : undefined, type: "text", placeholder: this.placeholder, class: {
|
|
447
478
|
[this.getClassName("input")]: true,
|
|
448
479
|
[this.inputClass]: !!this.inputClass
|
|
449
|
-
}, 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", {
|
|
480
|
+
}, 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", { 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", { label: this.datesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
450
481
|
if (!this.pickerRef)
|
|
451
482
|
return;
|
|
452
483
|
this.pickerRef.modalIsOpen = true;
|
|
@@ -454,11 +485,11 @@ export class TabworthyDates {
|
|
|
454
485
|
if (!this.pickerRef)
|
|
455
486
|
return;
|
|
456
487
|
this.pickerRef.modalIsOpen = false;
|
|
457
|
-
}, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", {
|
|
488
|
+
}, inline: this.inline, appendTo: this.appendTo }, h("tabworthy-dates-calendar", { range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), onRequestClose: () => { var _a; return (_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close(); }, 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, showCloseButton: this.showCloseButton, showKeyboardHint: this.showKeyboardHint, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline })), this.showQuickButtons &&
|
|
458
489
|
((_a = this.quickButtons) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
459
|
-
this.chronoSupportedLocale && (h("div", {
|
|
490
|
+
this.chronoSupportedLocale && (h("div", { class: this.getClassName("quick-group"), role: "group", "aria-label": this.datesLabels.quickSelection }, this.quickButtons.map((buttonText) => {
|
|
460
491
|
return (h("button", { class: this.getClassName("quick-button"), onClick: this.handleQuickButtonClick, disabled: this.disabledState, type: "button" }, buttonText));
|
|
461
|
-
}))), this.errorState && (h("div", {
|
|
492
|
+
}))), this.errorState && (h("div", { class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
462
493
|
}
|
|
463
494
|
static get is() { return "tabworthy-dates"; }
|
|
464
495
|
static get encapsulation() { return "scoped"; }
|
|
@@ -532,6 +563,26 @@ export class TabworthyDates {
|
|
|
532
563
|
"attribute": "range",
|
|
533
564
|
"defaultValue": "false"
|
|
534
565
|
},
|
|
566
|
+
"yearOnly": {
|
|
567
|
+
"type": "boolean",
|
|
568
|
+
"mutable": false,
|
|
569
|
+
"complexType": {
|
|
570
|
+
"original": "boolean",
|
|
571
|
+
"resolved": "boolean",
|
|
572
|
+
"references": {}
|
|
573
|
+
},
|
|
574
|
+
"required": false,
|
|
575
|
+
"optional": true,
|
|
576
|
+
"docs": {
|
|
577
|
+
"tags": [],
|
|
578
|
+
"text": ""
|
|
579
|
+
},
|
|
580
|
+
"getter": false,
|
|
581
|
+
"setter": false,
|
|
582
|
+
"reflect": false,
|
|
583
|
+
"attribute": "year-only",
|
|
584
|
+
"defaultValue": "false"
|
|
585
|
+
},
|
|
535
586
|
"label": {
|
|
536
587
|
"type": "string",
|
|
537
588
|
"mutable": false,
|
|
@@ -17,7 +17,7 @@ const defaultLabels = {
|
|
|
17
17
|
chooseAsStartDate: "choose as start date",
|
|
18
18
|
chooseAsEndDate: "choose as end date"
|
|
19
19
|
};
|
|
20
|
-
export class
|
|
20
|
+
export class TabworthyDatesCalendar {
|
|
21
21
|
constructor() {
|
|
22
22
|
this.disabled = false;
|
|
23
23
|
this.modalIsOpen = false;
|
|
@@ -5,7 +5,7 @@ import { createPopper } from "@popperjs/core";
|
|
|
5
5
|
/**
|
|
6
6
|
* @slot slot - The dialog content
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class TabworthyDatesModal {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.inline = false;
|
|
11
11
|
/** Preferred placement of the dropdown (Popper.js placement) */
|
|
@@ -190,7 +190,7 @@ export class InclusiveDatesModal {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
render() {
|
|
193
|
-
return (h(Host, { key: '
|
|
193
|
+
return (h(Host, { key: '488fb845bb3a168c45f715b5f7315a80e1857589', showing: this.showing, ref: (r) => r && (this.el = r) }, !this.inline && this.showing && (h("div", { key: 'd6263beffa3dbeaa7f0e5e65c1f2627c07164648', part: "body", ref: (r) => {
|
|
194
194
|
if (r) {
|
|
195
195
|
this.bodyRef = r;
|
|
196
196
|
// Setup portal and create popper when ref is set
|
|
@@ -207,7 +207,7 @@ export class InclusiveDatesModal {
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
}, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: '
|
|
210
|
+
}, style: { visibility: this.positioned ? "visible" : "hidden" }, onKeyDown: this.onKeyDown, role: "dialog", tabindex: -1, "aria-hidden": !this.showing, "aria-label": this.label, "aria-modal": this.showing }, h("focus-trap", { key: '7ffb9cc684198ab9f3b127a4abe5f60f3241cd49' }, h("div", { key: 'c6c7c14220c01969f3a5c92dda882685f4c43268', part: "content" }, h("slot", { key: 'a1e6ce7ed152f61b3970e20b40e36bb13ee7580a' }))))), this.inline && (h("div", { key: '632750cfce76139771642e03051f5c4a654db56a', part: "content" }, h("slot", { key: 'c1aa297a6ffdeee55840a9e05adddb7220e7f954' })))));
|
|
211
211
|
}
|
|
212
212
|
static get is() { return "tabworthy-dates-modal"; }
|
|
213
213
|
static get encapsulation() { return "shadow"; }
|