@tabworthy/components 0.12.4 → 0.13.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 +35 -17
- package/dist/cjs/tabworthy-dates.cjs.entry.js +58 -10
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +82 -10
- package/dist/cjs/tabworthy-times.cjs.entry.js +147 -6
- package/dist/cjs/{utils-y5Vtky2t.js → utils-DGbdK8VF.js} +29 -8
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +78 -10
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +35 -17
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +167 -5
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +128 -10
- package/dist/components/p-BzY8iIVW.js +1 -0
- package/dist/components/p-C_uZGgcG.js +1 -0
- package/dist/components/tabworthy-dates-calendar.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 +35 -17
- package/dist/esm/tabworthy-dates.entry.js +58 -10
- package/dist/esm/tabworthy-times-picker.entry.js +82 -10
- package/dist/esm/tabworthy-times.entry.js +147 -6
- package/dist/esm/{utils-BVHu5CWV.js → utils-CoFOnMSw.js} +29 -9
- package/dist/shared/utils/utils.js +28 -8
- package/dist/tabworthy-components/p-4eedf24e.entry.js +1 -0
- package/dist/tabworthy-components/p-69334c34.entry.js +1 -0
- package/dist/tabworthy-components/p-7cd6ccc1.entry.js +1 -0
- package/dist/tabworthy-components/{p-BVHu5CWV.js → p-CoFOnMSw.js} +1 -1
- package/dist/tabworthy-components/p-b6a5d970.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 +7 -0
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +13 -1
- package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +15 -0
- package/dist/types/components.d.ts +14 -4
- package/dist/types/home/runner/work/tabworthy-components/tabworthy-components/.stencil/shared/utils/utils.d.ts +6 -0
- package/package.json +1 -1
- package/dist/components/p-BTQaxOHo.js +0 -1
- package/dist/components/p-DAc3jaFB.js +0 -1
- package/dist/tabworthy-components/p-1743bf7a.entry.js +0 -1
- package/dist/tabworthy-components/p-28192b55.entry.js +0 -1
- package/dist/tabworthy-components/p-3b548ae1.entry.js +0 -1
- package/dist/tabworthy-components/p-626a5c0b.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"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-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"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"minTime":[16],"maxTime":[16],"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"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-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"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-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"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"minTime":[16],"maxTime":[16],"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"],"nextMonthButtonContent":[1,"next-month-button-content"],"nextYearButtonContent":[1,"next-year-button-content"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-year-button-content"],"todayButtonContent":[1,"today-button-content"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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"],"previousMonthButtonContent":[1,"previous-month-button-content"],"previousYearButtonContent":[1,"previous-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"],"clearButtonContent":[1,"clear-button-content"],"closeButtonContent":[1,"close-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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-B1s0tI-Z.js');
|
|
4
|
-
var utils = require('./utils-
|
|
4
|
+
var utils = require('./utils-DGbdK8VF.js');
|
|
5
5
|
|
|
6
6
|
const tabworthyDatesCalendarCss = () => `.visually-hidden.sc-tabworthy-dates-calendar{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%)}`;
|
|
7
7
|
|
|
@@ -52,16 +52,34 @@ const TabworthyDatesCalendar = class {
|
|
|
52
52
|
this.updateWeekdays();
|
|
53
53
|
};
|
|
54
54
|
this.nextMonth = () => {
|
|
55
|
-
|
|
55
|
+
const next = utils.getNextMonth(this.currentDate);
|
|
56
|
+
if (this.disabled ||
|
|
57
|
+
utils.monthIsDisabled(next.getMonth(), next.getFullYear(), this.minDate, this.maxDate))
|
|
58
|
+
return;
|
|
59
|
+
this.updateCurrentDate(next);
|
|
56
60
|
};
|
|
57
61
|
this.nextYear = () => {
|
|
58
|
-
|
|
62
|
+
const next = utils.getNextYear(this.currentDate);
|
|
63
|
+
if (this.disabled ||
|
|
64
|
+
(this.maxDate &&
|
|
65
|
+
utils.parseDateString(this.maxDate).getFullYear() < next.getFullYear()))
|
|
66
|
+
return;
|
|
67
|
+
this.updateCurrentDate(next, false, true);
|
|
59
68
|
};
|
|
60
69
|
this.previousMonth = () => {
|
|
61
|
-
|
|
70
|
+
const prev = utils.getPreviousMonth(this.currentDate);
|
|
71
|
+
if (this.disabled ||
|
|
72
|
+
utils.monthIsDisabled(prev.getMonth(), prev.getFullYear(), this.minDate, this.maxDate))
|
|
73
|
+
return;
|
|
74
|
+
this.updateCurrentDate(prev);
|
|
62
75
|
};
|
|
63
76
|
this.previousYear = () => {
|
|
64
|
-
|
|
77
|
+
const prev = utils.getPreviousYear(this.currentDate);
|
|
78
|
+
if (this.disabled ||
|
|
79
|
+
(this.minDate &&
|
|
80
|
+
utils.parseDateString(this.minDate).getFullYear() > prev.getFullYear()))
|
|
81
|
+
return;
|
|
82
|
+
this.updateCurrentDate(prev, false, true);
|
|
65
83
|
};
|
|
66
84
|
this.showToday = () => {
|
|
67
85
|
this.updateCurrentDate(new Date(), true);
|
|
@@ -265,9 +283,9 @@ const TabworthyDatesCalendar = class {
|
|
|
265
283
|
const month = date.getMonth();
|
|
266
284
|
const year = date.getFullYear();
|
|
267
285
|
if (!utils.dateIsWithinLowerBounds(date, this.minDate))
|
|
268
|
-
date =
|
|
286
|
+
date = utils.parseDateString(this.minDate);
|
|
269
287
|
if (!utils.dateIsWithinUpperBounds(date, this.maxDate))
|
|
270
|
-
date =
|
|
288
|
+
date = utils.parseDateString(this.maxDate);
|
|
271
289
|
const monthChanged = month !== ((_a = this.currentDate) === null || _a === void 0 ? void 0 : _a.getMonth()) ||
|
|
272
290
|
year !== this.currentDate.getFullYear();
|
|
273
291
|
if (monthChanged) {
|
|
@@ -324,11 +342,11 @@ const TabworthyDatesCalendar = class {
|
|
|
324
342
|
year: {
|
|
325
343
|
prev: this.disabled ||
|
|
326
344
|
(!!this.minDate &&
|
|
327
|
-
|
|
345
|
+
utils.parseDateString(this.minDate).getFullYear() >
|
|
328
346
|
utils.getPreviousYear(this.currentDate).getFullYear()),
|
|
329
347
|
next: this.disabled ||
|
|
330
348
|
(!!this.maxDate &&
|
|
331
|
-
|
|
349
|
+
utils.parseDateString(this.maxDate).getFullYear() <
|
|
332
350
|
utils.getNextYear(this.currentDate).getFullYear())
|
|
333
351
|
},
|
|
334
352
|
month: {
|
|
@@ -338,15 +356,15 @@ const TabworthyDatesCalendar = class {
|
|
|
338
356
|
utils.monthIsDisabled(utils.getNextMonth(this.currentDate).getMonth(), utils.getNextMonth(this.currentDate).getFullYear(), this.minDate, this.maxDate)
|
|
339
357
|
}
|
|
340
358
|
};
|
|
341
|
-
return (index.h(index.Host, { key: '
|
|
359
|
+
return (index.h(index.Host, { key: '60e2a56f8a1aadceb57d7f445098060293a0f937' }, index.h("div", { key: '12fd35c03b0c34e4ad88e4e491fcc685de5f09b2', class: {
|
|
342
360
|
[`${this.getClassName()}-wrapper`]: true,
|
|
343
361
|
[`${this.getClassName()}-wrapper--inline`]: this.inline
|
|
344
|
-
} }, index.h("div", { key: '
|
|
362
|
+
} }, index.h("div", { key: 'ad36d1e260a7a89110c53fc86e339eb5a259a4fc', class: {
|
|
345
363
|
[this.getClassName()]: true,
|
|
346
364
|
[`${this.getClassName()}--disabled`]: this.disabled
|
|
347
|
-
} }, index.h("div", { key: '
|
|
365
|
+
} }, index.h("div", { key: '181b9ed0a6a9d6073d67f270d6b14efc28f6a6b2', class: this.getClassName("header") }, this.showHiddenTitle && (index.h("span", { key: '580656924dc3ba028458591399791423797d58d7', "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle())), this.showYearStepper && (index.h("button", { key: '7822100c140418bc3cb65ae39a32a3ebc1f53bc2', "aria-label": this.labels.previousYearButton, class: this.getClassName("previous-year-button"), "aria-disabled": disabled.year.prev, innerHTML: this.previousYearButtonContent || undefined, onClick: this.previousYear, type: "button" }, index.h("svg", { key: '9408d89cf59c268c3e44801297f1a7776a594539', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { key: 'b9108784891de5eb7acef5c14425e90c25fc514a', points: "11 17 6 12 11 7" }), index.h("polyline", { key: 'a2fbabe46f6a0584d5c4b54296b9db13e979c818', points: "18 17 13 12 18 7" })))), this.showMonthStepper && (index.h("button", { key: '8e515d4fa9fde9f0e16fc2ff5629049039df09e0', "aria-label": this.labels.previousMonthButton, class: this.getClassName("previous-month-button"), "aria-disabled": disabled.month.prev, innerHTML: this.previousMonthButtonContent || undefined, onClick: this.previousMonth, type: "button" }, index.h("svg", { key: '5248668ca2f843102193fb57beb8a3a4b4edbb96', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { key: '021c514ec8fb801fd0d3dbf250fc8d55b9c9ef08', points: "15 18 9 12 15 6" })))), index.h("span", { key: '8fab6b75376e1399b6ea07e3545ddcfa3eb120d8', class: this.getClassName("current-month") }, index.h("select", { key: '01f8fbd5a76c91b0bf121c2589af72860abe2a22', "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), "aria-disabled": this.disabled, name: "month", onChange: this.onMonthSelect }, utils.getMonths(this.locale).map((month, index$1) => {
|
|
348
366
|
return (index.h("option", { key: month, selected: this.currentDate.getMonth() === index$1, value: index$1 + 1, disabled: utils.monthIsDisabled(index$1, this.currentDate.getFullYear(), this.minDate, this.maxDate) }, month));
|
|
349
|
-
})), index.h("input", { key: '
|
|
367
|
+
})), index.h("input", { key: 'cb126814e09a6ae81ce8a6db10152decef97d66a', "aria-label": this.labels.yearSelect, class: this.getClassName("year-select"), "aria-disabled": this.disabled, max: this.maxDate ? this.maxDate.slice(0, 4) : 9999, min: this.minDate ? this.minDate.slice(0, 4) : 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && (index.h("button", { key: '9ad3e382b769ada1ecb746a55c37c54d0c6b06e1', "aria-label": this.labels.nextMonthButton, class: this.getClassName("next-month-button"), "aria-disabled": disabled.month.next, innerHTML: this.nextMonthButtonContent || undefined, onClick: this.nextMonth, type: "button" }, index.h("svg", { key: '7ecdf33b13950c8972b5b3a66bd086f700967fad', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { key: '78768373bb23d06e8babd79a77fb0a899ea5e942', points: "9 18 15 12 9 6" })))), this.showYearStepper && (index.h("button", { key: 'ab920b5dbdf0bf6000c58718d0d3a0e9a31bbebd', "aria-label": this.labels.nextYearButton, class: this.getClassName("next-year-button"), "aria-disabled": disabled.year.next, innerHTML: this.nextYearButtonContent || undefined, onClick: this.nextYear, type: "button" }, index.h("svg", { key: '7f5c83e6333e6c33984961722c855f2609e0999e', fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { key: 'dd3eed1b08d0373a089beb91eb9cb6b62b477b3b', points: "13 17 18 12 13 7" }), index.h("polyline", { key: 'fa989db37ceaf95817aef623770b895b3c10d0b4', points: "6 17 11 12 6 7" }))))), index.h("div", { key: '5b41060ca782df39e19ba35ec71d4425ae5c3a2a', class: this.getClassName("body") }, index.h("table", { key: '357337fd3a5f05cc204982682c99f99c46dd4b29', class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid", "aria-label": this.getTitle() }, index.h("thead", { key: '8fa7ecfada004b39dd406eb9079de3eab66fe298', class: this.getClassName("calendar-header") }, index.h("tr", { key: '364f6021007700c2da60082fca32e4896e071ccd', class: this.getClassName("weekday-row") }, (_a = this.weekdays) === null || _a === void 0 ? void 0 : _a.map((weekday) => (index.h("th", { role: "columnheader", abbr: weekday[1], class: this.getClassName("weekday"), key: weekday[0], scope: "col" }, index.h("span", { "aria-hidden": "true" }, weekday[0]), index.h("span", { class: "visually-hidden" }, weekday[1])))))), index.h("tbody", { key: 'e0269bd5bfe1310a8950635441edc472e3a5f413' }, this.getCalendarRows().map((calendarRow) => {
|
|
350
368
|
const rowKey = `row-${calendarRow[0].getMonth()}-${calendarRow[0].getDate()}`;
|
|
351
369
|
return (index.h("tr", { class: this.getClassName("calendar-row"), key: rowKey }, calendarRow.map((day) => {
|
|
352
370
|
var _a, _b, _c;
|
|
@@ -413,14 +431,14 @@ const TabworthyDatesCalendar = class {
|
|
|
413
431
|
? 0
|
|
414
432
|
: -1 }, index.h(Tag, { "aria-hidden": "true" }, day.getDate()), index.h("span", { class: "visually-hidden" }, getScreenReaderText())));
|
|
415
433
|
})));
|
|
416
|
-
})))), showFooter && (index.h("div", { key: '
|
|
434
|
+
})))), showFooter && (index.h("div", { key: '4d18b821b06e4eb7fd2f1a1210fcab01d3acdd00', class: this.getClassName("footer") }, index.h("div", { key: 'fec534b0bff03bfe3e15a8842abbcca9b57e9a1c', class: this.getClassName("footer-buttons") }, this.showTodayButton && (index.h("button", { key: '0d8aed7413f313c2ab6aa9a634093de1d46cd7ce', "aria-label": this.todayButtonContent
|
|
417
435
|
? this.labels.todayButton
|
|
418
|
-
: undefined, class: this.getClassName("today-button"), disabled: this.disabled, innerHTML: this.todayButtonContent || undefined, onClick: this.showToday, type: "button" }, !this.todayButtonContent && this.labels.todayButton)), this.showClearButton && (index.h("button", { key: '
|
|
436
|
+
: undefined, class: this.getClassName("today-button"), disabled: this.disabled, innerHTML: this.todayButtonContent || undefined, onClick: this.showToday, type: "button" }, !this.todayButtonContent && this.labels.todayButton)), this.showClearButton && (index.h("button", { key: '176c535cb85d6b95d40324a55aa11e1bc2faaa61', "aria-label": this.clearButtonContent
|
|
419
437
|
? this.labels.clearButton
|
|
420
|
-
: undefined, class: this.getClassName("clear-button"), disabled: this.disabled, innerHTML: this.clearButtonContent || undefined, onClick: this.clear, type: "button" }, !this.clearButtonContent && this.labels.clearButton)), this.showCloseButton && (index.h("button", { key: '
|
|
438
|
+
: undefined, class: this.getClassName("clear-button"), disabled: this.disabled, innerHTML: this.clearButtonContent || undefined, onClick: this.clear, type: "button" }, !this.clearButtonContent && this.labels.clearButton)), this.showCloseButton && (index.h("button", { key: 'cea15baf92edabea6841510459c6b05ebfaf81fa', "aria-label": this.closeButtonContent
|
|
421
439
|
? this.labels.closeButton
|
|
422
440
|
: undefined, class: this.getClassName("close-button"), disabled: this.disabled, innerHTML: this.closeButtonContent || undefined, onClick: this.close, type: "button" }, !this.closeButtonContent && this.labels.closeButton))), this.showKeyboardHint &&
|
|
423
|
-
!window.matchMedia("(pointer: coarse)").matches && (index.h("button", { key: '
|
|
441
|
+
!window.matchMedia("(pointer: coarse)").matches && (index.h("button", { key: '51a48353fbb94243d93047141e26b8c8ef5545b2', type: "button", onClick: () => alert("Todo: Add Keyboard helper!"), class: this.getClassName("keyboard-hint") }, index.h("svg", { key: '2991aa978689e3a0bd4c795a8629451e252ccf41', xmlns: "http://www.w3.org/2000/svg", height: "1em", width: "1em", viewBox: "0 0 48 48", fill: "currentColor" }, index.h("path", { key: 'b84c3846f234a79e8c78eae3118aa2a9f24b8377', d: "M7 38q-1.2 0-2.1-.925Q4 36.15 4 35V13q0-1.2.9-2.1.9-.9 2.1-.9h34q1.2 0 2.1.9.9.9.9 2.1v22q0 1.15-.9 2.075Q42.2 38 41 38Zm0-3h34V13H7v22Zm8-3.25h18v-3H15Zm-4.85-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm-24.7-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3ZM7 35V13v22Z" })), this.labels.keyboardHint))))), index.h("slot", { key: '86e8fb8907bf11951461baaf41f92b29ce0cc413', name: "after-calendar" }))));
|
|
424
442
|
}
|
|
425
443
|
get el() { return index.getElement(this); }
|
|
426
444
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index$1 = require('./index-B1s0tI-Z.js');
|
|
4
4
|
var customParseFormat = require('./customParseFormat-l09KVyWD.js');
|
|
5
|
-
var utils = require('./utils-
|
|
5
|
+
var utils = require('./utils-DGbdK8VF.js');
|
|
6
6
|
|
|
7
7
|
function _mergeNamespaces(n, m) {
|
|
8
8
|
m.forEach(function (e) {
|
|
@@ -10488,6 +10488,7 @@ const TabworthyDates = class {
|
|
|
10488
10488
|
index$1.registerInstance(this, hostRef);
|
|
10489
10489
|
this.selectDate = index$1.createEvent(this, "selectDate", 7);
|
|
10490
10490
|
this.changeYear = index$1.createEvent(this, "changeYear", 7);
|
|
10491
|
+
this.errorChange = index$1.createEvent(this, "errorChange", 7);
|
|
10491
10492
|
this.componentReady = index$1.createEvent(this, "componentReady", 7);
|
|
10492
10493
|
// Enable or disable range mode
|
|
10493
10494
|
this.range = false;
|
|
@@ -10652,6 +10653,7 @@ const TabworthyDates = class {
|
|
|
10652
10653
|
maxDate: ""
|
|
10653
10654
|
}[parsedRange.reason];
|
|
10654
10655
|
}
|
|
10656
|
+
this.emitErrorChange(parsedRange === null || parsedRange === void 0 ? void 0 : parsedRange.reason, this.errorMessage);
|
|
10655
10657
|
}
|
|
10656
10658
|
};
|
|
10657
10659
|
this.handleSingleDateChange = async (value) => {
|
|
@@ -10664,6 +10666,16 @@ const TabworthyDates = class {
|
|
|
10664
10666
|
this.value = this.internalValue;
|
|
10665
10667
|
return this.selectDate.emit(this.internalValue);
|
|
10666
10668
|
}
|
|
10669
|
+
// Try strict format parsing first to avoid DD/MM vs MM/DD ambiguity
|
|
10670
|
+
const strictParsed = customParseFormat.dayjs(value, this.format, true);
|
|
10671
|
+
if (strictParsed.isValid()) {
|
|
10672
|
+
const date = strictParsed.toDate();
|
|
10673
|
+
if (!this.isPickedDateValid(date))
|
|
10674
|
+
return;
|
|
10675
|
+
this.updateValue(date);
|
|
10676
|
+
this.formatInput(true, false);
|
|
10677
|
+
return;
|
|
10678
|
+
}
|
|
10667
10679
|
const parsedDate = await chronoParseDate(value, {
|
|
10668
10680
|
locale: this.locale.slice(0, 2),
|
|
10669
10681
|
minDate: this.minDate,
|
|
@@ -10674,6 +10686,7 @@ const TabworthyDates = class {
|
|
|
10674
10686
|
if (this.disableDate(parsedDate.value)) {
|
|
10675
10687
|
this.errorState = true;
|
|
10676
10688
|
this.errorMessage = this.datesLabels.disabledDateError;
|
|
10689
|
+
this.emitErrorChange("disabledDate", this.errorMessage);
|
|
10677
10690
|
}
|
|
10678
10691
|
else {
|
|
10679
10692
|
this.updateValue(parsedDate.value);
|
|
@@ -10686,30 +10699,31 @@ const TabworthyDates = class {
|
|
|
10686
10699
|
let maxDate = undefined;
|
|
10687
10700
|
let minDate = undefined;
|
|
10688
10701
|
if (this.maxDate) {
|
|
10689
|
-
maxDate = this.maxDate
|
|
10690
|
-
? utils.removeTimezoneOffset(new Date(this.maxDate))
|
|
10691
|
-
: undefined;
|
|
10702
|
+
maxDate = this.maxDate ? utils.parseDateString(this.maxDate) : undefined;
|
|
10692
10703
|
maxDate === null || maxDate === void 0 ? void 0 : maxDate.setDate(maxDate.getDate() + 1);
|
|
10693
10704
|
}
|
|
10694
10705
|
if (this.minDate) {
|
|
10695
|
-
minDate = this.minDate
|
|
10696
|
-
? utils.removeTimezoneOffset(new Date(this.minDate))
|
|
10697
|
-
: undefined;
|
|
10706
|
+
minDate = this.minDate ? utils.parseDateString(this.minDate) : undefined;
|
|
10698
10707
|
minDate === null || minDate === void 0 ? void 0 : minDate.setDate(minDate.getDate() - 1);
|
|
10699
10708
|
}
|
|
10700
10709
|
if (!!parsedDate.reason) {
|
|
10710
|
+
const formatLocalizedDate = (date) => Intl.DateTimeFormat(this.locale, {
|
|
10711
|
+
day: "numeric",
|
|
10712
|
+
month: "short",
|
|
10713
|
+
year: "numeric"
|
|
10714
|
+
}).format(date);
|
|
10701
10715
|
this.errorMessage = parsedDate.reason;
|
|
10702
10716
|
this.errorMessage = {
|
|
10703
|
-
// TODO: Add locale date formatting to these messages
|
|
10704
10717
|
minDate: minDate
|
|
10705
|
-
? `${this.datesLabels.minDateError} ${
|
|
10718
|
+
? `${this.datesLabels.minDateError} ${formatLocalizedDate(minDate)}`
|
|
10706
10719
|
: "",
|
|
10707
10720
|
maxDate: maxDate
|
|
10708
|
-
? `${this.datesLabels.maxDateError} ${
|
|
10721
|
+
? `${this.datesLabels.maxDateError} ${formatLocalizedDate(maxDate)}`
|
|
10709
10722
|
: "",
|
|
10710
10723
|
invalid: this.datesLabels.invalidDateError
|
|
10711
10724
|
}[parsedDate.reason];
|
|
10712
10725
|
}
|
|
10726
|
+
this.emitErrorChange(parsedDate === null || parsedDate === void 0 ? void 0 : parsedDate.reason, this.errorMessage);
|
|
10713
10727
|
}
|
|
10714
10728
|
};
|
|
10715
10729
|
this.handleChange = async (event) => {
|
|
@@ -10778,6 +10792,9 @@ const TabworthyDates = class {
|
|
|
10778
10792
|
this.selectDate.emit(this.internalValue);
|
|
10779
10793
|
this.announceDateChange(this.internalValue);
|
|
10780
10794
|
}
|
|
10795
|
+
emitErrorChange(reason, message) {
|
|
10796
|
+
this.errorChange.emit({ reason, message });
|
|
10797
|
+
}
|
|
10781
10798
|
formatInput(enabled, useInputValue = true) {
|
|
10782
10799
|
if (this.shouldInputFormat() === false || enabled === false) {
|
|
10783
10800
|
if (this.internalValue) {
|
|
@@ -10823,9 +10840,37 @@ const TabworthyDates = class {
|
|
|
10823
10840
|
}
|
|
10824
10841
|
}
|
|
10825
10842
|
}
|
|
10843
|
+
isPickedDateValid(dateString) {
|
|
10844
|
+
const parsed = customParseFormat.dayjs(dateString);
|
|
10845
|
+
if (!parsed.isValid())
|
|
10846
|
+
return false;
|
|
10847
|
+
const isoDate = typeof dateString === "string" ? dateString : parsed.format("YYYY-MM-DD");
|
|
10848
|
+
if (this.minDate && isoDate < this.minDate) {
|
|
10849
|
+
this.errorState = true;
|
|
10850
|
+
this.errorMessage = `${this.datesLabels.minDateError} ${this.minDate}`;
|
|
10851
|
+
this.emitErrorChange("minDate", this.errorMessage);
|
|
10852
|
+
return false;
|
|
10853
|
+
}
|
|
10854
|
+
if (this.maxDate && isoDate > this.maxDate) {
|
|
10855
|
+
this.errorState = true;
|
|
10856
|
+
this.errorMessage = `${this.datesLabels.maxDateError} ${this.maxDate}`;
|
|
10857
|
+
this.emitErrorChange("maxDate", this.errorMessage);
|
|
10858
|
+
return false;
|
|
10859
|
+
}
|
|
10860
|
+
if (this.disableDate(parsed.toDate())) {
|
|
10861
|
+
this.errorState = true;
|
|
10862
|
+
this.errorMessage = this.datesLabels.disabledDateError;
|
|
10863
|
+
this.emitErrorChange("disabledDate", this.errorMessage);
|
|
10864
|
+
return false;
|
|
10865
|
+
}
|
|
10866
|
+
return true;
|
|
10867
|
+
}
|
|
10826
10868
|
handlePickerSelection(newValue) {
|
|
10827
10869
|
var _a, _b;
|
|
10828
10870
|
if (this.isRangeValue(newValue)) {
|
|
10871
|
+
// Validate each date in the range
|
|
10872
|
+
if (newValue.some((date) => !this.isPickedDateValid(date)))
|
|
10873
|
+
return;
|
|
10829
10874
|
if (newValue.length === 2)
|
|
10830
10875
|
(_a = this.modalRef) === null || _a === void 0 ? void 0 : _a.close();
|
|
10831
10876
|
// Convert ISO dates to specified format
|
|
@@ -10837,6 +10882,9 @@ const TabworthyDates = class {
|
|
|
10837
10882
|
this.announceDateChange(this.internalValue);
|
|
10838
10883
|
}
|
|
10839
10884
|
else {
|
|
10885
|
+
// Validate the single date
|
|
10886
|
+
if (newValue && !this.isPickedDateValid(newValue))
|
|
10887
|
+
return;
|
|
10840
10888
|
(_b = this.modalRef) === null || _b === void 0 ? void 0 : _b.close();
|
|
10841
10889
|
// Convert ISO date to specified format
|
|
10842
10890
|
const formattedDate = newValue
|
|
@@ -38,6 +38,8 @@ const TabworthyTimesPicker = class {
|
|
|
38
38
|
this.period = this.hours >= 12 ? "PM" : "AM";
|
|
39
39
|
this.handleHourChange = (e) => {
|
|
40
40
|
const value = parseInt(e.target.value, 10);
|
|
41
|
+
if (isNaN(value))
|
|
42
|
+
return;
|
|
41
43
|
if (this.useTwelveHourFormat) {
|
|
42
44
|
// Convert to 24-hour format based on period
|
|
43
45
|
if (this.period === "AM") {
|
|
@@ -53,7 +55,10 @@ const TabworthyTimesPicker = class {
|
|
|
53
55
|
this.emitTimeChange();
|
|
54
56
|
};
|
|
55
57
|
this.handleMinuteChange = (e) => {
|
|
56
|
-
|
|
58
|
+
const value = parseInt(e.target.value, 10);
|
|
59
|
+
if (isNaN(value))
|
|
60
|
+
return;
|
|
61
|
+
this.internalMinutes = value;
|
|
57
62
|
this.emitTimeChange();
|
|
58
63
|
};
|
|
59
64
|
this.handlePeriodChange = (period) => {
|
|
@@ -113,7 +118,10 @@ const TabworthyTimesPicker = class {
|
|
|
113
118
|
this.emitTimeChange();
|
|
114
119
|
};
|
|
115
120
|
this.handleSecondChange = (e) => {
|
|
116
|
-
|
|
121
|
+
const value = parseInt(e.target.value, 10);
|
|
122
|
+
if (isNaN(value))
|
|
123
|
+
return;
|
|
124
|
+
this.internalSeconds = value;
|
|
117
125
|
this.emitTimeChange();
|
|
118
126
|
};
|
|
119
127
|
this.handleSecondIncrement = () => {
|
|
@@ -165,6 +173,7 @@ const TabworthyTimesPicker = class {
|
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
175
|
emitTimeChange() {
|
|
176
|
+
this.clampToBounds();
|
|
168
177
|
this.timeChanged.emit({
|
|
169
178
|
hours: this.get24HourValue(),
|
|
170
179
|
minutes: this.internalMinutes,
|
|
@@ -172,6 +181,69 @@ const TabworthyTimesPicker = class {
|
|
|
172
181
|
period: this.useTwelveHourFormat ? this.period : undefined
|
|
173
182
|
});
|
|
174
183
|
}
|
|
184
|
+
clampToBounds() {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
const h = this.get24HourValue();
|
|
187
|
+
const m = this.internalMinutes;
|
|
188
|
+
const s = this.internalSeconds;
|
|
189
|
+
if (this.minTime) {
|
|
190
|
+
const minS = (_a = this.minTime.seconds) !== null && _a !== void 0 ? _a : 0;
|
|
191
|
+
if (h < this.minTime.hours ||
|
|
192
|
+
(h === this.minTime.hours && m < this.minTime.minutes) ||
|
|
193
|
+
(h === this.minTime.hours && m === this.minTime.minutes && s < minS)) {
|
|
194
|
+
this.setInternal24Hours(this.minTime.hours);
|
|
195
|
+
this.internalMinutes = this.minTime.minutes;
|
|
196
|
+
this.internalSeconds = minS;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (this.maxTime) {
|
|
200
|
+
const maxS = (_b = this.maxTime.seconds) !== null && _b !== void 0 ? _b : 59;
|
|
201
|
+
const curH = this.get24HourValue();
|
|
202
|
+
const curM = this.internalMinutes;
|
|
203
|
+
const curS = this.internalSeconds;
|
|
204
|
+
if (curH > this.maxTime.hours ||
|
|
205
|
+
(curH === this.maxTime.hours && curM > this.maxTime.minutes) ||
|
|
206
|
+
(curH === this.maxTime.hours &&
|
|
207
|
+
curM === this.maxTime.minutes &&
|
|
208
|
+
curS > maxS)) {
|
|
209
|
+
this.setInternal24Hours(this.maxTime.hours);
|
|
210
|
+
this.internalMinutes = this.maxTime.minutes;
|
|
211
|
+
this.internalSeconds = maxS;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
setInternal24Hours(h24) {
|
|
216
|
+
this.internalHours = h24;
|
|
217
|
+
this.period = h24 >= 12 ? "PM" : "AM";
|
|
218
|
+
}
|
|
219
|
+
isAtMinHour() {
|
|
220
|
+
return !!this.minTime && this.get24HourValue() <= this.minTime.hours;
|
|
221
|
+
}
|
|
222
|
+
isAtMaxHour() {
|
|
223
|
+
return !!this.maxTime && this.get24HourValue() >= this.maxTime.hours;
|
|
224
|
+
}
|
|
225
|
+
isAtMinMinute() {
|
|
226
|
+
return (this.isAtMinHour() &&
|
|
227
|
+
!!this.minTime &&
|
|
228
|
+
this.internalMinutes <= this.minTime.minutes);
|
|
229
|
+
}
|
|
230
|
+
isAtMaxMinute() {
|
|
231
|
+
return (this.isAtMaxHour() &&
|
|
232
|
+
!!this.maxTime &&
|
|
233
|
+
this.internalMinutes >= this.maxTime.minutes);
|
|
234
|
+
}
|
|
235
|
+
isAtMinSecond() {
|
|
236
|
+
var _a;
|
|
237
|
+
return (this.isAtMinMinute() &&
|
|
238
|
+
!!this.minTime &&
|
|
239
|
+
this.internalSeconds <= ((_a = this.minTime.seconds) !== null && _a !== void 0 ? _a : 0));
|
|
240
|
+
}
|
|
241
|
+
isAtMaxSecond() {
|
|
242
|
+
var _a;
|
|
243
|
+
return (this.isAtMaxMinute() &&
|
|
244
|
+
!!this.maxTime &&
|
|
245
|
+
this.internalSeconds >= ((_a = this.maxTime.seconds) !== null && _a !== void 0 ? _a : 59));
|
|
246
|
+
}
|
|
175
247
|
padZero(num) {
|
|
176
248
|
return num.toString().padStart(2, "0");
|
|
177
249
|
}
|
|
@@ -179,22 +251,22 @@ const TabworthyTimesPicker = class {
|
|
|
179
251
|
const displayHours = this.getDisplayHours();
|
|
180
252
|
const maxHours = this.useTwelveHourFormat ? 12 : 23;
|
|
181
253
|
const minHours = this.useTwelveHourFormat ? 1 : 0;
|
|
182
|
-
return (index.h(index.Host, { key: '
|
|
254
|
+
return (index.h(index.Host, { key: '190cabad78886b1902d70c42c6c5b1f4ee90e5fe', class: this.elementClassName, "aria-label": this.labels.timePicker }, index.h("div", { key: '98b3d39baf501aeb9894949e807a365e26253fbc', class: `${this.elementClassName}__container` }, index.h("div", { key: '6697b77b177164a36297f911572d89beaa01cf23', class: `${this.elementClassName}__field` }, index.h("label", { key: '43f6e821b49f19041422741840439081f819f71c', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
183
255
|
[`${this.elementClassName}__label`]: true,
|
|
184
256
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
185
|
-
} }, this.labels.hours), index.h("div", { key: '
|
|
257
|
+
} }, this.labels.hours), index.h("div", { key: 'a0e177ded2a849c22e41dbca95bad0888f7f956c', class: `${this.elementClassName}__control` }, index.h("button", { key: 'b12c268cc84f11ee078ba9285ae6d9cc605761e4', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled || this.isAtMaxHour(), "aria-label": this.labels.incrementHours }, index.h("svg", { key: '598eff59b528ec28a0e5b34924e77a4f632ba6ca', 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: '279b80304fc77a2fd74e26a2aba89f12155f9334', points: "18 15 12 9 6 15" }))), index.h("input", { key: '93f17e7c848d40bd513ad7af9f29d39586391573', 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: 'ba8f6463ee850c6349cad839eb851c67e0cb4d1e', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled || this.isAtMinHour(), "aria-label": this.labels.decrementHours }, index.h("svg", { key: '21e585fbd6a9aa2b957e817ec55ab2ec01cf2fc4', 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: '742b64bddf3873a7bea1c10ed93b9b1e99588ede', points: "6 9 12 15 18 9" }))))), index.h("div", { key: 'f81f40c465cc84a5d02b9904631d3d24e33150e3', class: `${this.elementClassName}__separator` }, ":"), index.h("div", { key: 'd028bae721c1c9c2cc7290cd19f7050a901f4a4e', class: `${this.elementClassName}__field` }, index.h("label", { key: '3c88a3fa04ed2a65f72c48ded459e19d580f9c36', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
186
258
|
[`${this.elementClassName}__label`]: true,
|
|
187
259
|
[`${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: '
|
|
260
|
+
} }, this.labels.minutes), index.h("div", { key: 'dbd89633addd003b2e42414b587d03a6e65e9239', class: `${this.elementClassName}__control` }, index.h("button", { key: 'b113074a58889691dd5452a6353b691336f5ae14', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled || this.isAtMaxMinute(), "aria-label": this.labels.incrementMinutes }, index.h("svg", { key: '0d724c0e5110dd29ab4cedc005595d4e57fd3d06', 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: 'dbc89190f6fe10bb8c8074252b83ab3397112de4', points: "18 15 12 9 6 15" }))), index.h("input", { key: '65a9a61218d443676a8a2d03d4922b2303a484c5', 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: '3f72a62add15d9288b421b84e791ba40b9acf569', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled || this.isAtMinMinute(), "aria-label": this.labels.decrementMinutes }, index.h("svg", { key: '04eef7d1d332459e5191962c411aa9c83ace8b84', 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: '56045b19ec716a82f21406b647762ba0efcd8170', points: "6 9 12 15 18 9" }))))), this.showSeconds && [
|
|
261
|
+
index.h("div", { key: '9c2619ccebd147e626e10a21fb1a5fa1268128f3', class: `${this.elementClassName}__separator` }, ":"),
|
|
262
|
+
index.h("div", { key: 'dea8135d47a06d9624b480aa6123350a0899ca02', class: `${this.elementClassName}__field` }, index.h("label", { key: 'afaa88b59df63091088620ff2a49bf8472f4401f', htmlFor: `${this.elementClassName}-seconds`, class: {
|
|
191
263
|
[`${this.elementClassName}__label`]: true,
|
|
192
264
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
193
|
-
} }, this.labels.seconds), index.h("div", { key: '
|
|
194
|
-
], this.useTwelveHourFormat && (index.h("div", { key: '
|
|
265
|
+
} }, this.labels.seconds), index.h("div", { key: 'c2ed4d63a95a65bdc26926932e705744bbe776c5', class: `${this.elementClassName}__control` }, index.h("button", { key: '40d510ae7008802ce09ec98c9912f2f91cdb2db7', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleSecondIncrement, disabled: this.disabled || this.isAtMaxSecond(), "aria-label": this.labels.incrementSeconds }, index.h("svg", { key: 'fd3324d15759c7f2a752b6a32303c8eaddb0e588', 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: '5e2dad75d96a521f56f616bc2b88e4baa6c0eb50', points: "18 15 12 9 6 15" }))), index.h("input", { key: 'b1b517bb8147a45632388f432ae0e3595467ebce', 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: '7b82e86f2da4bd5c0f65c95cbcb26252e357625d', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleSecondDecrement, disabled: this.disabled || this.isAtMinSecond(), "aria-label": this.labels.decrementSeconds }, index.h("svg", { key: 'c3b5ae33c5475b448c1a5e7fe3bb4748318441fb', 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: '3bb717320e078f5fa36912f15995ed604d9f702b', points: "6 9 12 15 18 9" })))))
|
|
266
|
+
], this.useTwelveHourFormat && (index.h("div", { key: 'ec583890c2f7d97c6a6196f3556dfd76c8209227', class: `${this.elementClassName}__period` }, index.h("button", { key: 'e99d9b41ded6b138660f2777f60991bf3af12182', type: "button", class: {
|
|
195
267
|
[`${this.elementClassName}__period-button`]: true,
|
|
196
268
|
[`${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: '
|
|
269
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), index.h("button", { key: '3a3cbc3b47b0218694db2c8909da97ea50e521f2', type: "button", class: {
|
|
198
270
|
[`${this.elementClassName}__period-button`]: true,
|
|
199
271
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
200
272
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|