diff --git a/README.md b/README.md index cb4929767..b6eff8874 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Rate on Openbase](https://badges.openbase.com/js/rating/@eonasdan/tempus-dominus.svg)](https://openbase.com/js/@eonasdan/tempus-dominus?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge) -# Tempus Dominus Date/Time Picker v6.1.3 +# Tempus Dominus Date/Time Picker v6.2.4 Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions. diff --git a/build/plugins.js b/build/plugins.js index d38e9b255..0f5f660ea 100644 --- a/build/plugins.js +++ b/build/plugins.js @@ -16,7 +16,8 @@ async function build(option) { await bundle.write(option.output); } -(async () => { +async function locales() { + console.log('Building Locales...'); try { /* eslint-disable no-restricted-syntax, no-await-in-loop */ // We use await-in-loop to make rollup run sequentially to save on RAM @@ -29,7 +30,14 @@ async function build(option) { name: `tempusDominus.locales.${formatName(l)}` })); } + } catch (e) { + console.error(e); // eslint-disable-line no-console + } +} +async function plugins() { + console.log('Building Plugins...'); + try { const plugins = await promisifyReadDir(path.join(__dirname, '../src/plugins')); for (const plugin of plugins.filter(x => x !== 'examples')) { // run builds sequentially to limit RAM usage @@ -52,4 +60,22 @@ async function build(option) { } catch (e) { console.error(e); // eslint-disable-line no-console } -})(); +} + +const args = process.argv.slice(2); + +let command = 'all'; + +if (args.length !== 0) command = args[0]; + +switch (command) { + case '-p': + plugins().then(); + break; + case '-l': + locales().then(); + break; + case 'all': + plugins().then(() => locales().then()); + break; +} diff --git a/dist/js/jQuery-provider.js b/dist/js/jQuery-provider.js index 79660e641..ff7369d13 100644 --- a/dist/js/jQuery-provider.js +++ b/dist/js/jQuery-provider.js @@ -2,7 +2,7 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/js/jQuery-provider.min.js b/dist/js/jQuery-provider.min.js index d0ff3da56..4ae17ff58 100644 --- a/dist/js/jQuery-provider.min.js +++ b/dist/js/jQuery-provider.min.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/js/tempus-dominus.esm.js b/dist/js/tempus-dominus.esm.js index 1c0c742ea..28c6c5143 100644 --- a/dist/js/tempus-dominus.esm.js +++ b/dist/js/tempus-dominus.esm.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -510,7 +510,7 @@ class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName, lower, upper) { + numbersOutOfRange(optionName, lower, upper) { const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`); error.code = 4; throw error; @@ -1127,7 +1127,7 @@ const DefaultOptions = { /** * This is only used with the customDateFormat plugin */ - format: 'L' + format: 'L LT' }, keepInvalid: false, debug: false, @@ -1270,7 +1270,7 @@ class OptionConverter { } this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); + Namespace.errorMessages.numbersOutOfRange('restrictions.disabledHours', 0, 23); return value; case 'enabledHours': if (value === undefined) { @@ -1278,7 +1278,7 @@ class OptionConverter { } this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); + Namespace.errorMessages.numbersOutOfRange('restrictions.enabledHours', 0, 23); return value; case 'daysOfWeekDisabled': if (value === undefined) { @@ -1286,7 +1286,7 @@ class OptionConverter { } this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); + Namespace.errorMessages.numbersOutOfRange('restrictions.daysOfWeekDisabled', 0, 6); return value; case 'enabledDates': if (value === undefined) { @@ -3866,7 +3866,7 @@ const extend = function (plugin, option) { } return tempusDominus; }; -const version = '6.1.3'; +const version = '6.2.4'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.esm.js.map b/dist/js/tempus-dominus.esm.js.map index 9cc52c751..8808b60cc 100644 --- a/dist/js/tempus-dominus.esm.js.map +++ b/dist/js/tempus-dominus.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRage(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import {DateTime} from \"../datetime\";\r\nimport CalendarModes from \"./calendar-modes\";\r\nimport ViewMode from \"./view-mode\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n viewDate = new DateTime();\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element ||\r\n inputElement instanceof Date) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, localization: FormatLocalization) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'defaultDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'viewDate': {\r\n const dateTime = this.dateConversion(value, 'viewDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'viewDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'minDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.minDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.minDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'maxDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.maxDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.maxDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'disabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.disabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.disabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'enabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.enabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.enabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'daysOfWeekDisabled':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.daysOfWeekDisabled',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 6).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.daysOfWeekDisabled',\r\n 0,\r\n 6\r\n );\r\n return value;\r\n case 'enabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.enabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.disabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledTimeIntervals':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n let d = valueObject[i][vk];\r\n const dateTime = this.dateConversion(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n case 'toolbarPlacement':\r\n case 'type':\r\n case 'viewMode':\r\n case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto']\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = this.dateConversion(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = this._dateTypeCheck(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.1.3';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions\r\n}\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;IAAY,KAOX;AAPD,CAAA,UAAY,IAAI,EAAA;AACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,IAAI,KAAJ,IAAI,GAOf,EAAA,CAAA,CAAA,CAAA;AAED,MAAM,gBAAgB,GAAG;AACvB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,IAAI,EAAE,SAAS;A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AAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;AAC1F,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,QAAQ;AAExB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;CACR;;;;"} \ No newline at end of file +{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import {DateTime} from \"../datetime\";\r\nimport CalendarModes from \"./calendar-modes\";\r\nimport ViewMode from \"./view-mode\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n viewDate = new DateTime();\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element ||\r\n inputElement instanceof Date) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, localization: FormatLocalization) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'defaultDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'viewDate': {\r\n const dateTime = this.dateConversion(value, 'viewDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'viewDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'minDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.minDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.minDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'maxDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.maxDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.maxDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'disabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.disabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.disabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'enabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.enabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.enabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'daysOfWeekDisabled':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.daysOfWeekDisabled',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 6).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.daysOfWeekDisabled',\r\n 0,\r\n 6\r\n );\r\n return value;\r\n case 'enabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.enabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.disabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledTimeIntervals':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n let d = valueObject[i][vk];\r\n const dateTime = this.dateConversion(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n case 'toolbarPlacement':\r\n case 'type':\r\n case 'viewMode':\r\n case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto']\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = this.dateConversion(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = this._dateTypeCheck(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.4';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions\r\n}\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;IAAY,KAOX;AAPD,CAAA,UAAY,IAAI,EAAA;AACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,IAAI,KAAJ,IAAI,GAOf,EAAA,CAAA,CAAA,CAAA;AAED,MAAM,gBAAgB,GAAG;AACvB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,IAAI;CACb,CAAA;AAED,MAAM,0BAA0B,GAAG;AACjC,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,KAAK;CACd,CAAA;AAQM,MAAM,eAAe,GAAG,CAAC,IAAU,KAAY;AACpD,IAAA,QAAQ,IAAI;AACV,QAAA,KAAK,MAAM;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AAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;CACR;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.esm.min.js b/dist/js/tempus-dominus.esm.min.js index 0a107d3c6..0ae2a6a40 100644 --- a/dist/js/tempus-dominus.esm.min.js +++ b/dist/js/tempus-dominus.esm.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -var t;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(t||(t={}));const e={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},s={hour:"2-digit",hour12:!1},i=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class o extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new o(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new o(t)}get clone(){return new o(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.date);break;case"month":this.startOf(t.date),this.setDate(1);break;case"year":this.startOf(t.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.date),this.manipulate(6+s-this.weekDay,t.date);break;case"month":this.endOf(t.date),this.manipulate(1,t.month),this.setDate(0);break;case"year":this.endOf(t.date),this.manipulate(1,t.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=o.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,e).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,e).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,s).hour}get twelveHoursFormatted(){return this.parts(void 0,e).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,e).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,e).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class a extends Error{}class n{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new a(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new a(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new a(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new a(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRage(t,e,s){const i=new a(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new a(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new a(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new a(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new a(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new a(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new a(`${this.base} ${t}`);throw e.code=9,e}}const r="tempus-dominus";class d{}d.NAME=r,d.dataKey="td",d.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},d.css=new class{constructor(){this.widget=`${r}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},d.errorMessages=new n;class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let l;const h=[{name:"calendar",className:d.css.daysContainer,unit:t.month,step:1},{name:"months",className:d.css.monthsContainer,unit:t.year,step:1},{name:"years",className:d.css.yearsContainer,unit:t.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:t.year,step:100}];class p{constructor(){this.viewDate=new o,this._currentCalendarViewMode=0,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}}class u{constructor(){this.optionsStore=l.locate(p)}isValid(e,s){if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.month&&s!==t.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.hours||s===t.minutes||s===t.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=e.format(i(t.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(i(t.date)))).find((t=>t===s))}_isInEnabledDates(e){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=e.format(i(t.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(i(t.date)))).find((t=>t===s))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const g={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new o,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class v{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||i instanceof Date||Array.isArray(i)||(e[s]=v.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>v.isValue(t)||v.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=v.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=v.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||v.ignoreProperties.includes(a)?e[a]=v.processKey(a,c,r,d,s,i):v.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("restrictions.maxDate",s,"DateTime or Date");break}case"disabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.disabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&d.errorMessages.numbersOutOfRage("restrictions.disabledHours",0,23),e);case"enabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.enabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&d.errorMessages.numbersOutOfRage("restrictions.enabledHours",0,23),e);case"daysOfWeekDisabled":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.daysOfWeekDisabled",e,s),e.filter((t=>t<0||t>6)).length>0&&d.errorMessages.numbersOutOfRage("restrictions.daysOfWeekDisabled",0,6),e);case"enabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.enabledDates",e,s,a),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,a),e);case"disabledTimeIntervals":if(void 0===e)return[];Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const n=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=n[e][s];const r=this.dateConversion(o,i,a);r||d.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a.locale),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||d.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||e?.appendChild)&&d.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;d.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:d.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){const s=v.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||g.localization;return v.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(d.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){if(t.constructor.name===o.name)return t;if(t.constructor.name===Date.name)return o.convert(t);if("string"==typeof t){const s=o.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}static _typeCheckDateArray(t,e,s,i){Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||d.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e,s){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const i=this._dateTypeCheck(t,s);return i||d.errorMessages.failedToParseDate(e,t,"input"===e),i}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(g),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||d.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&d.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&d.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}v.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],v.isValue=t=>null!=t;class S{constructor(){this._dates=[],this.optionsStore=l.locate(p),this.validation=l.locate(u),this._eventEmitters=l.locate(y)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return v.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=i(e);let o=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===o))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=i(e);let o=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(o)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:d.events.error,reason:d.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var w;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(w||(w={}));var b=w;class f{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(d.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",b.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.month),t.month)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.month),t.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let a=this.optionsStore.viewDate.clone.startOf(t.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.hours);i.querySelectorAll(`[data-action="${b.selectDay}"], .${d.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(d.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${a.week}`)}let i=[];i.push(d.css.day),a.isBefore(this.optionsStore.viewDate,t.month)&&i.push(d.css.old),a.isAfter(this.optionsStore.viewDate,t.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(a,t.date)&&i.push(d.css.active),this.validation.isValid(a,t.date)||i.push(d.css.disabled),a.isSame(new o,t.date)&&i.push(d.css.today),0!==a.weekDay&&6!==a.weekDay||i.push(d.css.weekend),s(t.date,a,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${a.year}-${a.monthFormatted}-${a.dateFormatted}`),e.setAttribute("data-day",`${a.date}`),e.innerText=a.format({day:"numeric"}),a.manipulate(1,t.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(d.css.dayOfTheWeek,d.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.date),s.push(i)}return s}}class D{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.year),t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.year),t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.month)&&a.push(d.css.active),this.validation.isValid(o,t.month)||a.push(d.css.disabled),s(t.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.month)}))}}class k{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.year);const i=e.getElementsByClassName(d.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this._startYear,t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this._endYear,t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year).manipulate(-1,t.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((e=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.year)&&i.push(d.css.active),this.validation.isValid(o,t.year)||i.push(d.css.disabled),s(t.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.year)}))}}class _{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=S.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._endDecade.year=o;const a=e.getElementsByClassName(d.css.decadesContainer)[0],[n,r,c]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,t.year)?c.classList.remove(d.css.disabled):c.classList.add(d.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${b.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(d.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(d.css.disabled),e.classList.add(d.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(d.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.year)}))}}class C{constructor(){this._gridColumns="",this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(d.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(d.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.hours),t.hours)||s.querySelector(`[data-action=${b.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.hours),t.hours)||s.querySelector(`[data-action=${b.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.minutes),t.minutes)||s.querySelector(`[data-action=${b.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.minutes),t.minutes)||s.querySelector(`[data-action=${b.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.seconds),t.seconds)||s.querySelector(`[data-action=${b.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.seconds),t.seconds)||s.querySelector(`[data-action=${b.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${b.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.hours))?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const c=a.cloneNode(!0);c.innerHTML=":";const l=(t=!1)=>t?c.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",b.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",b.showHours),e.setAttribute("data-time-component",t.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",b.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",b.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",b.showMinutes),e.setAttribute("data-time-component",t.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",b.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",b.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",b.showSeconds),e.setAttribute("data-time-component",t.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",b.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",b.toggleMeridiem),e.setAttribute("tabindex","-1"),d.css.toggleMeridiem.includes(",")?e.classList.add(...d.css.toggleMeridiem.split(",")):e.classList.add(d.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(d.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.date);i.querySelectorAll(`[data-action="${b.selectHour}"]`).forEach((e=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,t.hours)||i.push(d.css.disabled),s(t.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.hours)}))}}class M{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${b.selectMinute}"]`).forEach((e=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,t.minutes)||i.push(d.css.disabled),s(t.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.minutes)}))}}class L{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.minutes);i.querySelectorAll(`[data-action="${b.selectSecond}"]`).forEach((e=>{let i=[];i.push(d.css.second),this.validation.isValid(o,t.seconds)||i.push(d.css.disabled),s(t.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.seconds)}))}}class T{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{T.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse))}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{T.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}T.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=l.locate(p),this.validation=l.locate(u),this.dates=l.locate(S),this.dateDisplay=l.locate(f),this.monthDisplay=l.locate(D),this.yearDisplay=l.locate(k),this.decadeDisplay=l.locate(_),this.timeDisplay=l.locate(C),this.hourDisplay=l.locate(E),this.minuteDisplay=l.locate(M),this.secondDisplay=l.locate(L),this._eventEmitters=l.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.date:this.dateDisplay._update(this.widget,this.paint);break;case t.month:this.monthDisplay._update(this.widget,this.paint);break;case t.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.hours),this._update(t.minutes),this._update(t.seconds);break;case"calendar":this._update(t.date),this._update(t.year),this._update(t.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new o).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?T.show(this.widget.querySelector(`div.${d.css.timeContainer}`)):T.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`))),T.show(this.widget.querySelector(`div.${d.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(d.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(d.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${d.css.dateContainer} > div:not(.${d.css.calendarHeader}), .${d.css.timeContainer} > div:not(.${d.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case d.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case d.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case d.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case d.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(d.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(d.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(d.css.isDarkPreferredQuery).matches;switch(t){case"light":return d.css.lightTheme;case"dark":return d.css.darkTheme;case"auto":return e?d.css.darkTheme:d.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${d.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(d.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case d.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case d.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case d.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case d.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(d.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:d.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(d.css.widget);const e=document.createElement("div");e.classList.add(d.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(d.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(d.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(d.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(d.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(d.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(d.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(d.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(d.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(d.css.calendarHeader);const e=document.createElement("div");e.classList.add(d.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(d.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u),this.display=l.locate(A),this._eventEmitters=l.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(d.css.disabled))return!1;s=s||i?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const n=+i.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=n;break;case b.selectYear:case b.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case b.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(d.css.old)&&r.manipulate(-1,t.month),i.classList.contains(d.css.new)&&r.manipulate(1,t.month),r.date=+i.dataset.day;let c=0;this.optionsStore.options.multipleDates?(c=this.dates.pickedIndex(r,t.date),-1!==c?this.dates.setValue(null,c):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case b.selectHour:let l=+i.dataset.value;a.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),a.hours=l,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectMinute:a.minutes=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectSecond:a.seconds=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.incrementHours:this.manipulateAndSet(a,t.hours);break;case b.incrementMinutes:this.manipulateAndSet(a,t.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(a,t.seconds);break;case b.decrementHours:this.manipulateAndSet(a,t.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(a,t.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(a,t.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(a,t.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(b.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${d.css.dateContainer}, .${d.css.timeContainer}`).forEach((t=>T.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(T.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),T.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new o).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,t.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void d.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${d.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case b.showClock:s=d.css.clockContainer,this.display._update("clock");break;case b.showHours:s=d.css.hourContainer,this.display._update(t.hours);break;case b.showMinutes:s=d.css.minuteContainer,this.display._update(t.minutes);break;case b.showSeconds:s=d.css.secondContainer,this.display._update(t.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},l=new c,this._eventEmitters=l.locate(y),this.optionsStore=l.locate(p),this.display=l.locate(A),this.dates=l.locate(S),this.actions=l.locate($),t||d.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,g,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()}))}get viewDate(){return this.optionsStore.viewDate}updateOptions(t,e=!1){e?this._initializeOptions(t,g):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&d.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:d.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=v.deepCopy(t);i=v._mergeOptions(i,e),s&&(i=v._dataToOptions(this.optionsStore.element,i)),v._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${d.css.switch} div`)},action:b.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={},H=t=>{V[t.name]||(V[t.name]=t.localization)},x=t=>{let e=V[t];e&&(g.localization=e)},P=function(t,e){return t?(t.installed||(t(e,{TempusDominus:O,Dates:S,Display:A,DateTime:o,ErrorMessages:n},N),t.installed=!0),N):N},I="6.1.3",N={TempusDominus:O,extend:P,loadLocale:H,locale:x,Namespace:d,DefaultOptions:g,DateTime:o,Unit:t,version:"6.1.3"};export{o as DateTime,g as DefaultOptions,d as Namespace,O as TempusDominus,t as Unit,P as extend,H as loadLocale,x as locale,I as version}; +var t;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(t||(t={}));const e={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},s={hour:"2-digit",hour12:!1},i=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class o extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new o(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new o(t)}get clone(){return new o(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.date);break;case"month":this.startOf(t.date),this.setDate(1);break;case"year":this.startOf(t.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.date),this.manipulate(6+s-this.weekDay,t.date);break;case"month":this.endOf(t.date),this.manipulate(1,t.month),this.setDate(0);break;case"year":this.endOf(t.date),this.manipulate(1,t.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=o.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,e).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,e).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,s).hour}get twelveHoursFormatted(){return this.parts(void 0,e).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,e).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,e).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class a extends Error{}class n{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new a(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new a(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new a(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new a(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new a(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new a(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new a(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new a(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new a(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new a(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new a(`${this.base} ${t}`);throw e.code=9,e}}const r="tempus-dominus";class d{}d.NAME=r,d.dataKey="td",d.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},d.css=new class{constructor(){this.widget=`${r}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},d.errorMessages=new n;class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let l;const h=[{name:"calendar",className:d.css.daysContainer,unit:t.month,step:1},{name:"months",className:d.css.monthsContainer,unit:t.year,step:1},{name:"years",className:d.css.yearsContainer,unit:t.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:t.year,step:100}];class p{constructor(){this.viewDate=new o,this._currentCalendarViewMode=0,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}}class u{constructor(){this.optionsStore=l.locate(p)}isValid(e,s){if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.month&&s!==t.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.hours||s===t.minutes||s===t.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=e.format(i(t.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(i(t.date)))).find((t=>t===s))}_isInEnabledDates(e){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=e.format(i(t.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(i(t.date)))).find((t=>t===s))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const g={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new o,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class v{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||i instanceof Date||Array.isArray(i)||(e[s]=v.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>v.isValue(t)||v.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=v.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=v.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||v.ignoreProperties.includes(a)?e[a]=v.processKey(a,c,r,d,s,i):v.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate",a);if(void 0!==t)return t.setLocale(a.locale),t;d.errorMessages.typeMismatch("restrictions.maxDate",s,"DateTime or Date");break}case"disabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.disabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&d.errorMessages.numbersOutOfRange("restrictions.disabledHours",0,23),e);case"enabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.enabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&d.errorMessages.numbersOutOfRange("restrictions.enabledHours",0,23),e);case"daysOfWeekDisabled":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.daysOfWeekDisabled",e,s),e.filter((t=>t<0||t>6)).length>0&&d.errorMessages.numbersOutOfRange("restrictions.daysOfWeekDisabled",0,6),e);case"enabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.enabledDates",e,s,a),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,a),e);case"disabledTimeIntervals":if(void 0===e)return[];Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const n=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=n[e][s];const r=this.dateConversion(o,i,a);r||d.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a.locale),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||d.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||e?.appendChild)&&d.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;d.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:d.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){const s=v.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||g.localization;return v.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(d.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){if(t.constructor.name===o.name)return t;if(t.constructor.name===Date.name)return o.convert(t);if("string"==typeof t){const s=o.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}static _typeCheckDateArray(t,e,s,i){Array.isArray(e)||d.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||d.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e,s){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const i=this._dateTypeCheck(t,s);return i||d.errorMessages.failedToParseDate(e,t,"input"===e),i}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(g),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||d.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&d.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&d.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}v.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],v.isValue=t=>null!=t;class S{constructor(){this._dates=[],this.optionsStore=l.locate(p),this.validation=l.locate(u),this._eventEmitters=l.locate(y)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return v.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=i(e);let o=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===o))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=i(e);let o=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(o)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this._eventEmitters.triggerEvent.emit({type:d.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:d.events.error,reason:d.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var w;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(w||(w={}));var b=w;class f{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(d.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",b.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.month),t.month)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.month),t.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let a=this.optionsStore.viewDate.clone.startOf(t.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.hours);i.querySelectorAll(`[data-action="${b.selectDay}"], .${d.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(d.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${a.week}`)}let i=[];i.push(d.css.day),a.isBefore(this.optionsStore.viewDate,t.month)&&i.push(d.css.old),a.isAfter(this.optionsStore.viewDate,t.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(a,t.date)&&i.push(d.css.active),this.validation.isValid(a,t.date)||i.push(d.css.disabled),a.isSame(new o,t.date)&&i.push(d.css.today),0!==a.weekDay&&6!==a.weekDay||i.push(d.css.weekend),s(t.date,a,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${a.year}-${a.monthFormatted}-${a.dateFormatted}`),e.setAttribute("data-day",`${a.date}`),e.innerText=a.format({day:"numeric"}),a.manipulate(1,t.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(d.css.calendarWeeks,d.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(d.css.dayOfTheWeek,d.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.date),s.push(i)}return s}}class D{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.year),t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.year),t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.month)&&a.push(d.css.active),this.validation.isValid(o,t.month)||a.push(d.css.disabled),s(t.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.month)}))}}class k{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.year);const i=e.getElementsByClassName(d.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this._startYear,t.year)?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled),this.validation.isValid(this._endYear,t.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.year).manipulate(-1,t.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((e=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.year)&&i.push(d.css.active),this.validation.isValid(o,t.year)||i.push(d.css.disabled),s(t.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.year)}))}}class _{constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=S.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.year),this._endDecade.year=o;const a=e.getElementsByClassName(d.css.decadesContainer)[0],[n,r,c]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,t.year)?c.classList.remove(d.css.disabled):c.classList.add(d.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${b.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(d.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(d.css.disabled),e.classList.add(d.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(d.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.year)}))}}class C{constructor(){this._gridColumns="",this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(d.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(d.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.hours),t.hours)||s.querySelector(`[data-action=${b.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.hours),t.hours)||s.querySelector(`[data-action=${b.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.minutes),t.minutes)||s.querySelector(`[data-action=${b.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.minutes),t.minutes)||s.querySelector(`[data-action=${b.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.seconds),t.seconds)||s.querySelector(`[data-action=${b.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.seconds),t.seconds)||s.querySelector(`[data-action=${b.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${t.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${b.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.hours))?e.classList.remove(d.css.disabled):e.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const c=a.cloneNode(!0);c.innerHTML=":";const l=(t=!1)=>t?c.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",b.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",b.showHours),e.setAttribute("data-time-component",t.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",b.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",b.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",b.showMinutes),e.setAttribute("data-time-component",t.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",b.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",b.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",b.showSeconds),e.setAttribute("data-time-component",t.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",b.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",b.toggleMeridiem),e.setAttribute("tabindex","-1"),d.css.toggleMeridiem.includes(",")?e.classList.add(...d.css.toggleMeridiem.split(",")):e.classList.add(d.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(d.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.date);i.querySelectorAll(`[data-action="${b.selectHour}"]`).forEach((e=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,t.hours)||i.push(d.css.disabled),s(t.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.hours)}))}}class M{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${b.selectMinute}"]`).forEach((e=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,t.minutes)||i.push(d.css.disabled),s(t.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.minutes)}))}}class L{constructor(){this.optionsStore=l.locate(p),this.validation=l.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(d.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.minutes);i.querySelectorAll(`[data-action="${b.selectSecond}"]`).forEach((e=>{let i=[];i.push(d.css.second),this.validation.isValid(o,t.seconds)||i.push(d.css.disabled),s(t.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.seconds)}))}}class T{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{T.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse))}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{T.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}T.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=l.locate(p),this.validation=l.locate(u),this.dates=l.locate(S),this.dateDisplay=l.locate(f),this.monthDisplay=l.locate(D),this.yearDisplay=l.locate(k),this.decadeDisplay=l.locate(_),this.timeDisplay=l.locate(C),this.hourDisplay=l.locate(E),this.minuteDisplay=l.locate(M),this.secondDisplay=l.locate(L),this._eventEmitters=l.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.date:this.dateDisplay._update(this.widget,this.paint);break;case t.month:this.monthDisplay._update(this.widget,this.paint);break;case t.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.hours),this._update(t.minutes),this._update(t.seconds);break;case"calendar":this._update(t.date),this._update(t.year),this._update(t.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new o).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?T.show(this.widget.querySelector(`div.${d.css.timeContainer}`)):T.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`))),T.show(this.widget.querySelector(`div.${d.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(d.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(d.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${d.css.dateContainer} > div:not(.${d.css.calendarHeader}), .${d.css.timeContainer} > div:not(.${d.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case d.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case d.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case d.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case d.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(d.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(d.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(d.css.isDarkPreferredQuery).matches;switch(t){case"light":return d.css.lightTheme;case"dark":return d.css.darkTheme;case"auto":return e?d.css.darkTheme:d.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${d.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(d.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case d.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case d.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case d.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case d.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(d.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:d.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(d.css.widget);const e=document.createElement("div");e.classList.add(d.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(d.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(d.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(d.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(d.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(d.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(d.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(d.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(d.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(d.css.calendarHeader);const e=document.createElement("div");e.classList.add(d.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(d.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=l.locate(p),this.dates=l.locate(S),this.validation=l.locate(u),this.display=l.locate(A),this._eventEmitters=l.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(d.css.disabled))return!1;s=s||i?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const n=+i.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=n;break;case b.selectYear:case b.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case b.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(d.css.old)&&r.manipulate(-1,t.month),i.classList.contains(d.css.new)&&r.manipulate(1,t.month),r.date=+i.dataset.day;let c=0;this.optionsStore.options.multipleDates?(c=this.dates.pickedIndex(r,t.date),-1!==c?this.dates.setValue(null,c):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case b.selectHour:let l=+i.dataset.value;a.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),a.hours=l,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectMinute:a.minutes=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectSecond:a.seconds=+i.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.incrementHours:this.manipulateAndSet(a,t.hours);break;case b.incrementMinutes:this.manipulateAndSet(a,t.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(a,t.seconds);break;case b.decrementHours:this.manipulateAndSet(a,t.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(a,t.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(a,t.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(a,t.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(b.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${d.css.dateContainer}, .${d.css.timeContainer}`).forEach((t=>T.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(T.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),T.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new o).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,t.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void d.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${d.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case b.showClock:s=d.css.clockContainer,this.display._update("clock");break;case b.showHours:s=d.css.hourContainer,this.display._update(t.hours);break;case b.showMinutes:s=d.css.minuteContainer,this.display._update(t.minutes);break;case b.showSeconds:s=d.css.secondContainer,this.display._update(t.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},l=new c,this._eventEmitters=l.locate(y),this.optionsStore=l.locate(p),this.display=l.locate(A),this.dates=l.locate(S),this.actions=l.locate($),t||d.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,g,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()}))}get viewDate(){return this.optionsStore.viewDate}updateOptions(t,e=!1){e?this._initializeOptions(t,g):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&d.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:d.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=v.deepCopy(t);i=v._mergeOptions(i,e),s&&(i=v._dataToOptions(this.optionsStore.element,i)),v._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${d.css.switch} div`)},action:b.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={},H=t=>{V[t.name]||(V[t.name]=t.localization)},x=t=>{let e=V[t];e&&(g.localization=e)},P=function(t,e){return t?(t.installed||(t(e,{TempusDominus:O,Dates:S,Display:A,DateTime:o,ErrorMessages:n},N),t.installed=!0),N):N},I="6.2.4",N={TempusDominus:O,extend:P,loadLocale:H,locale:x,Namespace:d,DefaultOptions:g,DateTime:o,Unit:t,version:"6.2.4"};export{o as DateTime,g as DefaultOptions,d as Namespace,O as TempusDominus,t as Unit,P as extend,H as loadLocale,x as locale,I as version}; diff --git a/dist/js/tempus-dominus.js b/dist/js/tempus-dominus.js index c735c19b9..6837a54e8 100644 --- a/dist/js/tempus-dominus.js +++ b/dist/js/tempus-dominus.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -516,7 +516,7 @@ * @param lower * @param upper */ - numbersOutOfRage(optionName, lower, upper) { + numbersOutOfRange(optionName, lower, upper) { const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`); error.code = 4; throw error; @@ -1133,7 +1133,7 @@ /** * This is only used with the customDateFormat plugin */ - format: 'L' + format: 'L LT' }, keepInvalid: false, debug: false, @@ -1276,7 +1276,7 @@ } this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); + Namespace.errorMessages.numbersOutOfRange('restrictions.disabledHours', 0, 23); return value; case 'enabledHours': if (value === undefined) { @@ -1284,7 +1284,7 @@ } this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); + Namespace.errorMessages.numbersOutOfRange('restrictions.enabledHours', 0, 23); return value; case 'daysOfWeekDisabled': if (value === undefined) { @@ -1292,7 +1292,7 @@ } this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); + Namespace.errorMessages.numbersOutOfRange('restrictions.daysOfWeekDisabled', 0, 6); return value; case 'enabledDates': if (value === undefined) { @@ -3872,7 +3872,7 @@ } return tempusDominus; }; - const version = '6.1.3'; + const version = '6.2.4'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.js.map b/dist/js/tempus-dominus.js.map index 8b16b53ef..2e5f1234b 100644 --- a/dist/js/tempus-dominus.js.map +++ b/dist/js/tempus-dominus.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRage(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import {DateTime} from \"../datetime\";\r\nimport CalendarModes from \"./calendar-modes\";\r\nimport ViewMode from \"./view-mode\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n viewDate = new DateTime();\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element ||\r\n inputElement instanceof Date) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, localization: FormatLocalization) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'defaultDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'viewDate': {\r\n const dateTime = this.dateConversion(value, 'viewDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'viewDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'minDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.minDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.minDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'maxDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.maxDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.maxDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'disabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.disabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.disabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'enabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.enabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.enabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'daysOfWeekDisabled':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.daysOfWeekDisabled',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 6).length > 0)\r\n Namespace.errorMessages.numbersOutOfRage(\r\n 'restrictions.daysOfWeekDisabled',\r\n 0,\r\n 6\r\n );\r\n return value;\r\n case 'enabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.enabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.disabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledTimeIntervals':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n let d = valueObject[i][vk];\r\n const dateTime = this.dateConversion(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n case 'toolbarPlacement':\r\n case 'type':\r\n case 'viewMode':\r\n case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto']\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = this.dateConversion(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = this._dateTypeCheck(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.1.3';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions\r\n}\r\n"],"names":["Unit","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;AAAYA,wBAOX;EAPD,CAAA,UAAY,IAAI,EAAA;EACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA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I,CAAC,KAAK;UAAE,OAAO;EACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;EACtC,EAAE;EAEF;EACA;;;;EAIG;AACH,QAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,EAAA;EACrC,IAAA,IAAI,CAAC,MAAM;EAAE,QAAA,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;EAC1F,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,QAAQ;EAExB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRD,YAAI;MACJ,OAAO;GACR;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * Attempts to create a DateTime from a string. A customDateFormat is required for non US dates.\r\n * @param input\r\n * @param localization\r\n */\r\n static fromString(input: string, localization: any): DateTime {\r\n return new DateTime(input);\r\n }\r\n\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(\r\n this.year,\r\n this.month,\r\n this.date,\r\n this.hours,\r\n this.minutes,\r\n this.seconds,\r\n this.getMilliseconds()\r\n ).setLocale(this.locale);\r\n }\r\n\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay':\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek) break;\r\n let goBack = this.weekDay;\r\n if (startOfTheWeek !== 0 && this.weekDay === 0) goBack = 8 - startOfTheWeek;\r\n this.manipulate(startOfTheWeek - goBack, Unit.date);\r\n break;\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay':\r\n this.endOf(Unit.date);\r\n this.manipulate((6 + startOfTheWeek) - this.weekDay, Unit.date);\r\n break;\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.year);\r\n this.setDate(0);\r\n break;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value: number, unit: Unit): this {\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An object. Uses browser defaults otherwise.\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template: DateTimeFormatOptions, locale = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isBefore(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isAfter(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n return (\r\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparision.\r\n */\r\n isSame(compare: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (\r\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\r\n );\r\n }\r\n\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(\r\n left: DateTime,\r\n right: DateTime,\r\n unit?: Unit,\r\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\r\n ): boolean {\r\n if (unit && this[unit] === undefined) throw new Error(`Unit '${unit}' is not valid`);\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n\r\n return (\r\n ((leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit))) ||\r\n ((leftInclusivity\r\n ? this.isBefore(left, unit)\r\n : !this.isAfter(left, unit)) &&\r\n (rightInclusivity\r\n ? this.isAfter(right, unit)\r\n : !this.isBefore(right, unit)))\r\n );\r\n }\r\n\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(\r\n locale = this.locale,\r\n template: any = { dateStyle: 'full', timeStyle: 'long' }\r\n ): any {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds(): number {\r\n return this.getSeconds();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value: number) {\r\n this.setSeconds(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes(): number {\r\n return this.getMinutes();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value: number) {\r\n this.setMinutes(value);\r\n }\r\n\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours(): number {\r\n return this.getHours();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value: number) {\r\n this.setHours(value);\r\n }\r\n\r\n /**\r\n * Returns two digit hours\r\n */\r\n get hoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message?: string) {\r\n const error = new TdError(\r\n `${this.base} customDateFormat: ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(\r\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\r\n );\r\n }\r\n\r\n throwError(message) {\r\n const error = new TdError(\r\n `${this.base} ${message}`\r\n );\r\n error.code = 9;\r\n throw error;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region used with notify.error\r\n\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n failedToSetInvalidDate = 'Failed to set invalid date';\r\n\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n failedToParseInput = 'Failed parse input field';\r\n\r\n //#endregion\r\n}\r\n","import { ErrorMessages } from './errors';\r\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\nconst NAME = 'tempus-dominus',\r\n dataKey = 'td';\r\n\r\n/**\r\n * Events\r\n */\r\nclass Events {\r\n key = `.${dataKey}`;\r\n\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n change = `change${this.key}`;\r\n\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n update = `update${this.key}`;\r\n\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n error = `error${this.key}`;\r\n\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n show = `show${this.key}`;\r\n\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n hide = `hide${this.key}`;\r\n\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n\r\n blur = `blur${this.key}`;\r\n focus = `focus${this.key}`;\r\n keyup = `keyup${this.key}`;\r\n keydown = `keydown${this.key}`;\r\n}\r\n\r\nclass Css {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n widget = `${NAME}-widget`;\r\n\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n calendarHeader = 'calendar-header';\r\n\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n switch = 'picker-switch';\r\n\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n toolbar = 'toolbar';\r\n\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n noHighlight = 'no-highlight';\r\n\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n sideBySide = 'timepicker-sbs';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n previous = 'previous';\r\n\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n next = 'next';\r\n\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n disabled = 'disabled';\r\n\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n old = 'old';\r\n\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n new = 'new';\r\n\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n active = 'active';\r\n\r\n //#region date element\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n decadesContainer = `${this.dateContainer}-decades`;\r\n\r\n /**\r\n * Applied to elements within the decades container, e.g. 2020, 2030\r\n */\r\n decade = 'decade';\r\n\r\n /**\r\n * The outer element for the years view.\r\n */\r\n yearsContainer = `${this.dateContainer}-years`;\r\n\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n year = 'year';\r\n\r\n /**\r\n * The outer element for the month view.\r\n */\r\n monthsContainer = `${this.dateContainer}-months`;\r\n\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n month = 'month';\r\n\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n daysContainer = `${this.dateContainer}-days`;\r\n\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n day = 'day';\r\n\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n calendarWeeks = 'cw';\r\n\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n dayOfTheWeek = 'dow';\r\n\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n today = 'today';\r\n\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n weekend = 'weekend';\r\n\r\n //#endregion\r\n\r\n //#region time element\r\n\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n timeContainer = 'time-container';\r\n\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n separator = 'separator';\r\n\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n secondContainer = `${this.timeContainer}-second`;\r\n\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n hour = 'hour';\r\n\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n minute = 'minute';\r\n\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n second = 'second';\r\n\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n toggleMeridiem = 'toggleMeridiem';\r\n\r\n //#endregion\r\n\r\n //#region collapse\r\n\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n show = 'show';\r\n\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n collapsing = 'td-collapsing';\r\n\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n collapse = 'td-collapse';\r\n\r\n //#endregion\r\n\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n inline = 'inline';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static dataKey = dataKey;\r\n\r\n static events = new Events();\r\n\r\n static css = new Css();\r\n\r\n static errorMessages = new ErrorMessages();\r\n}\r\n","export declare type Constructable = new (...args: any[]) => T;\r\n\r\nclass ServiceLocator {\r\n private cache: Map, unknown | Symbol> = new Map();\r\n\r\n locate(identifier: Constructable): T {\r\n const service = this.cache.get(identifier);\r\n if (service) return service as T;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n}\r\nexport const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n}\r\n\r\nexport let serviceLocator: ServiceLocator;\r\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import {DateTime} from \"../datetime\";\r\nimport CalendarModes from \"./calendar-modes\";\r\nimport ViewMode from \"./view-mode\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionsStore {\r\n options: Options;\r\n element: HTMLElement;\r\n viewDate = new DateTime();\r\n input: HTMLInputElement;\r\n unset: boolean;\r\n private _currentCalendarViewMode = 0;\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n\r\n minimumCalendarViewMode = 0;\r\n currentView: keyof ViewMode = 'calendar';\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\n\r\n/**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\nexport default class Validation {\r\n private optionsStore: OptionsStore;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n ordinal: (n) => n,\r\n /**\r\n * This is only used with the customDateFormat plugin\r\n */\r\n format: 'L LT'\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from './namespace';\r\nimport { DateTime } from '../datetime';\r\nimport DefaultOptions from './default-options';\r\nimport Options, { FormatLocalization } from './options';\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat',\r\n 'container', 'dateForms', 'ordinal'];\r\n\r\n static deepCopy(input): Options {\r\n const o = {};\r\n\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element ||\r\n inputElement instanceof Date) return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n\r\n return o;\r\n }\r\n\r\n private static isValue = a => a != null; // everything except undefined + null\r\n\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths: string, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param localization\r\n */\r\n static spread(provided, copyTo, path = '', localization: FormatLocalization) {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== '__proto__' && key !== 'constructor').forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], path, localization);\r\n } else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, localization: FormatLocalization) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'defaultDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'viewDate': {\r\n const dateTime = this.dateConversion(value, 'viewDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'viewDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'minDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.minDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.minDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'maxDate': {\r\n if (value === undefined) {\r\n return value;\r\n }\r\n const dateTime = this.dateConversion(value, 'restrictions.maxDate', localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(localization.locale);\r\n return dateTime;\r\n }\r\n Namespace.errorMessages.typeMismatch(\r\n 'restrictions.maxDate',\r\n providedType,\r\n 'DateTime or Date'\r\n );\r\n break;\r\n }\r\n case 'disabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.disabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.disabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'enabledHours':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.enabledHours',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 24).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.enabledHours',\r\n 0,\r\n 23\r\n );\r\n return value;\r\n case 'daysOfWeekDisabled':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckNumberArray(\r\n 'restrictions.daysOfWeekDisabled',\r\n value,\r\n providedType\r\n );\r\n if (value.filter((x) => x < 0 || x > 6).length > 0)\r\n Namespace.errorMessages.numbersOutOfRange(\r\n 'restrictions.daysOfWeekDisabled',\r\n 0,\r\n 6\r\n );\r\n return value;\r\n case 'enabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.enabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledDates':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n this._typeCheckDateArray(\r\n 'restrictions.disabledDates',\r\n value,\r\n providedType,\r\n localization\r\n );\r\n return value;\r\n case 'disabledTimeIntervals':\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n key,\r\n providedType,\r\n 'array of { from: DateTime|Date, to: DateTime|Date }'\r\n );\r\n }\r\n const valueObject = value as { from: any; to: any }[];\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n let d = valueObject[i][vk];\r\n const dateTime = this.dateConversion(d, subOptionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n subOptionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization.locale);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n case 'toolbarPlacement':\r\n case 'type':\r\n case 'viewMode':\r\n case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto']\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization =\r\n mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n\r\n OptionConverter.spread(providedOptions, newConfig, '', localization);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d: any, localization: FormatLocalization): DateTime | null {\r\n if (d.constructor.name === DateTime.name) return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n localization: FormatLocalization\r\n ) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of DateTime or Date'\r\n );\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n let d = value[i];\r\n const dateTime = this.dateConversion(d, optionName, localization);\r\n if (!dateTime) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n typeof d,\r\n 'DateTime or Date'\r\n );\r\n }\r\n dateTime.setLocale(localization?.locale ?? 'default');\r\n value[i] = dateTime;\r\n }\r\n }\r\n\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(\r\n optionName: string,\r\n value,\r\n providedType: string\r\n ) {\r\n if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(\r\n optionName,\r\n providedType,\r\n 'array of numbers'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d: any, optionName: string, localization: FormatLocalization): DateTime {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n\r\n const converted = this._dateTypeCheck(d, localization);\r\n\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(\r\n optionName,\r\n d,\r\n optionName === 'input'\r\n );\r\n }\r\n return converted;\r\n }\r\n\r\n private static _flattenDefaults: string[];\r\n\r\n private static getFlattenDefaultOptions(): string[] {\r\n if (this._flattenDefaults) return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t)) return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n } else {\r\n return pre.join('.');\r\n }\r\n };\r\n\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n\r\n return this._flattenDefaults;\r\n }\r\n\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config: Options) {\r\n if (\r\n config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(\r\n config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds\r\n ))\r\n ) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'Cannot use side by side mode without the clock components'\r\n );\r\n }\r\n\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'minDate is after maxDate'\r\n );\r\n }\r\n\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration(\r\n 'maxDate is before minDate'\r\n );\r\n }\r\n }\r\n }\r\n}\r\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\nexport default class Dates {\r\n private _dates: DateTime[] = [];\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked(): DateTime[] {\r\n return this._dates;\r\n }\r\n\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked(): DateTime {\r\n return this._dates[this.lastPickedIndex];\r\n }\r\n\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex(): number {\r\n if (this._dates.length === 0) return 0;\r\n return this._dates.length - 1;\r\n }\r\n\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date: DateTime): string {\r\n const components = this.optionsStore.options.display.components;\r\n if (!date) return '';\r\n return date.format({\r\n year: components.calendar && components.year ? 'numeric' : undefined,\r\n month: components.calendar && components.month ? '2-digit' : undefined,\r\n day: components.calendar && components.date ? '2-digit' : undefined,\r\n hour:\r\n components.clock && components.hours\r\n ? components.useTwentyfourHour\r\n ? '2-digit'\r\n : 'numeric'\r\n : undefined,\r\n minute: components.clock && components.minutes ? '2-digit' : undefined,\r\n second: components.clock && components.seconds ? '2-digit' : undefined,\r\n hour12: !components.useTwentyfourHour,\r\n });\r\n }\r\n \r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n parseInput(value:any): DateTime {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n setFromInput(value: any, index?: number) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocale(this.optionsStore.options.localization.locale);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date: DateTime): void {\r\n this._dates.push(date);\r\n }\r\n\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\r\n if (!unit) return this._dates.find((x) => x === targetDate) !== undefined;\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return (\r\n this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined\r\n );\r\n }\r\n\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\r\n if (!unit) return this._dates.indexOf(targetDate);\r\n\r\n const format = getFormatByUnit(unit);\r\n\r\n let innerDateFormatted = targetDate.format(format);\r\n\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n } as ChangeEvent);\r\n this._dates = [];\r\n }\r\n\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(\r\n factor: number,\r\n year: number\r\n ): [number, number, number] {\r\n const step = factor / 10,\r\n startYear = Math.floor(year / factor) * factor,\r\n endYear = startYear + step * 9,\r\n focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target?: DateTime, index?: number): void {\r\n const noIndex = typeof index === 'undefined',\r\n isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n\r\n const updateInput = () => {\r\n if (!this.optionsStore.input) return;\r\n\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n };\r\n\r\n if (target && oldDate?.isSame(target)) {\r\n updateInput();\r\n return;\r\n }\r\n\r\n // case of calling setValue(null)\r\n if (!target) {\r\n if (\r\n !this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear\r\n ) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n } else {\r\n this._dates.splice(index, 1);\r\n }\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n\r\n this._eventEmitters.updateDisplay.emit('all');\r\n return;\r\n }\r\n\r\n index = index || 0;\r\n target = target.clone;\r\n\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.seconds = 0;\r\n }\r\n\r\n if (this.validation.isValid(target)) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n } as ChangeEvent);\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.keepInvalid) {\r\n this._dates[index] = target;\r\n this.optionsStore.viewDate = target.clone;\r\n\r\n updateInput();\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: false,\r\n } as ChangeEvent);\r\n }\r\n\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n } as FailEvent);\r\n }\r\n}\r\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport Dates from \"../../dates\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `date`\r\n */\r\nexport default class DateDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.daysContainer);\r\n\r\n container.append(...this._daysOfTheWeek());\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n container.appendChild(div);\r\n }\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDay);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.daysContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport Validation from '../validation';\r\nimport Dates from '../dates';\r\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\r\nimport { serviceLocator } from '../utilities/service-locator';\r\nimport ActionTypes from '../utilities/action-types';\r\nimport CalendarModes from '../utilities/calendar-modes';\r\nimport { OptionsStore } from '../utilities/optionsStore';\r\n\r\n/**\r\n * Main class for all things display related.\r\n */\r\nexport default class Display {\r\n private _widget: HTMLElement;\r\n private _popperInstance: any;\r\n private _isVisible = false;\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n dateDisplay: DateDisplay;\r\n monthDisplay: MonthDisplay;\r\n yearDisplay: YearDisplay;\r\n decadeDisplay: DecadeDisplay;\r\n timeDisplay: TimeDisplay;\r\n hourDisplay: HourDisplay;\r\n minuteDisplay: MinuteDisplay;\r\n secondDisplay: SecondDisplay;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n\r\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\r\n this._update(result);\r\n });\r\n }\r\n\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget(): HTMLElement | undefined {\r\n return this._widget;\r\n }\r\n\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit: ViewUpdateValues): void {\r\n if (!this.widget) return;\r\n //todo do I want some kind of error catching or other guards here?\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime) break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n paint(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement:\r\n document.documentElement.dir === 'rtl'\r\n ? 'bottom-end'\r\n : 'bottom-start',\r\n }).then();\r\n } else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.addEventListener('click', this._actionsClickEvent)\r\n );\r\n\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n (\r\n this.widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0] as HTMLElement\r\n ).style.display = 'grid';\r\n }\r\n }\r\n\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n\r\n async createPopup(element: HTMLElement, widget: HTMLElement, options: any): Promise {\r\n let createPopperFunction;\r\n if((window as any)?.Popper) {\r\n createPopperFunction = (window as any)?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if(createPopperFunction){\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n\r\n updatePopup(): void {\r\n this._popperInstance?.update();\r\n }\r\n\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction?: number): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\r\n );\r\n if (this.optionsStore.currentCalendarViewMode == max) return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n\r\n this.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\r\n )\r\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\r\n\r\n const datePickerMode =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n let picker: HTMLElement = this.widget.querySelector(\r\n `.${datePickerMode.className}`\r\n );\r\n\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n\r\n picker.style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\nimport { ErrorMessages } from './utilities/errors';\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin) return tempusDominus;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, ErrorMessages }, tempusDominus);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus;\r\n};\r\n\r\nconst version = '6.2.4';\r\n\r\nconst tempusDominus = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version\r\n};\r\n\r\nexport {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DateTimeFormatOptions\r\n}\r\n"],"names":["Unit","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;AAAYA,wBAOX;EAPD,CAAA,UAAY,IAAI,EAAA;EACd,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;EACnB,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACb,IAAA,IAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;EACf,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;EACf,CAAC,EAPWA,YAAI,KAAJA,YAAI,GAOf,EAAA,CAAA,CAAA,CAAA;EAED,MAAM,gBAAgB,GAAG;EACvB,IAAA,KAAK,EAAE,SAAS;EAChB,IAAA,GAAG,EAAE,SAAS;EACd,IAAA,IA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A,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;EAC1F,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,QAAQ;EAExB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRD,YAAI;MACJ,OAAO;GACR;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.min.js b/dist/js/tempus-dominus.min.js index 98a688f7b..09eb143b1 100644 --- a/dist/js/tempus-dominus.min.js +++ b/dist/js/tempus-dominus.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";var e;t.Unit=void 0,(e=t.Unit||(t.Unit={})).seconds="seconds",e.minutes="minutes",e.hours="hours",e.date="date",e.month="month",e.year="year";const s={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},i={hour:"2-digit",hour12:!1},o=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class a extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new a(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new a(t)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break;case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.Unit.date),this.manipulate(6+s-this.weekDay,t.Unit.date);break;case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=a.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,s).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,s).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,i).hour}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,s).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,s).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class n extends Error{}class r{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new n(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new n(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new n(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new n(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRage(t,e,s){const i=new n(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new n(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new n(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new n(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new n(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new n(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}}const d="tempus-dominus";class c{}c.NAME=d,c.dataKey="td",c.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},c.css=new class{constructor(){this.widget=`${d}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},c.errorMessages=new r;class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:c.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:c.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:c.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:c.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this.viewDate=new a,this._currentCalendarViewMode=0,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=e.format(o(t.Unit.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(o(t.Unit.date)))).find((t=>t===s))}_isInEnabledDates(e){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=e.format(o(t.Unit.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(o(t.Unit.date)))).find((t=>t===s))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const v={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class S{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||i instanceof Date||Array.isArray(i)||(e[s]=S.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>S.isValue(t)||S.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=S.objectPath(s,v),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=S.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));c.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||S.ignoreProperties.includes(a)?e[a]=S.processKey(a,c,r,d,s,i):S.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("restrictions.maxDate",s,"DateTime or Date");break}case"disabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.disabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&c.errorMessages.numbersOutOfRage("restrictions.disabledHours",0,23),e);case"enabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.enabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&c.errorMessages.numbersOutOfRage("restrictions.enabledHours",0,23),e);case"daysOfWeekDisabled":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.daysOfWeekDisabled",e,s),e.filter((t=>t<0||t>6)).length>0&&c.errorMessages.numbersOutOfRage("restrictions.daysOfWeekDisabled",0,6),e);case"enabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.enabledDates",e,s,a),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,a),e);case"disabledTimeIntervals":if(void 0===e)return[];Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const n=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=n[e][s];const r=this.dateConversion(o,i,a);r||c.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a.locale),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||c.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||e?.appendChild)&&c.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;c.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:c.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){const s=S.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return S.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(c.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const s=a.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}static _typeCheckDateArray(t,e,s,i){Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||c.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e,s){"string"==typeof t&&"input"!==e&&c.errorMessages.dateString();const i=this._dateTypeCheck(t,s);return i||c.errorMessages.failedToParseDate(e,t,"input"===e),i}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||c.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&c.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&c.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}S.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],S.isValue=t=>null!=t;class w{constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return S.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=o(e);let i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=o(e);let i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:c.events.error,reason:c.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var f;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(f||(f={}));var b=f;class D{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(c.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",b.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${b.selectDay}"], .${c.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(c.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${o.week}`)}let i=[];i.push(c.css.day),o.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.old),o.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.date)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.date)||i.push(c.css.disabled),o.isSame(new a,t.Unit.date)&&i.push(c.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(c.css.weekend),s(t.Unit.date,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),e.setAttribute("data-day",`${o.date}`),e.innerText=o.format({day:"numeric"}),o.manipulate(1,t.Unit.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(c.css.dayOfTheWeek,c.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(i)}return s}}class k{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(c.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.month)&&a.push(c.css.active),this.validation.isValid(o,t.Unit.month)||a.push(c.css.disabled),s(t.Unit.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.Unit.month)}))}}class _{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const i=e.getElementsByClassName(c.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((e=>{let i=[];i.push(c.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.year)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.year)||i.push(c.css.disabled),s(t.Unit.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.Unit.year)}))}}class C{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=w.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=o;const a=e.getElementsByClassName(c.css.decadesContainer)[0],[n,r,d]=a.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(c.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?n.classList.remove(c.css.disabled):n.classList.add(c.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?d.classList.remove(c.css.disabled):d.classList.add(c.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${b.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(c.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(c.css.disabled),e.classList.add(c.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(c.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(c.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class M{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(c.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(c.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(c.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${b.incrementHours}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${b.decrementHours}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${b.incrementMinutes}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${b.decrementMinutes}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${b.incrementSeconds}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${b.decrementSeconds}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${b.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(c.css.separator,c.css.noHighlight);const d=a.cloneNode(!0);d.innerHTML=":";const l=(t=!1)=>t?d.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",b.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",b.showHours),e.setAttribute("data-time-component",t.Unit.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",b.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",b.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",b.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",b.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",b.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",b.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",b.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",b.toggleMeridiem),e.setAttribute("tabindex","-1"),c.css.toggleMeridiem.includes(",")?e.classList.add(...c.css.toggleMeridiem.split(",")):e.classList.add(c.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(c.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${b.selectHour}"]`).forEach((e=>{let i=[];i.push(c.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(c.css.disabled),s(t.Unit.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.Unit.hours)}))}}class L{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${b.selectMinute}"]`).forEach((e=>{let i=[];i.push(c.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(c.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.Unit.minutes)}))}}class T{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${b.selectSecond}"]`).forEach((e=>{let i=[];i.push(c.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(c.css.disabled),s(t.Unit.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.Unit.seconds)}))}}class U{static toggle(t){t.classList.contains(c.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(c.css.collapsing),t.classList.add(c.css.collapse,c.css.show),t.style.height=""}static show(t){if(t.classList.contains(c.css.collapsing)||t.classList.contains(c.css.show))return;t.style.height="0",t.classList.remove(c.css.collapse),t.classList.add(c.css.collapsing),setTimeout((()=>{U.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(c.css.collapsing,c.css.show),t.classList.add(c.css.collapse))}static hide(t){if(t.classList.contains(c.css.collapsing)||!t.classList.contains(c.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(c.css.collapse,c.css.show),t.classList.add(c.css.collapsing),t.style.height="",setTimeout((()=>{U.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}U.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate(w),this.dateDisplay=h.locate(D),this.monthDisplay=h.locate(k),this.yearDisplay=h.locate(_),this.decadeDisplay=h.locate(C),this.timeDisplay=h.locate(M),this.hourDisplay=h.locate(E),this.minuteDisplay=h.locate(L),this.secondDisplay=h.locate(T),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.Unit.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?U.show(this.widget.querySelector(`div.${c.css.timeContainer}`)):U.hideImmediately(this.widget.querySelector(`div.${c.css.timeContainer}`))),U.show(this.widget.querySelector(`div.${c.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(c.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(c.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:c.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${c.css.dateContainer} > div:not(.${c.css.calendarHeader}), .${c.css.timeContainer} > div:not(.${c.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case c.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case c.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case c.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case c.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(c.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(c.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(c.css.isDarkPreferredQuery).matches;switch(t){case"light":return c.css.lightTheme;case"dark":return c.css.darkTheme;case"auto":return e?c.css.darkTheme:c.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${c.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(c.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case c.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case c.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case c.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case c.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(c.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:c.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(c.css.widget);const e=document.createElement("div");e.classList.add(c.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(c.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(c.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(c.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(c.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(c.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(c.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(c.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(c.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(c.css.calendarHeader);const e=document.createElement("div");e.classList.add(c.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(c.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(c.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m),this.display=h.locate(A),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(c.css.disabled))return!1;s=s||i?.dataset?.action;const o=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const n=+i.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=n;break;case b.selectYear:case b.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case b.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(c.css.old)&&r.manipulate(-1,t.Unit.month),i.classList.contains(c.css.new)&&r.manipulate(1,t.Unit.month),r.date=+i.dataset.day;let d=0;this.optionsStore.options.multipleDates?(d=this.dates.pickedIndex(r,t.Unit.date),-1!==d?this.dates.setValue(null,d):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case b.selectHour:let l=+i.dataset.value;o.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),o.hours=l,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectMinute:o.minutes=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectSecond:o.seconds=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.incrementHours:this.manipulateAndSet(o,t.Unit.hours);break;case b.incrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(o,t.Unit.seconds);break;case b.decrementHours:this.manipulateAndSet(o,t.Unit.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(o,t.Unit.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(o,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(b.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${c.css.dateContainer}, .${c.css.timeContainer}`).forEach((t=>U.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(U.hideImmediately(this.display.widget.querySelector(`div.${c.css.dateContainer}`)),U.showImmediately(this.display.widget.querySelector(`div.${c.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,t.Unit.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void c.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${c.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case b.showClock:s=c.css.clockContainer,this.display._update("clock");break;case b.showHours:s=c.css.hourContainer,this.display._update(t.Unit.hours);break;case b.showMinutes:s=c.css.minuteContainer,this.display._update(t.Unit.minutes);break;case b.showSeconds:s=c.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},h=new l,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(A),this.dates=h.locate(w),this.actions=h.locate($),t||c.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()}))}get viewDate(){return this.optionsStore.viewDate}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&c.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:c.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=S.deepCopy(t);i=S._mergeOptions(i,e),s&&(i=S._dataToOptions(this.optionsStore.element,i)),S._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(c.css.show)[0].classList.contains(c.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${c.css.switch} div`)},action:b.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={},H=t=>{V[t.name]||(V[t.name]=t.localization)},x=t=>{let e=V[t];e&&(v.localization=e)},P=function(t,e){return t?(t.installed||(t(e,{TempusDominus:O,Dates:w,Display:A,DateTime:a,ErrorMessages:r},N),t.installed=!0),N):N},I="6.1.3",N={TempusDominus:O,extend:P,loadLocale:H,locale:x,Namespace:c,DefaultOptions:v,DateTime:a,Unit:t.Unit,version:I};t.DateTime=a,t.DefaultOptions=v,t.Namespace=c,t.TempusDominus=O,t.extend=P,t.loadLocale=H,t.locale=x,t.version=I,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";var e;t.Unit=void 0,(e=t.Unit||(t.Unit={})).seconds="seconds",e.minutes="minutes",e.hours="hours",e.date="date",e.month="month",e.year="year";const s={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},i={hour:"2-digit",hour12:!1},o=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class a extends Date{constructor(){super(...arguments),this.locale="default",this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335]}setLocale(t){return this.locale=t,this}static convert(t,e="default"){if(!t)throw new Error("A date is required");return new a(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}static fromString(t,e){return new a(t)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break;case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":this.endOf(t.Unit.date),this.manipulate(6+s-this.weekDay,t.Unit.date);break;case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.year),this.setDate(0)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}format(t,e=this.locale){return new Intl.DateTimeFormat(e,t).format(this)}isBefore(t,e){if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=a.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(a?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(a?this.isAfter(e,s):!this.isBefore(e,s))}parts(t=this.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,s).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,s).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){return this.parts(void 0,i).hour}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,s).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,s).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear(this.year-1):s>this.weeksInWeekYear(this.year)&&(s=1),s}weeksInWeekYear(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,s=t-1,i=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===e||3===i?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}}class n extends Error{}class r{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new n(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new n(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new n(`${this.base} Unexpected option value: ${t} does not accept a value of "${e}". Valid values are: ${s.join(", ")}`);throw i.code=2,i}typeMismatch(t,e,s){const i=new n(`${this.base} Mismatch types: ${t} has a type of ${e} instead of the required ${s}`);throw i.code=3,i}numbersOutOfRange(t,e,s){const i=new n(`${this.base} ${t} expected an array of number between ${e} and ${s}.`);throw i.code=4,i}failedToParseDate(t,e,s=!1){const i=new n(`${this.base} Could not correctly parse "${e}" to a date for ${t}.`);if(i.code=5,!s)throw i;console.warn(i)}mustProvideElement(){const t=new n(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new n(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new n(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}customDateFormatError(t){const e=new n(`${this.base} customDateFormat: ${t}`);throw e.code=9,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}}const d="tempus-dominus";class c{}c.NAME=d,c.dataKey="td",c.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},c.css=new class{constructor(){this.widget=`${d}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},c.errorMessages=new r;class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:c.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:c.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:c.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:c.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this.viewDate=new a,this._currentCalendarViewMode=0,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&e.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&e.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(e))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(e))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let t of this.optionsStore.options.restrictions.disabledTimeIntervals)if(e.isBetween(t.from,t.to))return!1}return!0}_isInDisabledDates(e){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=e.format(o(t.Unit.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(o(t.Unit.date)))).find((t=>t===s))}_isInEnabledDates(e){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=e.format(o(t.Unit.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(o(t.Unit.date)))).find((t=>t===s))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.find((t=>t===e))}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.find((t=>t===e))}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const v={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>t,format:"L LT"},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class S{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||i instanceof Date||Array.isArray(i)||(e[s]=S.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>S.isValue(t)||S.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i){const o=S.objectPath(s,v),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=S.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));c.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,c=t[a];if(null==c)return e[a]=c,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||S.ignoreProperties.includes(a)?e[a]=S.processKey(a,c,r,d,s,i):S.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate",a);if(void 0!==t)return t.setLocale(a.locale),t;c.errorMessages.typeMismatch("restrictions.maxDate",s,"DateTime or Date");break}case"disabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.disabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&c.errorMessages.numbersOutOfRange("restrictions.disabledHours",0,23),e);case"enabledHours":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.enabledHours",e,s),e.filter((t=>t<0||t>24)).length>0&&c.errorMessages.numbersOutOfRange("restrictions.enabledHours",0,23),e);case"daysOfWeekDisabled":return void 0===e?[]:(this._typeCheckNumberArray("restrictions.daysOfWeekDisabled",e,s),e.filter((t=>t<0||t>6)).length>0&&c.errorMessages.numbersOutOfRange("restrictions.daysOfWeekDisabled",0,6),e);case"enabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.enabledDates",e,s,a),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,a),e);case"disabledTimeIntervals":if(void 0===e)return[];Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const n=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=n[e][s];const r=this.dateConversion(o,i,a);r||c.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a.locale),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||c.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||e?.appendChild)&&c.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;c.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:c.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){const s=S.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return S.spread(t,s,"",i),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;let i={};const o=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},a=(t,e,s,i)=>{const n=o(s)[t[e].toLowerCase()],r={};return void 0===n||(s[n].constructor===Object?(e++,r[n]=a(t,e,s[n],i)):r[n]=i),r},n=o(e);return Object.keys(s).filter((t=>t.startsWith(c.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=n[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=n[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=a(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t,e){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const s=a.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}static _typeCheckDateArray(t,e,s,i){Array.isArray(e)||c.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||c.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e,s){"string"==typeof t&&"input"!==e&&c.errorMessages.dateString();const i=this._dateTypeCheck(t,s);return i||c.errorMessages.failedToParseDate(e,t,"input"===e),i}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||c.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&c.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&c.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}S.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],S.isValue=t=>null!=t;class w{constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){const e=this.optionsStore.options.display.components;return t?t.format({year:e.calendar&&e.year?"numeric":void 0,month:e.calendar&&e.month?"2-digit":void 0,day:e.calendar&&e.date?"2-digit":void 0,hour:e.clock&&e.hours?e.useTwentyfourHour?"2-digit":"numeric":void 0,minute:e.clock&&e.minutes?"2-digit":void 0,second:e.clock&&e.seconds?"2-digit":void 0,hour12:!e.useTwentyfourHour}):""}parseInput(t){return S.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocale(this.optionsStore.options.localization.locale),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!e)return void 0!==this._dates.find((e=>e===t));const s=o(e);let i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!e)return this._dates.indexOf(t);const s=o(e);let i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[]}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}setValue(t,e){const s=void 0===e,i=!t&&s;let o=this.optionsStore.unset?null:this._dates[e];!o&&!this.optionsStore.unset&&s&&i&&(o=this.lastPicked);const a=()=>{if(!this.optionsStore.input)return;let e=this.formatInput(t);this.optionsStore.options.multipleDates&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)};if(t&&o?.isSame(t))a();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:void 0,oldDate:o,isClear:i,isValid:!0}),void this._eventEmitters.updateDisplay.emit("all");if(e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.seconds=0),this.validation.isValid(t))return this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,a(),this._eventEmitters.triggerEvent.emit({type:c.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:c.events.error,reason:c.errorMessages.failedToSetInvalidDate,date:t,oldDate:o})}}}var f;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(f||(f={}));var b=f;class D{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(c.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}for(let e=0;e<42;e++){if(0!==e&&e%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",b.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${b.selectDay}"], .${c.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(c.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${o.week}`)}let i=[];i.push(c.css.day),o.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.old),o.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(c.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.date)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.date)||i.push(c.css.disabled),o.isSame(new a,t.Unit.date)&&i.push(c.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(c.css.weekend),s(t.Unit.date,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),e.setAttribute("data-day",`${o.date}`),e.innerText=o.format({day:"numeric"}),o.manipulate(1,t.Unit.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(c.css.calendarWeeks,c.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(c.css.dayOfTheWeek,c.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(i)}return s}}class k{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(c.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.month)&&a.push(c.css.active),this.validation.isValid(o,t.Unit.month)||a.push(c.css.disabled),s(t.Unit.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.Unit.month)}))}}class _{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const i=e.getElementsByClassName(c.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(c.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(c.css.disabled):s.classList.add(c.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?o.classList.remove(c.css.disabled):o.classList.add(c.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((e=>{let i=[];i.push(c.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.year)&&i.push(c.css.active),this.validation.isValid(o,t.Unit.year)||i.push(c.css.disabled),s(t.Unit.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.Unit.year)}))}}class C{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=w.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=o;const a=e.getElementsByClassName(c.css.decadesContainer)[0],[n,r,d]=a.parentElement.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(r.setAttribute(c.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?n.classList.remove(c.css.disabled):n.classList.add(c.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?d.classList.remove(c.css.disabled):d.classList.add(c.css.disabled));const l=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${b.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(c.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(c.css.disabled),e.classList.add(c.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));let o=[];o.push(c.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&l.filter((t=>t>=a&&t<=r)).length>0&&o.push(c.css.active),s("decade",this._startDecade,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class M{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(c.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(c.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(c.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${b.incrementHours}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${b.decrementHours}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=this.optionsStore.options.display.components.useTwentyfourHour?i.hoursFormatted:i.twelveHoursFormatted),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${b.incrementMinutes}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${b.decrementMinutes}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${b.incrementSeconds}]`).classList.add(c.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${b.decrementSeconds}]`).classList.add(c.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const e=s.querySelector(`[data-action=${b.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(c.css.disabled):e.classList.add(c.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);a.classList.add(c.css.separator,c.css.noHighlight);const d=a.cloneNode(!0);d.innerHTML=":";const l=(t=!1)=>t?d.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",b.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",b.showHours),e.setAttribute("data-time-component",t.Unit.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",b.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",b.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",b.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",b.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(l()),i.push(l(!0)),o.push(l()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",b.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",b.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",b.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=l();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",b.toggleMeridiem),e.setAttribute("tabindex","-1"),c.css.toggleMeridiem.includes(",")?e.classList.add(...c.css.toggleMeridiem.split(",")):e.classList.add(c.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(c.css.noHighlight),t.appendChild(e),i.push(t),t=l(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.hourContainer);for(let e=0;e<(this.optionsStore.options.display.components.useTwentyfourHour?24:12);e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${b.selectHour}"]`).forEach((e=>{let i=[];i.push(c.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(c.css.disabled),s(t.Unit.hours,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.hours}`),e.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,t.Unit.hours)}))}}class L{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.minuteContainer);let e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",b.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${b.selectMinute}"]`).forEach((e=>{let i=[];i.push(c.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(c.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.Unit.minutes)}))}}class T{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(c.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(c.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${b.selectSecond}"]`).forEach((e=>{let i=[];i.push(c.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(c.css.disabled),s(t.Unit.seconds,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.seconds}`),e.innerText=o.secondsFormatted,o.manipulate(5,t.Unit.seconds)}))}}class U{static toggle(t){t.classList.contains(c.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(c.css.collapsing),t.classList.add(c.css.collapse,c.css.show),t.style.height=""}static show(t){if(t.classList.contains(c.css.collapsing)||t.classList.contains(c.css.show))return;t.style.height="0",t.classList.remove(c.css.collapse),t.classList.add(c.css.collapsing),setTimeout((()=>{U.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(c.css.collapsing,c.css.show),t.classList.add(c.css.collapse))}static hide(t){if(t.classList.contains(c.css.collapsing)||!t.classList.contains(c.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(c.css.collapse,c.css.show),t.classList.add(c.css.collapsing),t.style.height="",setTimeout((()=>{U.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}U.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate(w),this.dateDisplay=h.locate(D),this.monthDisplay=h.locate(k),this.yearDisplay=h.locate(_),this.decadeDisplay=h.locate(C),this.timeDisplay=h.locate(M),this.hourDisplay=h.locate(E),this.minuteDisplay=h.locate(L),this.secondDisplay=h.locate(T),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!(this.validation.isValid(e)||(e.manipulate(i,t.Unit.date),s>31));)s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget(),this._updateTheme();const e=this._hasTime&&!this._hasDate;if(e&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),e||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?U.show(this.widget.querySelector(`div.${c.css.timeContainer}`)):U.hideImmediately(this.widget.querySelector(`div.${c.css.timeContainer}`))),U.show(this.widget.querySelector(`div.${c.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{(this.optionsStore.options?.container||document.body).appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(c.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(c.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:c.events.show}),this._isVisible=!0}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${c.css.dateContainer} > div:not(.${c.css.calendarHeader}), .${c.css.timeContainer} > div:not(.${c.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case c.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case c.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case c.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case c.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(c.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(c.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(c.css.isDarkPreferredQuery).matches;switch(t){case"light":return c.css.lightTheme;case"dark":return c.css.darkTheme;case"auto":return e?c.css.darkTheme:c.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${c.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(c.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(c.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case c.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case c.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case c.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case c.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(c.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:c.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(c.css.widget);const e=document.createElement("div");e.classList.add(c.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(c.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(c.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(c.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(c.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(c.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(c.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(c.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(c.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(c.css.calendarHeader);const e=document.createElement("div");e.classList.add(c.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(c.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(c.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m),this.display=h.locate(A),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const i=e?.currentTarget;if(i?.classList?.contains(c.css.disabled))return!1;s=s||i?.dataset?.action;const o=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const n=+i.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=n;break;case b.selectYear:case b.selectDecade:this.optionsStore.viewDate.year=n}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1);break;case b.selectDay:const r=this.optionsStore.viewDate.clone;i.classList.contains(c.css.old)&&r.manipulate(-1,t.Unit.month),i.classList.contains(c.css.new)&&r.manipulate(1,t.Unit.month),r.date=+i.dataset.day;let d=0;this.optionsStore.options.multipleDates?(d=this.dates.pickedIndex(r,t.Unit.date),-1!==d?this.dates.setValue(null,d):this.dates.setValue(r,this.dates.lastPickedIndex+1)):this.dates.setValue(r,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.display.hide();break;case b.selectHour:let l=+i.dataset.value;o.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(l+=12),o.hours=l,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectMinute:o.minutes=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectSecond:o.seconds=+i.dataset.value,this.dates.setValue(o,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.incrementHours:this.manipulateAndSet(o,t.Unit.hours);break;case b.incrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(o,t.Unit.seconds);break;case b.decrementHours:this.manipulateAndSet(o,t.Unit.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(o,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(o,t.Unit.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(o,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.togglePicker:i.getAttribute("title")===this.optionsStore.options.localization.selectDate?(i.setAttribute("title",this.optionsStore.options.localization.selectTime),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(i.setAttribute("title",this.optionsStore.options.localization.selectDate),i.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(b.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${c.css.dateContainer}, .${c.css.timeContainer}`).forEach((t=>U.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(U.hideImmediately(this.display.widget.querySelector(`div.${c.css.dateContainer}`)),U.showImmediately(this.display.widget.querySelector(`div.${c.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,t.Unit.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(e){if(!this.display._hasTime)return void c.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${c.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case b.showClock:s=c.css.clockContainer,this.display._update("clock");break;case b.showHours:s=c.css.hourContainer,this.display._update(t.Unit.hours);break;case b.showMinutes:s=c.css.minuteContainer,this.display._update(t.Unit.minutes);break;case b.showSeconds:s=c.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},h=new l,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(A),this.dates=h.locate(w),this.actions=h.locate($),t||c.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocale(this.optionsStore.options.localization.locale),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()}))}get viewDate(){return this.optionsStore.viewDate}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&c.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:c.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=S.deepCopy(t);i=S._mergeOptions(i,e),s&&(i=S._dataToOptions(this.optionsStore.element,i)),S._validateConflicts(i),i.viewDate=i.viewDate.setLocale(i.localization.locale),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),void 0===i.display.components.useTwentyfourHour&&(i.display.components.useTwentyfourHour=!i.viewDate.parts()?.dayPeriod),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{let t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(c.css.show)[0].classList.contains(c.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${c.css.switch} div`)},action:b.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={},H=t=>{V[t.name]||(V[t.name]=t.localization)},x=t=>{let e=V[t];e&&(v.localization=e)},P=function(t,e){return t?(t.installed||(t(e,{TempusDominus:O,Dates:w,Display:A,DateTime:a,ErrorMessages:r},N),t.installed=!0),N):N},I="6.2.4",N={TempusDominus:O,extend:P,loadLocale:H,locale:x,Namespace:c,DefaultOptions:v,DateTime:a,Unit:t.Unit,version:I};t.DateTime=a,t.DefaultOptions=v,t.Namespace=c,t.TempusDominus=O,t.extend=P,t.loadLocale=H,t.locale=x,t.version=I,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/locales/ar-SA.js b/dist/locales/ar-SA.js index 117b6ca22..1fd3a53be 100644 --- a/dist/locales/ar-SA.js +++ b/dist/locales/ar-SA.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ar.js b/dist/locales/ar.js index 2adb20bfd..59f3422ce 100644 --- a/dist/locales/ar.js +++ b/dist/locales/ar.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/de.js b/dist/locales/de.js index 5acd926ce..2345d30bc 100644 --- a/dist/locales/de.js +++ b/dist/locales/de.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/es.js b/dist/locales/es.js index 8169147d8..c88f71a59 100644 --- a/dist/locales/es.js +++ b/dist/locales/es.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fi.js b/dist/locales/fi.js index 9e09cfe52..1a6318c0d 100644 --- a/dist/locales/fi.js +++ b/dist/locales/fi.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fr.js b/dist/locales/fr.js index b85407c46..d0f04cb75 100644 --- a/dist/locales/fr.js +++ b/dist/locales/fr.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/it.js b/dist/locales/it.js index 8c6d233eb..0b3f226f9 100644 --- a/dist/locales/it.js +++ b/dist/locales/it.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/nl.js b/dist/locales/nl.js index 0297d1526..af3496b89 100644 --- a/dist/locales/nl.js +++ b/dist/locales/nl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ro.js b/dist/locales/ro.js index c57aab4a9..4b85d5c95 100644 --- a/dist/locales/ro.js +++ b/dist/locales/ro.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/ru.js b/dist/locales/ru.js index 6cfa503f6..35db6a4e6 100644 --- a/dist/locales/ru.js +++ b/dist/locales/ru.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/sl.js b/dist/locales/sl.js index a5261ff53..9ce761074 100644 --- a/dist/locales/sl.js +++ b/dist/locales/sl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/tr.js b/dist/locales/tr.js index e00c42581..e69821931 100644 --- a/dist/locales/tr.js +++ b/dist/locales/tr.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/plugins/customDateFormat.js b/dist/plugins/customDateFormat.js index 3d3ccb20b..6db905e6f 100644 --- a/dist/plugins/customDateFormat.js +++ b/dist/plugins/customDateFormat.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -240,7 +240,7 @@ return dateTime; if (JSON.stringify(dateTime) === 'null') return 'Invalid Date'; - const format = this.localization.format || `${this.englishFormats.L}, ${this.englishFormats.LT}`; + const format = this.replaceTokens(this.localization.format || `${this.englishFormats.L}, ${this.englishFormats.LT}`, this.localization.dateFormats); const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(dateTime); const matches = { yy: formatter({ year: '2-digit' }), diff --git a/dist/plugins/fa-five.js b/dist/plugins/fa-five.js index 1f7b13b97..52dd96e4e 100644 --- a/dist/plugins/fa-five.js +++ b/dist/plugins/fa-five.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/plugins/moment-parse.js b/dist/plugins/moment-parse.js index afdb214d6..2b32b9b89 100644 --- a/dist/plugins/moment-parse.js +++ b/dist/plugins/moment-parse.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/package-lock.json b/package-lock.json index 500923d32..e674a2cb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@eonasdan/tempus-dominus", - "version": "6.1.3", + "version": "6.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eonasdan/tempus-dominus", - "version": "6.1.3", + "version": "6.2.4", "license": "MIT", "devDependencies": { "@popperjs/core": "^2.11.6", diff --git a/package.json b/package.json index 548b394bb..302310441 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "Jonathan Peterson" }, "name": "@eonasdan/tempus-dominus", - "version": "6.1.3", + "version": "6.2.4", "style": "dist/css/tempus-dominus.css", "sass": "scss/tempus-dominus.scss", "main": "dist/js/tempus-dominus.js", @@ -18,8 +18,10 @@ "scripts": { "start": "npm run build && concurrently \"npm:*-watch\" \"npm run serve\"", "serve": "browser-sync start --config build/browser-sync-config.js", - "build": "node ./build/copyToDist.js && npm run rollup && npm run build:plugins", - "build:plugins": "node ./build/plugins.js", + "build": "node ./build/copyToDist.js && npm run rollup && npm run build:plugins-and-locales", + "build:plugins": "node ./build/plugins.js -p", + "build:locales": "node ./build/plugins.js -l", + "build:plugins-and-locales": "node ./build/plugins.js", "build:declarations": "tsc --declaration --emitDeclarationOnly --outDir types", "sass": "sass src/scss/tempus-dominus.scss ./dist/css/tempus-dominus.css", "rollup": "rollup -c ./build/rollup.config.js", diff --git a/src/docs/partials/change-log.html b/src/docs/partials/change-log.html index 173f80814..382b041ff 100644 --- a/src/docs/partials/change-log.html +++ b/src/docs/partials/change-log.html @@ -2,6 +2,23 @@

Version 6

+
+

6.2.4

+

Bug fixes

+
    +
  • Fix misspelling #2667
  • +
  • Fix issue with customFormatPlugin
  • +
+
+ +
+

6.2.3

+

Bug fixes

+
    +
  • Fix popper reference
  • +
+
+

6.2.1

New

diff --git a/src/docs/templates/index.html b/src/docs/templates/index.html index 90e34e9fc..2ab19bf6a 100644 --- a/src/docs/templates/index.html +++ b/src/docs/templates/index.html @@ -10,14 +10,14 @@

Powerful and robust date and time picker

- Currently v6.1.3 + Currently v6.2.4 · v5 docs

@@ -51,7 +51,6 @@

JsDelivr

Popper is required and must be included before the main picker script.

- Explore the docs
 <!-- Popperjs -->
 <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
diff --git a/src/docs/templates/shell.html b/src/docs/templates/shell.html
index 6d56ca10d..9e5a5f285 100644
--- a/src/docs/templates/shell.html
+++ b/src/docs/templates/shell.html
@@ -181,7 +181,7 @@
                                             target='_blank' rel='license noopener'>MIT, docs CC BY 3.0.
           
-          
  • Currently v6.1.3
  • +
  • Currently v6.2.4
  • diff --git a/src/js/jQuery-provider.js b/src/js/jQuery-provider.js index 79660e641..ff7369d13 100644 --- a/src/js/jQuery-provider.js +++ b/src/js/jQuery-provider.js @@ -2,7 +2,7 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.1.3 (https://getdatepicker.com/) + * Tempus Dominus v6.2.4 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/src/js/tempus-dominus.ts b/src/js/tempus-dominus.ts index be73a5eff..db1822bc3 100644 --- a/src/js/tempus-dominus.ts +++ b/src/js/tempus-dominus.ts @@ -558,7 +558,7 @@ const extend = function (plugin, option) { return tempusDominus; }; -const version = '6.1.3'; +const version = '6.2.4'; const tempusDominus = { TempusDominus, diff --git a/src/js/utilities/default-options.ts b/src/js/utilities/default-options.ts index 91d29e4b3..11b25badb 100644 --- a/src/js/utilities/default-options.ts +++ b/src/js/utilities/default-options.ts @@ -101,7 +101,7 @@ const DefaultOptions: Options = { /** * This is only used with the customDateFormat plugin */ - format: 'L' + format: 'L LT' }, keepInvalid: false, debug: false, diff --git a/src/js/utilities/errors.ts b/src/js/utilities/errors.ts index 7b2316139..85af98e85 100644 --- a/src/js/utilities/errors.ts +++ b/src/js/utilities/errors.ts @@ -76,7 +76,7 @@ export class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName: string, lower: number, upper: number) { + numbersOutOfRange(optionName: string, lower: number, upper: number) { const error = new TdError( `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.` ); diff --git a/src/js/utilities/optionConverter.ts b/src/js/utilities/optionConverter.ts index 4e836526d..081fc704c 100644 --- a/src/js/utilities/optionConverter.ts +++ b/src/js/utilities/optionConverter.ts @@ -168,7 +168,7 @@ export class OptionConverter { providedType ); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage( + Namespace.errorMessages.numbersOutOfRange( 'restrictions.disabledHours', 0, 23 @@ -184,7 +184,7 @@ export class OptionConverter { providedType ); if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage( + Namespace.errorMessages.numbersOutOfRange( 'restrictions.enabledHours', 0, 23 @@ -200,7 +200,7 @@ export class OptionConverter { providedType ); if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage( + Namespace.errorMessages.numbersOutOfRange( 'restrictions.daysOfWeekDisabled', 0, 6 diff --git a/src/nuget/TempusDominus.nuspec b/src/nuget/TempusDominus.nuspec index 859e2c40c..c082c14ae 100644 --- a/src/nuget/TempusDominus.nuspec +++ b/src/nuget/TempusDominus.nuspec @@ -2,7 +2,7 @@ TempusDominus - 6.1.3 + 6.2.4 Tempus Dominus Eonasdan Eonasdan diff --git a/src/nuget/TempusDominus.scss.nuspec b/src/nuget/TempusDominus.scss.nuspec index 803434f61..d46014f57 100644 --- a/src/nuget/TempusDominus.scss.nuspec +++ b/src/nuget/TempusDominus.scss.nuspec @@ -2,7 +2,7 @@ TempusDominus.scss - 6.1.3 + 6.2.4 Tempus Dominus Eonasdan Eonasdan diff --git a/src/plugins/customDateFormat/index.ts b/src/plugins/customDateFormat/index.ts index 6e7188f48..98140749f 100644 --- a/src/plugins/customDateFormat/index.ts +++ b/src/plugins/customDateFormat/index.ts @@ -252,7 +252,7 @@ class CustomDateFormat { if (!dateTime) return dateTime; if (JSON.stringify(dateTime) === 'null') return 'Invalid Date'; - const format = this.localization.format || `${this.englishFormats.L}, ${this.englishFormats.LT}`; + const format = this.replaceTokens(this.localization.format || `${this.englishFormats.L}, ${this.englishFormats.LT}`, this.localization.dateFormats); const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(dateTime); diff --git a/types/tempus-dominus.d.ts b/types/tempus-dominus.d.ts index 03ca64fe5..b0d910eb3 100644 --- a/types/tempus-dominus.d.ts +++ b/types/tempus-dominus.d.ts @@ -158,5 +158,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.1.3"; +declare const version = "6.2.4"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions }; diff --git a/types/tempus-dominus.esm.d.ts b/types/tempus-dominus.esm.d.ts index acc9e2655..403c7d5a3 100644 --- a/types/tempus-dominus.esm.d.ts +++ b/types/tempus-dominus.esm.d.ts @@ -631,7 +631,7 @@ declare class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName: string, lower: number, upper: number): void; + numbersOutOfRange(optionName: string, lower: number, upper: number): void; /** * Throws an error when a value for a date options couldn't be parsed. Either * the option was an invalid string or an invalid Date object. @@ -1251,5 +1251,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.1.3"; +declare const version = "6.2.4"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions }; diff --git a/types/tempus-dominus.esm.min.d.ts b/types/tempus-dominus.esm.min.d.ts index acc9e2655..403c7d5a3 100644 --- a/types/tempus-dominus.esm.min.d.ts +++ b/types/tempus-dominus.esm.min.d.ts @@ -631,7 +631,7 @@ declare class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName: string, lower: number, upper: number): void; + numbersOutOfRange(optionName: string, lower: number, upper: number): void; /** * Throws an error when a value for a date options couldn't be parsed. Either * the option was an invalid string or an invalid Date object. @@ -1251,5 +1251,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.1.3"; +declare const version = "6.2.4"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions }; diff --git a/types/tempus-dominus.min.d.ts b/types/tempus-dominus.min.d.ts index acc9e2655..403c7d5a3 100644 --- a/types/tempus-dominus.min.d.ts +++ b/types/tempus-dominus.min.d.ts @@ -631,7 +631,7 @@ declare class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName: string, lower: number, upper: number): void; + numbersOutOfRange(optionName: string, lower: number, upper: number): void; /** * Throws an error when a value for a date options couldn't be parsed. Either * the option was an invalid string or an invalid Date object. @@ -1251,5 +1251,5 @@ declare const extend: (plugin: any, option: any) => { Unit: typeof Unit; version: string; }; -declare const version = "6.1.3"; +declare const version = "6.2.4"; export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Unit, version, DateTimeFormatOptions }; diff --git a/types/utilities/errors.d.ts b/types/utilities/errors.d.ts index 5b5ba7eac..3b43a06e7 100644 --- a/types/utilities/errors.d.ts +++ b/types/utilities/errors.d.ts @@ -38,7 +38,7 @@ export declare class ErrorMessages { * @param lower * @param upper */ - numbersOutOfRage(optionName: string, lower: number, upper: number): void; + numbersOutOfRange(optionName: string, lower: number, upper: number): void; /** * Throws an error when a value for a date options couldn't be parsed. Either * the option was an invalid string or an invalid Date object.