@tabworthy/components 0.9.1 → 0.9.2
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-times-picker.cjs.entry.js +6 -6
- package/dist/cjs/tabworthy-times.cjs.entry.js +3 -4
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +27 -4
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +9 -9
- package/dist/components/{p-B9YA6avR.js → p-PW8Ht1Es.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-times-picker.entry.js +6 -6
- package/dist/esm/tabworthy-times.entry.js +3 -4
- package/dist/tabworthy-components/{p-4eec41e5.entry.js → p-81ad5b1f.entry.js} +1 -1
- package/dist/tabworthy-components/{p-fdb3b911.entry.js → p-a595158c.entry.js} +1 -1
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +2 -0
- package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +3 -3
- package/dist/types/components.d.ts +8 -4
- package/package.json +1 -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],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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],"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"],"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],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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"],"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"],"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],"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"],"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],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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],"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"],"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],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2.cjs",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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"],"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"],"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],"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"],"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;
|
|
@@ -13,7 +13,7 @@ const defaultLabels = {
|
|
|
13
13
|
incrementMinutes: "Increment minutes",
|
|
14
14
|
decrementMinutes: "Decrement minutes"
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const TabworthyTimesPicker = class {
|
|
17
17
|
constructor(hostRef) {
|
|
18
18
|
index.registerInstance(this, hostRef);
|
|
19
19
|
this.timeChanged = index.createEvent(this, "timeChanged", 7);
|
|
@@ -155,16 +155,16 @@ const InclusiveTimesPicker = class {
|
|
|
155
155
|
const displayHours = this.getDisplayHours();
|
|
156
156
|
const maxHours = this.useTwelveHourFormat ? 12 : 23;
|
|
157
157
|
const minHours = this.useTwelveHourFormat ? 1 : 0;
|
|
158
|
-
return (index.h(index.Host, { key: '
|
|
158
|
+
return (index.h(index.Host, { key: '5c9fbbe95d08e086bf78761da0375526f5042d15', class: this.elementClassName, "aria-label": this.labels.timePicker }, index.h("div", { key: 'f914ccebcf2025226762b1446944be41b555b5ea', class: `${this.elementClassName}__container` }, index.h("div", { key: 'a17ed2def130bbe92a17dd733f1b516d68ae98f3', class: `${this.elementClassName}__field` }, index.h("label", { key: '513ca90795cca3c209df22def8fae8dd377d74ef', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
159
159
|
[`${this.elementClassName}__label`]: true,
|
|
160
160
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
161
|
-
} }, this.labels.hours), index.h("div", { key: '
|
|
161
|
+
} }, this.labels.hours), index.h("div", { key: '3f7448b3161d594e3d601700e1a703a3f2857ffe', class: `${this.elementClassName}__control` }, index.h("button", { key: '19f8cf8fdfc931e0baa10b98864589990d628b7f', 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: 'fb12854d35131adad4250bf24e25936ad583f74f', 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: '8176d2b9d15e81ef7c700064cadd2b83b8572593', points: "18 15 12 9 6 15" }))), index.h("input", { key: '66986ad937685f83bf1bc999c4aabf5f2ed9d3d9', 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: 'd225e66235e04132bf461bb6e73377a823db1b9f', 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: '387c4d7ddb7097da7032345db6c09db5e0ea0d0b', 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: '4c307b1ecb096d3c4d42ed7c79b0c8cde004842a', points: "6 9 12 15 18 9" }))))), index.h("div", { key: '9c8101ae559b74d985286688e3147aacc80ab448', class: `${this.elementClassName}__separator` }, ":"), index.h("div", { key: '8a49a068478e1fda98634e1d74bb399b5ae1a5f4', class: `${this.elementClassName}__field` }, index.h("label", { key: '3c585236e76192d10f013aff1a765f9b31e9bce6', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
162
162
|
[`${this.elementClassName}__label`]: true,
|
|
163
163
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
164
|
-
} }, this.labels.minutes), index.h("div", { key: '
|
|
164
|
+
} }, this.labels.minutes), index.h("div", { key: '8d567d355ae2f34c51c057c81ea0921a8de6f012', class: `${this.elementClassName}__control` }, index.h("button", { key: 'a061d7d4b66b787d4478d54bc36525e5d9bf7e61', 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: '148244241427e2bca0f6fc7147f9ca5a329c4480', 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: 'd10fa3e7a7815b8806d583041aeae70b4de0e267', points: "18 15 12 9 6 15" }))), index.h("input", { key: 'db14c0a90805afede369a9e0878191537e9eef9f', 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: '1820f55ac22cd78494a40fa7b5f2e1c1ea191a18', 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: '9135d7673f58babaf44b0c33ad1755b3097aea01', 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: 'f36192868f379fc2abe3b2deade678eeab725ee1', points: "6 9 12 15 18 9" }))))), this.useTwelveHourFormat && (index.h("div", { key: '6bf685eaed72c157b8c01c40e8b84bace096d417', class: `${this.elementClassName}__period` }, index.h("button", { key: '107a2a21de03626e15b35cd850f5ee8a2eb09f8e', type: "button", class: {
|
|
165
165
|
[`${this.elementClassName}__period-button`]: true,
|
|
166
166
|
[`${this.elementClassName}__period-button--active`]: this.period === "AM"
|
|
167
|
-
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), index.h("button", { key: '
|
|
167
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), index.h("button", { key: '62ad24e781b8da40699e4f91acbc20eeef1c2f65', type: "button", class: {
|
|
168
168
|
[`${this.elementClassName}__period-button`]: true,
|
|
169
169
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
170
170
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|
|
@@ -180,4 +180,4 @@ const InclusiveTimesPicker = class {
|
|
|
180
180
|
}; }
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
exports.tabworthy_times_picker =
|
|
183
|
+
exports.tabworthy_times_picker = TabworthyTimesPicker;
|
|
@@ -41,7 +41,6 @@ const InclusiveTimes = class {
|
|
|
41
41
|
this.useTwelveHourFormat = true;
|
|
42
42
|
// Labels used for internal translations
|
|
43
43
|
this.timesLabels = defaultLabels;
|
|
44
|
-
// Prevent hiding the calendar
|
|
45
44
|
this.inline = false;
|
|
46
45
|
// Current error state of the input field
|
|
47
46
|
this.hasError = false;
|
|
@@ -238,10 +237,10 @@ const InclusiveTimes = class {
|
|
|
238
237
|
}
|
|
239
238
|
render() {
|
|
240
239
|
var _a;
|
|
241
|
-
return (index.h(index.Host, { key: '
|
|
240
|
+
return (index.h(index.Host, { key: '50d45c4b42629ab4db986c798de53bffcfb94018', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, index.h("label", { key: '9b97b3a86a29629b5acef900cd46c12401a0ed15', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), index.h("div", { key: '84e4b339f17a14b036e08c3ed55c28ebf8ff1eef', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, index.h("input", { key: 'f189b9624b1e7a9d80a71dbdbcadc606d4e8c431', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
|
|
242
241
|
[this.getClassName("input")]: true,
|
|
243
242
|
[this.inputClass]: !!this.inputClass
|
|
244
|
-
}, 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: '
|
|
243
|
+
}, 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: 'dc54c9ff8d4fab01d6175584320de0a0b8282cb2', 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: '1102460f03ffbd9dd3878376fc37fe19aaa50f54', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
245
244
|
if (this.pickerRef) {
|
|
246
245
|
this.pickerRef.modalIsOpen = true;
|
|
247
246
|
}
|
|
@@ -249,7 +248,7 @@ const InclusiveTimes = class {
|
|
|
249
248
|
if (this.pickerRef) {
|
|
250
249
|
this.pickerRef.modalIsOpen = false;
|
|
251
250
|
}
|
|
252
|
-
}, inline: this.inline, appendTo: this.appendTo }, index.h("div", { key: '
|
|
251
|
+
}, inline: this.inline, appendTo: this.appendTo }, index.h("div", { key: 'fbce75861b31c85a58055eb4dc1c3f9ad0d0be73', class: this.getClassName("picker-container") }, index.h("tabworthy-dates-calendar", { key: '265ab52d552985fddd4c6944fb2405baadae1450', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined }, index.h("div", { key: 'f7377b3ff5a818849afcab7297a6f3d732dd4b82', slot: "after-calendar", class: this.getClassName("time-section") }, index.h("hr", { key: 'd71bc64c57fc8073e4af045347f9be69e20bac9f', class: this.getClassName("divider") }), index.h("tabworthy-times-picker", { key: '2ee95db049c3a81b26fa38b9bb4288f0850dc25f', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels }))))), this.errorState && (index.h("div", { key: '0b0f79267ba191582d5e23be27970b16db80aab7', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
253
252
|
}
|
|
254
253
|
get el() { return index.getElement(this); }
|
|
255
254
|
static get watchers() { return {
|
|
@@ -34,7 +34,6 @@ export class InclusiveTimes {
|
|
|
34
34
|
this.useTwelveHourFormat = true;
|
|
35
35
|
// Labels used for internal translations
|
|
36
36
|
this.timesLabels = defaultLabels;
|
|
37
|
-
// Prevent hiding the calendar
|
|
38
37
|
this.inline = false;
|
|
39
38
|
// Current error state of the input field
|
|
40
39
|
this.hasError = false;
|
|
@@ -231,10 +230,10 @@ export class InclusiveTimes {
|
|
|
231
230
|
}
|
|
232
231
|
render() {
|
|
233
232
|
var _a;
|
|
234
|
-
return (h(Host, { key: '
|
|
233
|
+
return (h(Host, { key: '50d45c4b42629ab4db986c798de53bffcfb94018', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '9b97b3a86a29629b5acef900cd46c12401a0ed15', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '84e4b339f17a14b036e08c3ed55c28ebf8ff1eef', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: 'f189b9624b1e7a9d80a71dbdbcadc606d4e8c431', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
|
|
235
234
|
[this.getClassName("input")]: true,
|
|
236
235
|
[this.inputClass]: !!this.inputClass
|
|
237
|
-
}, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: '
|
|
236
|
+
}, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: 'dc54c9ff8d4fab01d6175584320de0a0b8282cb2', type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: '1102460f03ffbd9dd3878376fc37fe19aaa50f54', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
238
237
|
if (this.pickerRef) {
|
|
239
238
|
this.pickerRef.modalIsOpen = true;
|
|
240
239
|
}
|
|
@@ -242,7 +241,7 @@ export class InclusiveTimes {
|
|
|
242
241
|
if (this.pickerRef) {
|
|
243
242
|
this.pickerRef.modalIsOpen = false;
|
|
244
243
|
}
|
|
245
|
-
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '
|
|
244
|
+
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: 'fbce75861b31c85a58055eb4dc1c3f9ad0d0be73', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '265ab52d552985fddd4c6944fb2405baadae1450', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined }, h("div", { key: 'f7377b3ff5a818849afcab7297a6f3d732dd4b82', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: 'd71bc64c57fc8073e4af045347f9be69e20bac9f', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: '2ee95db049c3a81b26fa38b9bb4288f0850dc25f', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels }))))), this.errorState && (h("div", { key: '0b0f79267ba191582d5e23be27970b16db80aab7', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
246
245
|
}
|
|
247
246
|
static get is() { return "tabworthy-times"; }
|
|
248
247
|
static get encapsulation() { return "scoped"; }
|
|
@@ -532,6 +531,30 @@ export class InclusiveTimes {
|
|
|
532
531
|
"getter": false,
|
|
533
532
|
"setter": false
|
|
534
533
|
},
|
|
534
|
+
"timesPickerLabels": {
|
|
535
|
+
"type": "unknown",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "TimesPickerLabels",
|
|
539
|
+
"resolved": "TimesPickerLabels",
|
|
540
|
+
"references": {
|
|
541
|
+
"TimesPickerLabels": {
|
|
542
|
+
"location": "import",
|
|
543
|
+
"path": "../tabworthy-times-picker/tabworthy-times-picker",
|
|
544
|
+
"id": "src/components/tabworthy-times-picker/tabworthy-times-picker.tsx::TimesPickerLabels",
|
|
545
|
+
"referenceLocation": "TimesPickerLabels"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
"required": false,
|
|
550
|
+
"optional": true,
|
|
551
|
+
"docs": {
|
|
552
|
+
"tags": [],
|
|
553
|
+
"text": ""
|
|
554
|
+
},
|
|
555
|
+
"getter": false,
|
|
556
|
+
"setter": false
|
|
557
|
+
},
|
|
535
558
|
"inline": {
|
|
536
559
|
"type": "boolean",
|
|
537
560
|
"mutable": false,
|
|
@@ -10,7 +10,7 @@ const defaultLabels = {
|
|
|
10
10
|
incrementMinutes: "Increment minutes",
|
|
11
11
|
decrementMinutes: "Decrement minutes"
|
|
12
12
|
};
|
|
13
|
-
export class
|
|
13
|
+
export class TabworthyTimesPicker {
|
|
14
14
|
constructor() {
|
|
15
15
|
// Current time value (24-hour format)
|
|
16
16
|
this.hours = 12;
|
|
@@ -150,16 +150,16 @@ export class InclusiveTimesPicker {
|
|
|
150
150
|
const displayHours = this.getDisplayHours();
|
|
151
151
|
const maxHours = this.useTwelveHourFormat ? 12 : 23;
|
|
152
152
|
const minHours = this.useTwelveHourFormat ? 1 : 0;
|
|
153
|
-
return (h(Host, { key: '
|
|
153
|
+
return (h(Host, { key: '5c9fbbe95d08e086bf78761da0375526f5042d15', class: this.elementClassName, "aria-label": this.labels.timePicker }, h("div", { key: 'f914ccebcf2025226762b1446944be41b555b5ea', class: `${this.elementClassName}__container` }, h("div", { key: 'a17ed2def130bbe92a17dd733f1b516d68ae98f3', class: `${this.elementClassName}__field` }, h("label", { key: '513ca90795cca3c209df22def8fae8dd377d74ef', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
154
154
|
[`${this.elementClassName}__label`]: true,
|
|
155
155
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
156
|
-
} }, this.labels.hours), h("div", { key: '
|
|
156
|
+
} }, this.labels.hours), h("div", { key: '3f7448b3161d594e3d601700e1a703a3f2857ffe', class: `${this.elementClassName}__control` }, h("button", { key: '19f8cf8fdfc931e0baa10b98864589990d628b7f', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, h("svg", { key: 'fb12854d35131adad4250bf24e25936ad583f74f', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '8176d2b9d15e81ef7c700064cadd2b83b8572593', points: "18 15 12 9 6 15" }))), h("input", { key: '66986ad937685f83bf1bc999c4aabf5f2ed9d3d9', 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 }), h("button", { key: 'd225e66235e04132bf461bb6e73377a823db1b9f', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, h("svg", { key: '387c4d7ddb7097da7032345db6c09db5e0ea0d0b', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '4c307b1ecb096d3c4d42ed7c79b0c8cde004842a', points: "6 9 12 15 18 9" }))))), h("div", { key: '9c8101ae559b74d985286688e3147aacc80ab448', class: `${this.elementClassName}__separator` }, ":"), h("div", { key: '8a49a068478e1fda98634e1d74bb399b5ae1a5f4', class: `${this.elementClassName}__field` }, h("label", { key: '3c585236e76192d10f013aff1a765f9b31e9bce6', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
157
157
|
[`${this.elementClassName}__label`]: true,
|
|
158
158
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
159
|
-
} }, this.labels.minutes), h("div", { key: '
|
|
159
|
+
} }, this.labels.minutes), h("div", { key: '8d567d355ae2f34c51c057c81ea0921a8de6f012', class: `${this.elementClassName}__control` }, h("button", { key: 'a061d7d4b66b787d4478d54bc36525e5d9bf7e61', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, h("svg", { key: '148244241427e2bca0f6fc7147f9ca5a329c4480', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'd10fa3e7a7815b8806d583041aeae70b4de0e267', points: "18 15 12 9 6 15" }))), h("input", { key: 'db14c0a90805afede369a9e0878191537e9eef9f', 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 }), h("button", { key: '1820f55ac22cd78494a40fa7b5f2e1c1ea191a18', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, h("svg", { key: '9135d7673f58babaf44b0c33ad1755b3097aea01', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'f36192868f379fc2abe3b2deade678eeab725ee1', points: "6 9 12 15 18 9" }))))), this.useTwelveHourFormat && (h("div", { key: '6bf685eaed72c157b8c01c40e8b84bace096d417', class: `${this.elementClassName}__period` }, h("button", { key: '107a2a21de03626e15b35cd850f5ee8a2eb09f8e', type: "button", class: {
|
|
160
160
|
[`${this.elementClassName}__period-button`]: true,
|
|
161
161
|
[`${this.elementClassName}__period-button--active`]: this.period === "AM"
|
|
162
|
-
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '
|
|
162
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '62ad24e781b8da40699e4f91acbc20eeef1c2f65', type: "button", class: {
|
|
163
163
|
[`${this.elementClassName}__period-button`]: true,
|
|
164
164
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
165
165
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|
|
@@ -232,13 +232,13 @@ export class InclusiveTimesPicker {
|
|
|
232
232
|
"type": "unknown",
|
|
233
233
|
"mutable": false,
|
|
234
234
|
"complexType": {
|
|
235
|
-
"original": "
|
|
236
|
-
"resolved": "
|
|
235
|
+
"original": "TimesPickerLabels",
|
|
236
|
+
"resolved": "TimesPickerLabels",
|
|
237
237
|
"references": {
|
|
238
|
-
"
|
|
238
|
+
"TimesPickerLabels": {
|
|
239
239
|
"location": "local",
|
|
240
240
|
"path": "/Users/damirbogdanov_1/work/tabworthy-components/src/components/tabworthy-times-picker/tabworthy-times-picker.tsx",
|
|
241
|
-
"id": "src/components/tabworthy-times-picker/tabworthy-times-picker.tsx::
|
|
241
|
+
"id": "src/components/tabworthy-times-picker/tabworthy-times-picker.tsx::TimesPickerLabels"
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,d as h,t as a}from"./p-BiJ0HZVY.js";const n={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},
|
|
1
|
+
import{p as t,H as e,c as s,h as i,d as h,t as a}from"./p-BiJ0HZVY.js";const n={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},o=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.timeChanged=s(this,"timeChanged",7),this.hours=12,this.minutes=0,this.useTwelveHourFormat=!1,this.labels=n,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const e=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===e?0:e:12===e?12:e+12:e,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const e=this.getDisplayHours();this.internalHours="AM"===t?12===e?0:e:12===e?12:e+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=12===t?1:t+1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=1===t?12:t-1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()}}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM"}getDisplayHours(){return this.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,period:this.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),e=this.useTwelveHourFormat?12:23,s=this.useTwelveHourFormat?1:0;return i(h,{key:"5c9fbbe95d08e086bf78761da0375526f5042d15",class:this.elementClassName,"aria-label":this.labels.timePicker},i("div",{key:"f914ccebcf2025226762b1446944be41b555b5ea",class:`${this.elementClassName}__container`},i("div",{key:"a17ed2def130bbe92a17dd733f1b516d68ae98f3",class:`${this.elementClassName}__field`},i("label",{key:"513ca90795cca3c209df22def8fae8dd377d74ef",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),i("div",{key:"3f7448b3161d594e3d601700e1a703a3f2857ffe",class:`${this.elementClassName}__control`},i("button",{key:"19f8cf8fdfc931e0baa10b98864589990d628b7f",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},i("svg",{key:"fb12854d35131adad4250bf24e25936ad583f74f",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"8176d2b9d15e81ef7c700064cadd2b83b8572593",points:"18 15 12 9 6 15"}))),i("input",{key:"66986ad937685f83bf1bc999c4aabf5f2ed9d3d9",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:s,max:e,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),i("button",{key:"d225e66235e04132bf461bb6e73377a823db1b9f",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},i("svg",{key:"387c4d7ddb7097da7032345db6c09db5e0ea0d0b",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"4c307b1ecb096d3c4d42ed7c79b0c8cde004842a",points:"6 9 12 15 18 9"}))))),i("div",{key:"9c8101ae559b74d985286688e3147aacc80ab448",class:`${this.elementClassName}__separator`},":"),i("div",{key:"8a49a068478e1fda98634e1d74bb399b5ae1a5f4",class:`${this.elementClassName}__field`},i("label",{key:"3c585236e76192d10f013aff1a765f9b31e9bce6",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),i("div",{key:"8d567d355ae2f34c51c057c81ea0921a8de6f012",class:`${this.elementClassName}__control`},i("button",{key:"a061d7d4b66b787d4478d54bc36525e5d9bf7e61",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},i("svg",{key:"148244241427e2bca0f6fc7147f9ca5a329c4480",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"d10fa3e7a7815b8806d583041aeae70b4de0e267",points:"18 15 12 9 6 15"}))),i("input",{key:"db14c0a90805afede369a9e0878191537e9eef9f",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}),i("button",{key:"1820f55ac22cd78494a40fa7b5f2e1c1ea191a18",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},i("svg",{key:"9135d7673f58babaf44b0c33ad1755b3097aea01",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"f36192868f379fc2abe3b2deade678eeab725ee1",points:"6 9 12 15 18 9"}))))),this.useTwelveHourFormat&&i("div",{key:"6bf685eaed72c157b8c01c40e8b84bace096d417",class:`${this.elementClassName}__period`},i("button",{key:"107a2a21de03626e15b35cd850f5ee8a2eb09f8e",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),i("button",{key:"62ad24e781b8da40699e4f91acbc20eeef1c2f65",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return this}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}}},[2,"tabworthy-times-picker",{hours:[1026],minutes:[1026],useTwelveHourFormat:[4,"use-twelve-hour-format"],labels:[16],labelsSrOnly:[4,"labels-sr-only"],disabled:[4],elementClassName:[1,"element-class-name"],internalHours:[32],internalMinutes:[32],period:[32]},void 0,{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}]);function r(){"undefined"!=typeof customElements&&["tabworthy-times-picker"].forEach((t=>{"tabworthy-times-picker"===t&&(customElements.get(a(t))||customElements.define(a(t),o))}))}export{o as T,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{T as s,d as o}from"./p-PW8Ht1Es.js";const t=s,p=o;export{t as TabworthyTimesPicker,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as i,d as a,t as h}from"./p-BiJ0HZVY.js";import{h as r}from"./p-Mki5YqAR.js";import{g as o,r as n,c as
|
|
1
|
+
import{p as t,H as s,c as e,h as i,d as a,t as h}from"./p-BiJ0HZVY.js";import{h as r}from"./p-Mki5YqAR.js";import{g as o,r as n,c as d}from"./p-B8sG1vGD.js";import{d as l}from"./p-B9fGfjA-.js";import{d as c}from"./p-PW8Ht1Es.js";const b={selected:"selected",openCalendar:"Choose time",calendar:"date and time picker",invalidDateError:"We could not find a matching date",minDateError:"Please fill in a date after ",maxDateError:"Please fill in a date before ",rangeOutOfBoundsError:"Please enter a valid range of dates",disabledDateError:"Please choose an available date",to:"to",startDate:"Start date",timeLabel:"Time"},u=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectDateTime=e(this,"selectDateTime",7),this.changeYear=e(this,"changeYear",7),this.componentReady=e(this,"componentReady",7),this.range=!1,this.label="Choose a date and time",this.placeholder="",this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.disabled=!1,this.startDate=o(new Date),this.referenceDate=o(new Date),this.useTwelveHourFormat=!0,this.timesLabels=b,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.disableFreeformInput=!1,this.inputClass="",this.selectedHours=12,this.selectedMinutes=0,this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{const s=t.split(",");if(this.range&&2===s.length){const t=n(new Date(s[0])),e=n(new Date(s[1]));this.updateValue([t,e]),this.pickerRef&&(this.pickerRef.value=[t,e])}else{const t=n(new Date(s[0]));this.updateValue(t),this.pickerRef&&(this.pickerRef.value=t)}},this.handleTimeChange=t=>{this.selectedHours=t.detail.hours,this.selectedMinutes=t.detail.minutes,this.selectedDate&&this.updateValue(this.selectedDate)},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.inputContainerRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const s=r(t.target.value);s.isValid()&&(this.selectedHours=s.hours(),this.selectedMinutes=s.minutes(),this.updateValue(s.toDate()))}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}watchValue(t){this.syncFromValueProp()}watchDisabled(t){this.disabledState=t}watchHasError(t){this.errorState=t}componentDidLoad(){this.syncFromValueProp(),this.componentReady.emit(),this.id||console.error('tabworthy-times: The "id" prop is required for accessibility')}syncFromValueProp(){if(this.value){this.internalValue=this.value;const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const s=r(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hours(),this.selectedMinutes=s.minutes())}}else this.internalValue=null}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>{const s=r(t);return s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0),s.format(this.format)}));this.internalValue=s,this.value=s,this.selectDateTime.emit(s)}else{const s=r(t);s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0);const e=s.format(this.format);this.internalValue=e,this.value=e,this.selectedDate=t,this.selectDateTime.emit(e)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>r(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=r(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>r(t,this.format).toDate())):r(t,this.format).toDate():null}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef.value="",this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return i(a,{key:"50d45c4b42629ab4db986c798de53bffcfb94018",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"9b97b3a86a29629b5acef900cd46c12401a0ed15",htmlFor:this.id+"-input",class:this.getClassName("label")},this.label),i("div",{key:"84e4b339f17a14b036e08c3ed55c28ebf8ff1eef",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},i("input",{key:"f189b9624b1e7a9d80a71dbdbcadc606d4e8c431",id:this.id+"-input",ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:""+t,onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?this.id+"-error":void 0,"aria-invalid":this.errorState}),!this.inline&&i("button",{key:"dc54c9ff8d4fab01d6175584320de0a0b8282cb2",type:"button",onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState},this.calendarButtonContent?i("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),i("tabworthy-dates-modal",{key:"1102460f03ffbd9dd3878376fc37fe19aaa50f54",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},i("div",{key:"fbce75861b31c85a58055eb4dc1c3f9ad0d0be73",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"265ab52d552985fddd4c6944fb2405baadae1450",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),labels:this.datesCalendarLabels,ref:t=>this.pickerRef=t,startDate:this.startDate,firstDayOfWeek:this.firstDayOfWeek,showHiddenTitle:!0,disabled:this.disabledState,showMonthStepper:this.showMonthStepper,showYearStepper:this.showYearStepper,showClearButton:this.showClearButton,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline,value:this.value?this.toDate(this.value):void 0},i("div",{key:"f7377b3ff5a818849afcab7297a6f3d732dd4b82",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"d71bc64c57fc8073e4af045347f9be69e20bac9f",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"2ee95db049c3a81b26fa38b9bb4288f0850dc25f",hours:this.selectedHours,minutes:this.selectedMinutes,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels}))))),this.errorState&&i("div",{key:"0b0f79267ba191582d5e23be27970b16db80aab7",class:this.getClassName("input-error"),id:this.id?this.id+"-error":void 0,role:"status"},this.errorMessage))}get el(){return this}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}},[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"],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"],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],errorState:[32],disabledState:[32],clearValue:[64]},void 0,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]),f=u,m=function(){"undefined"!=typeof customElements&&["tabworthy-times","tabworthy-dates-calendar","tabworthy-dates-modal","tabworthy-times-picker"].forEach((t=>{switch(t){case"tabworthy-times":customElements.get(h(t))||customElements.define(h(t),u);break;case"tabworthy-dates-calendar":customElements.get(h(t))||d();break;case"tabworthy-dates-modal":customElements.get(h(t))||l();break;case"tabworthy-times-picker":customElements.get(h(t))||c()}}))};export{f as TabworthyTimes,m as defineCustomElement}
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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",[[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"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[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"],"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);
|
|
8
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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",[[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"],"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"],"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],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[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"],"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
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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",[[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"],"timesLabels":[16],"datesCalendarLabels":[16],"inline":[4],"hasError":[1028,"has-error"],"showYearStepper":[4,"show-year-stepper"],"showMonthStepper":[4,"show-month-stepper"],"showClearButton":[4,"show-clear-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],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[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"],"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);
|
|
20
|
+
return bootstrapLazy([["tabworthy-times-picker",[[2,"tabworthy-times-picker",{"hours":[1026],"minutes":[1026],"useTwelveHourFormat":[4,"use-twelve-hour-format"],"labels":[16],"labelsSrOnly":[4,"labels-sr-only"],"disabled":[4],"elementClassName":[1,"element-class-name"],"internalHours":[32],"internalMinutes":[32],"period":[32]},null,{"hours":[{"watchHours":0}],"minutes":[{"watchMinutes":0}]}]]],["tabworthy-dates-calendar_2",[[262,"tabworthy-dates-calendar",{"clearButtonContent":[1,"clear-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"],"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",[[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"],"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"],"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],"errorState":[32],"disabledState":[32],"clearValue":[64]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"hasError":[{"watchHasError":0}]}]]],["tabworthy-dates",[[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"],"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);
|
|
21
21
|
});
|
|
@@ -11,7 +11,7 @@ const defaultLabels = {
|
|
|
11
11
|
incrementMinutes: "Increment minutes",
|
|
12
12
|
decrementMinutes: "Decrement minutes"
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const TabworthyTimesPicker = class {
|
|
15
15
|
constructor(hostRef) {
|
|
16
16
|
registerInstance(this, hostRef);
|
|
17
17
|
this.timeChanged = createEvent(this, "timeChanged", 7);
|
|
@@ -153,16 +153,16 @@ const InclusiveTimesPicker = class {
|
|
|
153
153
|
const displayHours = this.getDisplayHours();
|
|
154
154
|
const maxHours = this.useTwelveHourFormat ? 12 : 23;
|
|
155
155
|
const minHours = this.useTwelveHourFormat ? 1 : 0;
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '5c9fbbe95d08e086bf78761da0375526f5042d15', class: this.elementClassName, "aria-label": this.labels.timePicker }, h("div", { key: 'f914ccebcf2025226762b1446944be41b555b5ea', class: `${this.elementClassName}__container` }, h("div", { key: 'a17ed2def130bbe92a17dd733f1b516d68ae98f3', class: `${this.elementClassName}__field` }, h("label", { key: '513ca90795cca3c209df22def8fae8dd377d74ef', htmlFor: `${this.elementClassName}-hours`, class: {
|
|
157
157
|
[`${this.elementClassName}__label`]: true,
|
|
158
158
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
159
|
-
} }, this.labels.hours), h("div", { key: '
|
|
159
|
+
} }, this.labels.hours), h("div", { key: '3f7448b3161d594e3d601700e1a703a3f2857ffe', class: `${this.elementClassName}__control` }, h("button", { key: '19f8cf8fdfc931e0baa10b98864589990d628b7f', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, h("svg", { key: 'fb12854d35131adad4250bf24e25936ad583f74f', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '8176d2b9d15e81ef7c700064cadd2b83b8572593', points: "18 15 12 9 6 15" }))), h("input", { key: '66986ad937685f83bf1bc999c4aabf5f2ed9d3d9', 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 }), h("button", { key: 'd225e66235e04132bf461bb6e73377a823db1b9f', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, h("svg", { key: '387c4d7ddb7097da7032345db6c09db5e0ea0d0b', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '4c307b1ecb096d3c4d42ed7c79b0c8cde004842a', points: "6 9 12 15 18 9" }))))), h("div", { key: '9c8101ae559b74d985286688e3147aacc80ab448', class: `${this.elementClassName}__separator` }, ":"), h("div", { key: '8a49a068478e1fda98634e1d74bb399b5ae1a5f4', class: `${this.elementClassName}__field` }, h("label", { key: '3c585236e76192d10f013aff1a765f9b31e9bce6', htmlFor: `${this.elementClassName}-minutes`, class: {
|
|
160
160
|
[`${this.elementClassName}__label`]: true,
|
|
161
161
|
[`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
|
|
162
|
-
} }, this.labels.minutes), h("div", { key: '
|
|
162
|
+
} }, this.labels.minutes), h("div", { key: '8d567d355ae2f34c51c057c81ea0921a8de6f012', class: `${this.elementClassName}__control` }, h("button", { key: 'a061d7d4b66b787d4478d54bc36525e5d9bf7e61', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, h("svg", { key: '148244241427e2bca0f6fc7147f9ca5a329c4480', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'd10fa3e7a7815b8806d583041aeae70b4de0e267', points: "18 15 12 9 6 15" }))), h("input", { key: 'db14c0a90805afede369a9e0878191537e9eef9f', 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 }), h("button", { key: '1820f55ac22cd78494a40fa7b5f2e1c1ea191a18', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, h("svg", { key: '9135d7673f58babaf44b0c33ad1755b3097aea01', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'f36192868f379fc2abe3b2deade678eeab725ee1', points: "6 9 12 15 18 9" }))))), this.useTwelveHourFormat && (h("div", { key: '6bf685eaed72c157b8c01c40e8b84bace096d417', class: `${this.elementClassName}__period` }, h("button", { key: '107a2a21de03626e15b35cd850f5ee8a2eb09f8e', type: "button", class: {
|
|
163
163
|
[`${this.elementClassName}__period-button`]: true,
|
|
164
164
|
[`${this.elementClassName}__period-button--active`]: this.period === "AM"
|
|
165
|
-
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '
|
|
165
|
+
}, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '62ad24e781b8da40699e4f91acbc20eeef1c2f65', type: "button", class: {
|
|
166
166
|
[`${this.elementClassName}__period-button`]: true,
|
|
167
167
|
[`${this.elementClassName}__period-button--active`]: this.period === "PM"
|
|
168
168
|
}, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
|
|
@@ -178,4 +178,4 @@ const InclusiveTimesPicker = class {
|
|
|
178
178
|
}; }
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
export {
|
|
181
|
+
export { TabworthyTimesPicker as tabworthy_times_picker };
|
|
@@ -39,7 +39,6 @@ const InclusiveTimes = class {
|
|
|
39
39
|
this.useTwelveHourFormat = true;
|
|
40
40
|
// Labels used for internal translations
|
|
41
41
|
this.timesLabels = defaultLabels;
|
|
42
|
-
// Prevent hiding the calendar
|
|
43
42
|
this.inline = false;
|
|
44
43
|
// Current error state of the input field
|
|
45
44
|
this.hasError = false;
|
|
@@ -236,10 +235,10 @@ const InclusiveTimes = class {
|
|
|
236
235
|
}
|
|
237
236
|
render() {
|
|
238
237
|
var _a;
|
|
239
|
-
return (h(Host, { key: '
|
|
238
|
+
return (h(Host, { key: '50d45c4b42629ab4db986c798de53bffcfb94018', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '9b97b3a86a29629b5acef900cd46c12401a0ed15', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '84e4b339f17a14b036e08c3ed55c28ebf8ff1eef', class: this.getClassName("input-container"), ref: (r) => (this.inputContainerRef = r) }, h("input", { key: 'f189b9624b1e7a9d80a71dbdbcadc606d4e8c431', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: {
|
|
240
239
|
[this.getClassName("input")]: true,
|
|
241
240
|
[this.inputClass]: !!this.inputClass
|
|
242
|
-
}, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: '
|
|
241
|
+
}, placeholder: this.placeholder, disabled: this.disabledState || this.disableFreeformInput, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: 'dc54c9ff8d4fab01d6175584320de0a0b8282cb2', type: "button", onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: '1102460f03ffbd9dd3878376fc37fe19aaa50f54', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
243
242
|
if (this.pickerRef) {
|
|
244
243
|
this.pickerRef.modalIsOpen = true;
|
|
245
244
|
}
|
|
@@ -247,7 +246,7 @@ const InclusiveTimes = class {
|
|
|
247
246
|
if (this.pickerRef) {
|
|
248
247
|
this.pickerRef.modalIsOpen = false;
|
|
249
248
|
}
|
|
250
|
-
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: '
|
|
249
|
+
}, inline: this.inline, appendTo: this.appendTo }, h("div", { key: 'fbce75861b31c85a58055eb4dc1c3f9ad0d0be73', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: '265ab52d552985fddd4c6944fb2405baadae1450', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline, value: this.value ? this.toDate(this.value) : undefined }, h("div", { key: 'f7377b3ff5a818849afcab7297a6f3d732dd4b82', slot: "after-calendar", class: this.getClassName("time-section") }, h("hr", { key: 'd71bc64c57fc8073e4af045347f9be69e20bac9f', class: this.getClassName("divider") }), h("tabworthy-times-picker", { key: '2ee95db049c3a81b26fa38b9bb4288f0850dc25f', hours: this.selectedHours, minutes: this.selectedMinutes, useTwelveHourFormat: this.useTwelveHourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange, labels: this.timesPickerLabels }))))), this.errorState && (h("div", { key: '0b0f79267ba191582d5e23be27970b16db80aab7', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
251
250
|
}
|
|
252
251
|
get el() { return getElement(this); }
|
|
253
252
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as h}from"./p-CwtZ_Lud.js";const a={hours:"Hours",minutes:"Minutes",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes"},n=class{constructor(e){t(this,e),this.timeChanged=i(this,"timeChanged",7),this.hours=12,this.minutes=0,this.useTwelveHourFormat=!1,this.labels=a,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const i=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===i?0:i:12===i?12:i+12:i,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const i=this.getDisplayHours();this.internalHours="AM"===t?12===i?0:i:12===i?12:i+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=12===t?1:t+1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),i=1===t?12:t-1;this.internalHours="AM"===this.period?12===i?0:i:12===i?12:i+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()}}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.period=this.hours>=12?"PM":"AM"}getDisplayHours(){return this.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,period:this.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),i=this.useTwelveHourFormat?12:23,h=this.useTwelveHourFormat?1:0;return e(s,{key:"5c9fbbe95d08e086bf78761da0375526f5042d15",class:this.elementClassName,"aria-label":this.labels.timePicker},e("div",{key:"f914ccebcf2025226762b1446944be41b555b5ea",class:`${this.elementClassName}__container`},e("div",{key:"a17ed2def130bbe92a17dd733f1b516d68ae98f3",class:`${this.elementClassName}__field`},e("label",{key:"513ca90795cca3c209df22def8fae8dd377d74ef",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),e("div",{key:"3f7448b3161d594e3d601700e1a703a3f2857ffe",class:`${this.elementClassName}__control`},e("button",{key:"19f8cf8fdfc931e0baa10b98864589990d628b7f",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},e("svg",{key:"fb12854d35131adad4250bf24e25936ad583f74f",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"8176d2b9d15e81ef7c700064cadd2b83b8572593",points:"18 15 12 9 6 15"}))),e("input",{key:"66986ad937685f83bf1bc999c4aabf5f2ed9d3d9",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:h,max:i,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),e("button",{key:"d225e66235e04132bf461bb6e73377a823db1b9f",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},e("svg",{key:"387c4d7ddb7097da7032345db6c09db5e0ea0d0b",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"4c307b1ecb096d3c4d42ed7c79b0c8cde004842a",points:"6 9 12 15 18 9"}))))),e("div",{key:"9c8101ae559b74d985286688e3147aacc80ab448",class:`${this.elementClassName}__separator`},":"),e("div",{key:"8a49a068478e1fda98634e1d74bb399b5ae1a5f4",class:`${this.elementClassName}__field`},e("label",{key:"3c585236e76192d10f013aff1a765f9b31e9bce6",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),e("div",{key:"8d567d355ae2f34c51c057c81ea0921a8de6f012",class:`${this.elementClassName}__control`},e("button",{key:"a061d7d4b66b787d4478d54bc36525e5d9bf7e61",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},e("svg",{key:"148244241427e2bca0f6fc7147f9ca5a329c4480",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"d10fa3e7a7815b8806d583041aeae70b4de0e267",points:"18 15 12 9 6 15"}))),e("input",{key:"db14c0a90805afede369a9e0878191537e9eef9f",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}),e("button",{key:"1820f55ac22cd78494a40fa7b5f2e1c1ea191a18",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},e("svg",{key:"9135d7673f58babaf44b0c33ad1755b3097aea01",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"f36192868f379fc2abe3b2deade678eeab725ee1",points:"6 9 12 15 18 9"}))))),this.useTwelveHourFormat&&e("div",{key:"6bf685eaed72c157b8c01c40e8b84bace096d417",class:`${this.elementClassName}__period`},e("button",{key:"107a2a21de03626e15b35cd850f5ee8a2eb09f8e",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),e("button",{key:"62ad24e781b8da40699e4f91acbc20eeef1c2f65",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return h(this)}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}}};export{n as tabworthy_times_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as
|
|
1
|
+
import{r as t,c as s,h as i,H as h,g as e}from"./p-CwtZ_Lud.js";import{h as a}from"./p-Mki5YqAR.js";import{g as r,r as o}from"./p-BVHu5CWV.js";const d={selected:"selected",openCalendar:"Choose time",calendar:"date and time picker",invalidDateError:"We could not find a matching date",minDateError:"Please fill in a date after ",maxDateError:"Please fill in a date before ",rangeOutOfBoundsError:"Please enter a valid range of dates",disabledDateError:"Please choose an available date",to:"to",startDate:"Start date",timeLabel:"Time"},n=class{constructor(i){t(this,i),this.selectDateTime=s(this,"selectDateTime",7),this.changeYear=s(this,"changeYear",7),this.componentReady=s(this,"componentReady",7),this.range=!1,this.label="Choose a date and time",this.placeholder="",this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.disabled=!1,this.startDate=r(new Date),this.referenceDate=r(new Date),this.useTwelveHourFormat=!0,this.timesLabels=d,this.inline=!1,this.hasError=!1,this.showYearStepper=!1,this.showMonthStepper=!0,this.showClearButton=!0,this.showTodayButton=!0,this.disableDate=()=>!1,this.elementClassName="tabworthy-times",this.firstDayOfWeek=1,this.format="YYYY-MM-DDTHH:mm:ss",this.inputShouldFormat=!0,this.disableFreeformInput=!1,this.inputClass="",this.selectedHours=12,this.selectedMinutes=0,this.errorState=this.hasError,this.disabledState=this.disabled,this.errorMessage="",this.handlePickerSelection=async t=>{const s=t.split(",");if(this.range&&2===s.length){const t=o(new Date(s[0])),i=o(new Date(s[1]));this.updateValue([t,i]),this.pickerRef&&(this.pickerRef.value=[t,i])}else{const t=o(new Date(s[0]));this.updateValue(t),this.pickerRef&&(this.pickerRef.value=t)}},this.handleTimeChange=t=>{this.selectedHours=t.detail.hours,this.selectedMinutes=t.detail.minutes,this.selectedDate&&this.updateValue(this.selectedDate)},this.handleCalendarButtonClick=async()=>{this.modalRef&&(await this.modalRef.setTriggerElement(this.inputContainerRef),await this.modalRef.open())},this.handleYearChange=t=>{this.changeYear&&this.changeYear.emit(t)},this.handleChangedMonths=()=>{},this.handleInputBlur=()=>{this.shouldInputFormat()&&this.formatInput()},this.handleInputChange=t=>{const s=a(t.target.value);s.isValid()&&(this.selectedHours=s.hours(),this.selectedMinutes=s.minutes(),this.updateValue(s.toDate()))}}shouldInputFormat(){return"string"==typeof this.inputShouldFormat?"true"===this.inputShouldFormat:!!this.inputShouldFormat}watchValue(t){this.syncFromValueProp()}watchDisabled(t){this.disabledState=t}watchHasError(t){this.errorState=t}componentDidLoad(){this.syncFromValueProp(),this.componentReady.emit(),this.id||console.error('tabworthy-times: The "id" prop is required for accessibility')}syncFromValueProp(){if(this.value){this.internalValue=this.value;const t=Array.isArray(this.value)?this.value[0]:this.value;if(t){const s=a(t,this.format);s.isValid()&&(this.selectedDate=s.toDate(),this.selectedHours=s.hours(),this.selectedMinutes=s.minutes())}}else this.internalValue=null}updateValue(t){if(Array.isArray(t)){const s=t.map((t=>{const s=a(t);return s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0),s.format(this.format)}));this.internalValue=s,this.value=s,this.selectDateTime.emit(s)}else{const s=a(t);s.hours(this.selectedHours),s.minutes(this.selectedMinutes),s.seconds(0);const i=s.format(this.format);this.internalValue=i,this.value=i,this.selectedDate=t,this.selectDateTime.emit(i)}this.errorState=!1,this.shouldInputFormat()&&this.formatInput()}formatInput(){if(this.internalValue)if(Array.isArray(this.internalValue)){const t=this.internalValue.map((t=>a(t,this.format).format("lll"))).join(` ${this.timesLabels.to} `);this.inputRef.value=t}else this.inputRef.value=a(this.internalValue,this.format).format("lll")}getClassName(t){return`${this.elementClassName}__${t}`}toDate(t){return t?Array.isArray(t)?t.map((t=>a(t,this.format).toDate())):a(t,this.format).toDate():null}async clearValue(){this.internalValue=null,this.value=void 0,this.selectedDate=void 0,this.inputRef.value="",this.pickerRef&&(this.pickerRef.value=null),this.selectDateTime.emit(void 0)}render(){var t;return i(h,{key:"50d45c4b42629ab4db986c798de53bffcfb94018",class:this.elementClassName,"has-error":this.errorState,disabled:this.disabledState},i("label",{key:"9b97b3a86a29629b5acef900cd46c12401a0ed15",htmlFor:`${this.id}-input`,class:this.getClassName("label")},this.label),i("div",{key:"84e4b339f17a14b036e08c3ed55c28ebf8ff1eef",class:this.getClassName("input-container"),ref:t=>this.inputContainerRef=t},i("input",{key:"f189b9624b1e7a9d80a71dbdbcadc606d4e8c431",id:`${this.id}-input`,ref:t=>this.inputRef=t,type:"text",class:{[this.getClassName("input")]:!0,[this.inputClass]:!!this.inputClass},placeholder:this.placeholder,disabled:this.disabledState||this.disableFreeformInput,value:null===(t=this.internalValue)||void 0===t?void 0:t.toString(),onBlur:this.handleInputBlur,onChange:this.handleInputChange,"aria-describedby":this.errorState?`${this.id}-error`:void 0,"aria-invalid":this.errorState}),!this.inline&&i("button",{key:"dc54c9ff8d4fab01d6175584320de0a0b8282cb2",type:"button",onClick:this.handleCalendarButtonClick,class:this.getClassName("calendar-button"),disabled:this.disabledState},this.calendarButtonContent?i("span",{innerHTML:this.calendarButtonContent}):this.timesLabels.openCalendar)),i("tabworthy-dates-modal",{key:"1102460f03ffbd9dd3878376fc37fe19aaa50f54",label:this.timesLabels.calendar,ref:t=>this.modalRef=t,onOpened:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!0)},onClosed:()=>{this.pickerRef&&(this.pickerRef.modalIsOpen=!1)},inline:this.inline,appendTo:this.appendTo},i("div",{key:"fbce75861b31c85a58055eb4dc1c3f9ad0d0be73",class:this.getClassName("picker-container")},i("tabworthy-dates-calendar",{key:"265ab52d552985fddd4c6944fb2405baadae1450",range:this.range,locale:this.locale,onSelectDate:t=>this.handlePickerSelection(t.detail),onChangeMonth:t=>this.handleChangedMonths(t.detail),onChangeYear:t=>this.handleYearChange(t.detail),labels:this.datesCalendarLabels,ref:t=>this.pickerRef=t,startDate:this.startDate,firstDayOfWeek:this.firstDayOfWeek,showHiddenTitle:!0,disabled:this.disabledState,showMonthStepper:this.showMonthStepper,showYearStepper:this.showYearStepper,showClearButton:this.showClearButton,showTodayButton:this.showTodayButton,disableDate:this.disableDate,minDate:this.minDate,maxDate:this.maxDate,inline:this.inline,value:this.value?this.toDate(this.value):void 0},i("div",{key:"f7377b3ff5a818849afcab7297a6f3d732dd4b82",slot:"after-calendar",class:this.getClassName("time-section")},i("hr",{key:"d71bc64c57fc8073e4af045347f9be69e20bac9f",class:this.getClassName("divider")}),i("tabworthy-times-picker",{key:"2ee95db049c3a81b26fa38b9bb4288f0850dc25f",hours:this.selectedHours,minutes:this.selectedMinutes,useTwelveHourFormat:this.useTwelveHourFormat,disabled:this.disabledState,onTimeChanged:this.handleTimeChange,labels:this.timesPickerLabels}))))),this.errorState&&i("div",{key:"0b0f79267ba191582d5e23be27970b16db80aab7",class:this.getClassName("input-error"),id:this.id?`${this.id}-error`:void 0,role:"status"},this.errorMessage))}get el(){return e(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}}};export{n as tabworthy_times}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-CwtZ_Lud.js";export{s as setNonce}from"./p-CwtZ_Lud.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-
|
|
1
|
+
import{p as e,b as t}from"./p-CwtZ_Lud.js";export{s as setNonce}from"./p-CwtZ_Lud.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-81ad5b1f",[[2,"tabworthy-times-picker",{hours:[1026],minutes:[1026],useTwelveHourFormat:[4,"use-twelve-hour-format"],labels:[16],labelsSrOnly:[4,"labels-sr-only"],disabled:[4],elementClassName:[1,"element-class-name"],internalHours:[32],internalMinutes:[32],period:[32]},null,{hours:[{watchHours:0}],minutes:[{watchMinutes:0}]}]]],["p-ee41beed",[[262,"tabworthy-dates-calendar",{clearButtonContent:[1,"clear-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"],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}]}]]],["p-a595158c",[[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"],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"],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],errorState:[32],disabledState:[32],clearValue:[64]},null,{value:[{watchValue:0}],disabled:[{watchDisabled:0}],hasError:[{watchHasError:0}]}]]],["p-0e77d058",[[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"],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}]}]]]],e))));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import { TimesPickerLabels } from "../tabworthy-times-picker/tabworthy-times-picker";
|
|
2
3
|
import { DatesLabels } from "../tabworthy-dates/tabworthy-dates";
|
|
3
4
|
import { DatesCalendarLabels, YearChangedEventDetails } from "../tabworthy-dates-calendar/tabworthy-dates-calendar";
|
|
4
5
|
export interface TimesLabels extends Omit<DatesLabels, "quickSelection"> {
|
|
@@ -20,6 +21,7 @@ export declare class InclusiveTimes {
|
|
|
20
21
|
useTwelveHourFormat: boolean;
|
|
21
22
|
timesLabels: TimesLabels;
|
|
22
23
|
datesCalendarLabels?: DatesCalendarLabels;
|
|
24
|
+
timesPickerLabels?: TimesPickerLabels;
|
|
23
25
|
inline: boolean;
|
|
24
26
|
hasError: boolean;
|
|
25
27
|
showYearStepper: boolean;
|
|
@@ -4,7 +4,7 @@ export interface TimeValue {
|
|
|
4
4
|
minutes: number;
|
|
5
5
|
period?: "AM" | "PM";
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface TimesPickerLabels {
|
|
8
8
|
hours: string;
|
|
9
9
|
minutes: string;
|
|
10
10
|
am: string;
|
|
@@ -15,12 +15,12 @@ export interface InclusivekTimesPickerLabels {
|
|
|
15
15
|
incrementMinutes: string;
|
|
16
16
|
decrementMinutes: string;
|
|
17
17
|
}
|
|
18
|
-
export declare class
|
|
18
|
+
export declare class TabworthyTimesPicker {
|
|
19
19
|
el: HTMLElement;
|
|
20
20
|
hours: number;
|
|
21
21
|
minutes: number;
|
|
22
22
|
useTwelveHourFormat: boolean;
|
|
23
|
-
labels:
|
|
23
|
+
labels: TimesPickerLabels;
|
|
24
24
|
labelsSrOnly: boolean;
|
|
25
25
|
disabled: boolean;
|
|
26
26
|
elementClassName: string;
|
|
@@ -11,14 +11,16 @@ import { ChronoOptions, ChronoParsedDateString } from "../shared/utils/chrono-pa
|
|
|
11
11
|
import { DatesCalendarLabels as DatesCalendarLabels1, MonthChangedEventDetails, YearChangedEventDetails as YearChangedEventDetails1 } from "./components/tabworthy-dates-calendar/tabworthy-dates-calendar";
|
|
12
12
|
import { Placement } from "@popperjs/core";
|
|
13
13
|
import { TimesLabels } from "./components/tabworthy-times/tabworthy-times";
|
|
14
|
-
import {
|
|
14
|
+
import { TimesPickerLabels } from "./components/tabworthy-times-picker/tabworthy-times-picker";
|
|
15
|
+
import { TimesPickerLabels as TimesPickerLabels1, TimeValue } from "./components/tabworthy-times-picker/tabworthy-times-picker";
|
|
15
16
|
export { DatesLabels } from "./components/tabworthy-dates/tabworthy-dates";
|
|
16
17
|
export { DatesCalendarLabels, YearChangedEventDetails } from "./components/tabworthy-dates-calendar/tabworthy-dates-calendar";
|
|
17
18
|
export { ChronoOptions, ChronoParsedDateString } from "../shared/utils/chrono-parser/chrono-parser.type";
|
|
18
19
|
export { DatesCalendarLabels as DatesCalendarLabels1, MonthChangedEventDetails, YearChangedEventDetails as YearChangedEventDetails1 } from "./components/tabworthy-dates-calendar/tabworthy-dates-calendar";
|
|
19
20
|
export { Placement } from "@popperjs/core";
|
|
20
21
|
export { TimesLabels } from "./components/tabworthy-times/tabworthy-times";
|
|
21
|
-
export {
|
|
22
|
+
export { TimesPickerLabels } from "./components/tabworthy-times-picker/tabworthy-times-picker";
|
|
23
|
+
export { TimesPickerLabels as TimesPickerLabels1, TimeValue } from "./components/tabworthy-times-picker/tabworthy-times-picker";
|
|
22
24
|
export namespace Components {
|
|
23
25
|
interface TabworthyDates {
|
|
24
26
|
/**
|
|
@@ -343,6 +345,7 @@ export namespace Components {
|
|
|
343
345
|
* @default defaultLabels
|
|
344
346
|
*/
|
|
345
347
|
"timesLabels": TimesLabels;
|
|
348
|
+
"timesPickerLabels"?: TimesPickerLabels;
|
|
346
349
|
/**
|
|
347
350
|
* @default true
|
|
348
351
|
*/
|
|
@@ -365,7 +368,7 @@ export namespace Components {
|
|
|
365
368
|
/**
|
|
366
369
|
* @default defaultLabels
|
|
367
370
|
*/
|
|
368
|
-
"labels":
|
|
371
|
+
"labels": TimesPickerLabels1;
|
|
369
372
|
/**
|
|
370
373
|
* @default true
|
|
371
374
|
*/
|
|
@@ -822,6 +825,7 @@ declare namespace LocalJSX {
|
|
|
822
825
|
* @default defaultLabels
|
|
823
826
|
*/
|
|
824
827
|
"timesLabels"?: TimesLabels;
|
|
828
|
+
"timesPickerLabels"?: TimesPickerLabels;
|
|
825
829
|
/**
|
|
826
830
|
* @default true
|
|
827
831
|
*/
|
|
@@ -844,7 +848,7 @@ declare namespace LocalJSX {
|
|
|
844
848
|
/**
|
|
845
849
|
* @default defaultLabels
|
|
846
850
|
*/
|
|
847
|
-
"labels"?:
|
|
851
|
+
"labels"?: TimesPickerLabels1;
|
|
848
852
|
/**
|
|
849
853
|
* @default true
|
|
850
854
|
*/
|