From b54bb336bf12fd04406affe5f2bcbe34640df2d0 Mon Sep 17 00:00:00 2001 From: Eonasdan Date: Sun, 15 May 2022 14:02:12 -0400 Subject: [PATCH] Development (#2569) * make viewMode optional (#2551) * introduce a simple overridable function parseInput (#2552) so that you don't have to know all the internal details when overriding this just gets 1 input and can return another Just as formatInput also works (its the opposite) * fixed #2487, #2495 * fixed #2487, #2495 * fix for #2506 * fix for #2549 * fix for #2549 * pub npm * pub npm * package update Co-authored-by: Johan Compagner --- .github/workflows/publish.yml | 18 + README.md | 2 +- dist/js/jQuery-provider.js | 8 +- dist/js/jQuery-provider.min.js | 6 +- dist/js/tempus-dominus.esm.js | 851 ++++++----- dist/js/tempus-dominus.esm.js.map | 2 +- dist/js/tempus-dominus.esm.min.js | 4 +- dist/js/tempus-dominus.js | 851 ++++++----- dist/js/tempus-dominus.js.map | 2 +- dist/js/tempus-dominus.min.js | 4 +- dist/locales/de.js | 2 +- dist/locales/es.js | 2 +- dist/locales/it.js | 2 +- dist/locales/nl.js | 2 +- dist/locales/ro.js | 2 +- dist/locales/ru.js | 2 +- dist/plugins/examples/sample.js | 2 +- dist/plugins/fa-five.js | 2 +- dist/plugins/moment-parse.js | 2 +- package-lock.json | 1209 +++++---------- package.json | 4 +- src/docs/js/docs.js | 2 +- src/docs/partials/change-log.html | 24 + src/docs/partials/examples/index.html | 188 ++- src/docs/partials/examples/jquery.html | 2 +- src/docs/partials/functions.html | 52 +- src/docs/partials/namespace/css.html | 72 +- src/docs/partials/namespace/errors.html | 24 +- src/docs/partials/namespace/events.html | 10 +- src/docs/partials/options.html | 1657 +++++++++++---------- src/docs/styles/bs5_docs.scss | 6 +- src/docs/templates/index.html | 2 +- src/js/actions.ts | 2 +- src/js/dates.ts | 14 +- src/js/display/calendar/date-display.ts | 2 +- src/js/display/calendar/decade-display.ts | 2 +- src/js/display/calendar/month-display.ts | 2 +- src/js/display/calendar/year-display.ts | 2 +- src/js/display/index.ts | 2 +- src/js/display/time/hour-display.ts | 2 +- src/js/display/time/minute-display.ts | 2 +- src/js/display/time/second-display.ts | 2 +- src/js/display/time/time-display.ts | 2 +- src/js/jQuery-provider.js | 8 +- src/js/tempus-dominus.ts | 34 +- src/js/utilities/errors.ts | 2 +- src/js/utilities/namespace.ts | 2 +- src/js/utilities/optionConverter.ts | 580 ++++++++ src/js/utilities/options.ts | 729 ++------- src/js/utilities/optionsStore.ts | 32 + src/js/validation.ts | 2 +- types/dates.d.ts | 5 + types/utilities/errors.d.ts | 2 +- types/utilities/optionConverter.d.ts | 62 + types/utilities/options.d.ts | 58 +- types/utilities/optionsStore.d.ts | 20 + 56 files changed, 3256 insertions(+), 3332 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 src/js/utilities/optionConverter.ts create mode 100644 src/js/utilities/optionsStore.ts create mode 100644 types/utilities/optionConverter.d.ts create mode 100644 types/utilities/optionsStore.d.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..118efada4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +name: Publish Package to npm +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index c6a741a82..971c8c71c 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.0.0-beta5.1 +# Tempus Dominus Date/Time Picker v6.0.0-beta7 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/dist/js/jQuery-provider.js b/dist/js/jQuery-provider.js index da6a6f51e..ccdb1d09d 100644 --- a/dist/js/jQuery-provider.js +++ b/dist/js/jQuery-provider.js @@ -1,9 +1,9 @@ /// -/*global $ */ +/*global $, tempusDominus */ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) - * Copyright 2013-2021 [object Object] + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) + * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ tempusDominus.jQueryInterface = function (option, argument) { @@ -145,9 +145,9 @@ $(document) } ); const name = 'tempusDominus'; +const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = tempusDominus.jQueryInterface; $.fn[name].Constructor = tempusDominus.TempusDominus; -const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name].noConflict = function () { $.fn[name] = JQUERY_NO_CONFLICT; return tempusDominus.jQueryInterface; diff --git a/dist/js/jQuery-provider.min.js b/dist/js/jQuery-provider.min.js index 8dc4be129..11350f3d4 100644 --- a/dist/js/jQuery-provider.min.js +++ b/dist/js/jQuery-provider.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) - * Copyright 2013-2021 [object Object] + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) + * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -tempusDominus.jQueryInterface=function(e,t){return 1===this.length?tempusDominus.jQueryHandleThis(this,e,t):this.each((function(){tempusDominus.jQueryHandleThis(this,e,t)}))},tempusDominus.jQueryHandleThis=function(e,t,n){let s=$(e).data(tempusDominus.Namespace.dataKey);if("object"==typeof t&&$.extend({},tempusDominus.DefaultOptions,t),s||(s=new tempusDominus.TempusDominus($(e)[0],t),$(e).data(tempusDominus.Namespace.dataKey,s)),"string"==typeof t){if(void 0===s[t])throw new Error(`No method named "${t}"`);if(void 0===n)return s[t]();{"date"===t&&(s.isDateUpdateThroughDateOptionFromClientCode=!0);const e=s[t](n);return s.isDateUpdateThroughDateOptionFromClientCode=!1,e}}},tempusDominus.getSelectorFromElement=function(e){let t,n=e.data("target");return n||(n=e.attr("href")||"",n=/^#[a-z]/i.test(n)?n:null),t=$(n),0===t.length?e:(t.data(tempusDominus.Namespace.dataKey)||$.extend({},t.data(),$(this).data()),t)},$(document).on(`click${tempusDominus.Namespace.events.key}.data-api`,`[data-toggle="${tempusDominus.Namespace.dataKey}"]`,(function(){const e=$(this),t=tempusDominus.getSelectorFromElement(e),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.allowInputToggle&&e.is('input[data-toggle="datetimepicker"]')||tempusDominus.jQueryInterface.call(t,"toggle"))})).on(tempusDominus.Namespace.events.change,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this));0===t.length||e.isInit||tempusDominus.jQueryInterface.call(t,"_change",e)})).on(tempusDominus.Namespace.events.blur,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.debug||window.debug||tempusDominus.jQueryInterface.call(t,"hide",e))})).on(tempusDominus.Namespace.events.focus,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&n._options.allowInputToggle&&tempusDominus.jQueryInterface.call(t,"show",e)}));const e="tempusDominus";$.fn[e]=tempusDominus.jQueryInterface,$.fn[e].Constructor=tempusDominus.TempusDominus;const t=$.fn[e];$.fn[e].noConflict=function(){return $.fn[e]=t,tempusDominus.jQueryInterface}; +tempusDominus.jQueryInterface=function(e,t){return 1===this.length?tempusDominus.jQueryHandleThis(this,e,t):this.each((function(){tempusDominus.jQueryHandleThis(this,e,t)}))},tempusDominus.jQueryHandleThis=function(e,t,n){let s=$(e).data(tempusDominus.Namespace.dataKey);if("object"==typeof t&&$.extend({},tempusDominus.DefaultOptions,t),s||(s=new tempusDominus.TempusDominus($(e)[0],t),$(e).data(tempusDominus.Namespace.dataKey,s)),"string"==typeof t){if(void 0===s[t])throw new Error(`No method named "${t}"`);if(void 0===n)return s[t]();{"date"===t&&(s.isDateUpdateThroughDateOptionFromClientCode=!0);const e=s[t](n);return s.isDateUpdateThroughDateOptionFromClientCode=!1,e}}},tempusDominus.getSelectorFromElement=function(e){let t,n=e.data("target");return n||(n=e.attr("href")||"",n=/^#[a-z]/i.test(n)?n:null),t=$(n),0===t.length?e:(t.data(tempusDominus.Namespace.dataKey)||$.extend({},t.data(),$(this).data()),t)},$(document).on(`click${tempusDominus.Namespace.events.key}.data-api`,`[data-toggle="${tempusDominus.Namespace.dataKey}"]`,(function(){const e=$(this),t=tempusDominus.getSelectorFromElement(e),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.allowInputToggle&&e.is('input[data-toggle="datetimepicker"]')||tempusDominus.jQueryInterface.call(t,"toggle"))})).on(tempusDominus.Namespace.events.change,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this));0===t.length||e.isInit||tempusDominus.jQueryInterface.call(t,"_change",e)})).on(tempusDominus.Namespace.events.blur,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&(n._options.debug||window.debug||tempusDominus.jQueryInterface.call(t,"hide",e))})).on(tempusDominus.Namespace.events.focus,`.${tempusDominus.Namespace.NAME}-input`,(function(e){const t=tempusDominus.getSelectorFromElement($(this)),n=t.data(tempusDominus.Namespace.dataKey);0!==t.length&&n._options.allowInputToggle&&tempusDominus.jQueryInterface.call(t,"show",e)}));const e="tempusDominus",t=$.fn[e];$.fn[e]=tempusDominus.jQueryInterface,$.fn[e].Constructor=tempusDominus.TempusDominus,$.fn[e].noConflict=function(){return $.fn[e]=t,tempusDominus.jQueryInterface}; diff --git a/dist/js/tempus-dominus.esm.js b/dist/js/tempus-dominus.esm.js index b525854d2..d096a001b 100644 --- a/dist/js/tempus-dominus.esm.js +++ b/dist/js/tempus-dominus.esm.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -515,7 +515,7 @@ class ErrorMessages { } /** * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalide string or an invalid Date object. + * the option was an invalid string or an invalid Date object. * @param optionName * @param date * @param soft If true, logs a warning instead of an error. @@ -567,7 +567,7 @@ class ErrorMessages { } // this is not the way I want this to stay but nested classes seemed to blown up once its compiled. -const NAME = 'tempus-dominus', version = '6.0.0-beta5.1', dataKey = 'td'; +const NAME = 'tempus-dominus', version = '6.0.0-beta7', dataKey = 'td'; /** * Events */ @@ -788,6 +788,24 @@ Namespace.events = new Events(); Namespace.css = new Css(); Namespace.errorMessages = new ErrorMessages(); +class ServiceLocator { + constructor() { + this.cache = new Map(); + } + locate(identifier) { + const service = this.cache.get(identifier); + if (service) + return service; + const value = new identifier(); + this.cache.set(identifier, value); + return value; + } +} +const setupServiceLocator = () => { + serviceLocator = new ServiceLocator(); +}; +let serviceLocator; + const CalendarModes = [ { name: 'calendar', @@ -815,6 +833,180 @@ const CalendarModes = [ }, ]; +class OptionsStore { + constructor() { + this.viewDate = new DateTime(); + this._currentCalendarViewMode = 0; + this.minimumCalendarViewMode = 0; + this.currentView = 'calendar'; + } + get currentCalendarViewMode() { + return this._currentCalendarViewMode; + } + set currentCalendarViewMode(value) { + this._currentCalendarViewMode = value; + this.currentView = CalendarModes[value].name; + } + /** + * When switching back to the calendar from the clock, + * this sets currentView to the correct calendar view. + */ + refreshCurrentView() { + this.currentView = CalendarModes[this.currentCalendarViewMode].name; + } +} + +/** + * Main class for date validation rules based on the options provided. + */ +class Validation { + constructor() { + this.optionsStore = serviceLocator.locate(OptionsStore); + } + /** + * Checks to see if the target date is valid based on the rules provided in the options. + * Granularity can be provide to chek portions of the date instead of the whole. + * @param targetDate + * @param granularity + */ + isValid(targetDate, granularity) { + var _a; + if (this.optionsStore.options.restrictions.disabledDates.length > 0 && + this._isInDisabledDates(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.enabledDates.length > 0 && + !this._isInEnabledDates(targetDate)) { + return false; + } + if (granularity !== Unit.month && + granularity !== Unit.year && + ((_a = this.optionsStore.options.restrictions.daysOfWeekDisabled) === null || _a === void 0 ? void 0 : _a.length) > 0 && + this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) { + return false; + } + if (this.optionsStore.options.restrictions.minDate && + targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { + return false; + } + if (this.optionsStore.options.restrictions.maxDate && + targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { + return false; + } + if (granularity === Unit.hours || + granularity === Unit.minutes || + granularity === Unit.seconds) { + if (this.optionsStore.options.restrictions.disabledHours.length > 0 && + this._isInDisabledHours(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.enabledHours.length > 0 && + !this._isInEnabledHours(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0) { + for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) { + if (targetDate.isBetween(disabledTimeIntervals.from, disabledTimeIntervals.to)) + return false; + } + } + } + return true; + } + /** + * Checks to see if the disabledDates option is in use and returns true (meaning invalid) + * if the `testDate` is with in the array. Granularity is by date. + * @param testDate + * @private + */ + _isInDisabledDates(testDate) { + if (!this.optionsStore.options.restrictions.disabledDates || + this.optionsStore.options.restrictions.disabledDates.length === 0) + return false; + const formattedDate = testDate.format(getFormatByUnit(Unit.date)); + return this.optionsStore.options.restrictions.disabledDates + .map((x) => x.format(getFormatByUnit(Unit.date))) + .find((x) => x === formattedDate); + } + /** + * Checks to see if the enabledDates option is in use and returns true (meaning valid) + * if the `testDate` is with in the array. Granularity is by date. + * @param testDate + * @private + */ + _isInEnabledDates(testDate) { + if (!this.optionsStore.options.restrictions.enabledDates || + this.optionsStore.options.restrictions.enabledDates.length === 0) + return true; + const formattedDate = testDate.format(getFormatByUnit(Unit.date)); + return this.optionsStore.options.restrictions.enabledDates + .map((x) => x.format(getFormatByUnit(Unit.date))) + .find((x) => x === formattedDate); + } + /** + * Checks to see if the disabledHours option is in use and returns true (meaning invalid) + * if the `testDate` is with in the array. Granularity is by hours. + * @param testDate + * @private + */ + _isInDisabledHours(testDate) { + if (!this.optionsStore.options.restrictions.disabledHours || + this.optionsStore.options.restrictions.disabledHours.length === 0) + return false; + const formattedDate = testDate.hours; + return this.optionsStore.options.restrictions.disabledHours.find((x) => x === formattedDate); + } + /** + * Checks to see if the enabledHours option is in use and returns true (meaning valid) + * if the `testDate` is with in the array. Granularity is by hours. + * @param testDate + * @private + */ + _isInEnabledHours(testDate) { + if (!this.optionsStore.options.restrictions.enabledHours || + this.optionsStore.options.restrictions.enabledHours.length === 0) + return true; + const formattedDate = testDate.hours; + return this.optionsStore.options.restrictions.enabledHours.find((x) => x === formattedDate); + } +} + +class EventEmitter { + constructor() { + this.subscribers = []; + } + subscribe(callback) { + this.subscribers.push(callback); + return this.unsubscribe.bind(this, this.subscribers.length - 1); + } + unsubscribe(index) { + this.subscribers.splice(index, 1); + } + emit(value) { + this.subscribers.forEach((callback) => { + callback(value); + }); + } + destory() { + this.subscribers = null; + this.subscribers = []; + } +} +class EventEmitters { + constructor() { + this.triggerEvent = new EventEmitter(); + this.viewUpdate = new EventEmitter(); + this.updateDisplay = new EventEmitter(); + this.action = new EventEmitter(); + } + destory() { + this.triggerEvent.destory(); + this.viewUpdate.destory(); + this.updateDisplay.destory(); + this.action.destory(); + } +} + const DefaultOptions = { restrictions: { minDate: undefined, @@ -909,229 +1101,239 @@ const DefaultOptions = { container: undefined }; -class OptionsStore { - constructor() { - this.viewDate = new DateTime(); - this._currentCalendarViewMode = 0; - this.minimumCalendarViewMode = 0; - this.currentView = 'calendar'; - } - get currentCalendarViewMode() { - return this._currentCalendarViewMode; +class OptionConverter { + static deepCopy(input) { + const o = {}; + Object.keys(input).forEach((key) => { + const inputElement = input[key]; + o[key] = inputElement; + if (typeof inputElement !== 'object' || + inputElement instanceof HTMLElement || + inputElement instanceof Element || + inputElement instanceof Date) + return; + if (!Array.isArray(inputElement)) { + o[key] = OptionConverter.deepCopy(inputElement); + } + }); + return o; } - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; + /** + * Finds value out of an object based on a string, period delimited, path + * @param paths + * @param obj + */ + static objectPath(paths, obj) { + if (paths.charAt(0) === '.') + paths = paths.slice(1); + return paths.split('.') + .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ? + value[key] : + undefined), obj); } /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. + * The spread operator caused sub keys to be missing after merging. + * This is to fix that issue by using spread on the child objects first. + * Also handles complex options like disabledDates + * @param provided An option from new providedOptions + * @param mergeOption Default option to compare types against + * @param copyTo Destination object. This was added to prevent reference copies + * @param path + * @param locale */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; + static spread(provided, mergeOption, copyTo, path = '', locale = '') { + const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(mergeOption).includes(x)); + if (unsupportedOptions.length > 0) { + const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); + const errors = unsupportedOptions.map((x) => { + let error = `"${path}.${x}" in not a known option.`; + let didYouMean = flattenedOptions.find((y) => y.includes(x)); + if (didYouMean) + error += `Did you mean "${didYouMean}"?`; + return error; + }); + Namespace.errorMessages.unexpectedOptions(errors); + } + Object.keys(mergeOption).forEach((key) => { + path += `.${key}`; + if (path.charAt(0) === '.') + path = path.slice(1); + const defaultOptionValue = OptionConverter.objectPath(path, DefaultOptions); + let providedType = typeof provided[key]; + let defaultType = typeof defaultOptionValue; + let value = provided[key]; + if (!provided.hasOwnProperty(key)) { + if (defaultType === 'undefined' || + ((value === null || value === void 0 ? void 0 : value.length) === 0 && Array.isArray(defaultOptionValue))) { + copyTo[key] = defaultOptionValue; + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + provided[key] = defaultOptionValue; + value = provided[key]; + } + copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale); + if (typeof defaultOptionValue !== 'object' || + defaultOptionValue instanceof Date || + OptionConverter.ignoreProperties.includes(key)) { + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + if (!Array.isArray(provided[key])) { + OptionConverter.spread(provided[key], defaultOptionValue, copyTo[key], path, locale); + } + path = path.substring(0, path.lastIndexOf(`.${key}`)); + }); } -} -class OptionConverter { - static _mergeOptions(providedOptions, mergeTo) { - var _a; - const newOptions = {}; - let path = ''; - const ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; - //see if the options specify a locale - const locale = mergeTo.localization.locale !== 'default' - ? mergeTo.localization.locale - : ((_a = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.localization) === null || _a === void 0 ? void 0 : _a.locale) || 'default'; - const processKey = (key, value, providedType, defaultType) => { - switch (key) { - case 'defaultDate': { - const dateTime = this.dateConversion(value, 'defaultDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('defaultDate', providedType, 'DateTime or Date'); - break; + static processKey(key, value, providedType, defaultType, path, locale) { + switch (key) { + case 'defaultDate': { + const dateTime = this.dateConversion(value, 'defaultDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'viewDate': { - const dateTime = this.dateConversion(value, 'viewDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('viewDate', providedType, 'DateTime or Date'); - break; + Namespace.errorMessages.typeMismatch('defaultDate', providedType, 'DateTime or Date'); + break; + } + case 'viewDate': { + const dateTime = this.dateConversion(value, 'viewDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'minDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.minDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('restrictions.minDate', providedType, 'DateTime or Date'); - break; + Namespace.errorMessages.typeMismatch('viewDate', providedType, 'DateTime or Date'); + break; + } + case 'minDate': { + if (value === undefined) { + return value; } - case 'maxDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.maxDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('restrictions.maxDate', providedType, 'DateTime or Date'); - break; + const dateTime = this.dateConversion(value, 'restrictions.minDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'disabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); - return value; - case 'enabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); - return value; - case 'daysOfWeekDisabled': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); - if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); - return value; - case 'enabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray('restrictions.enabledDates', value, providedType, locale); - return value; - case 'disabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray('restrictions.disabledDates', value, providedType, locale); - return value; - case 'disabledTimeIntervals': - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); - } - const valueObject = value; - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - let d = valueObject[i][vk]; - const dateTime = this.dateConversion(d, subOptionName); - if (!dateTime) { - Namespace.errorMessages.typeMismatch(subOptionName, typeof d, 'DateTime or Date'); - } - dateTime.setLocale(locale); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - case 'toolbarPlacement': - case 'type': - case 'viewMode': - const optionValues = { - toolbarPlacement: ['top', 'bottom', 'default'], - type: ['icons', 'sprites'], - viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], - }; - const keyOptions = optionValues[key]; - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); - return value; - case 'meta': - case 'dayViewHeaderFormat': - return value; - case 'container': - if (value && - !(value instanceof HTMLElement || - value instanceof Element || - (value === null || value === void 0 ? void 0 : value.appendChild))) { - Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); - } + Namespace.errorMessages.typeMismatch('restrictions.minDate', providedType, 'DateTime or Date'); + break; + } + case 'maxDate': { + if (value === undefined) { return value; - default: - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch(path.substring(1), providedType, defaultType); - } + } + const dateTime = this.dateConversion(value, 'restrictions.maxDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch('restrictions.maxDate', providedType, 'DateTime or Date'); + break; } - }; - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param mergeOption Default option to compare types against - * @param copyTo Destination object. This was added to prevent reference copies - */ - const spread = (provided, mergeOption, copyTo) => { - const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(mergeOption).includes(x)); - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - const errors = unsupportedOptions.map((x) => { - let error = `"${path.substring(1)}.${x}" in not a known option.`; - let didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) - error += `Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - Object.keys(mergeOption).forEach((key) => { - const defaultOptionValue = mergeOption[key]; - let providedType = typeof provided[key]; - let defaultType = typeof defaultOptionValue; - let value = provided[key]; - if (!provided.hasOwnProperty(key)) { - if (defaultType === 'undefined' || - ((value === null || value === void 0 ? void 0 : value.length) === 0 && Array.isArray(defaultOptionValue))) { - copyTo[key] = defaultOptionValue; - return; - } - provided[key] = defaultOptionValue; - value = provided[key]; + case 'disabledHours': + if (value === undefined) { + return []; } - path += `.${key}`; - copyTo[key] = processKey(key, value, providedType, defaultType); - if (typeof defaultOptionValue !== 'object' || - ignoreProperties.includes(key)) { - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; + this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); + return value; + case 'enabledHours': + if (value === undefined) { + return []; } - if (!Array.isArray(provided[key])) { - spread(provided[key], defaultOptionValue, copyTo[key]); - path = path.substring(0, path.lastIndexOf(`.${key}`)); + this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); + return value; + case 'daysOfWeekDisabled': + if (value === undefined) { + return []; } - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - }; - spread(providedOptions, mergeTo, newOptions); + this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); + if (value.filter((x) => x < 0 || x > 6).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); + return value; + case 'enabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray('restrictions.enabledDates', value, providedType, locale); + return value; + case 'disabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray('restrictions.disabledDates', value, providedType, locale); + return value; + case 'disabledTimeIntervals': + if (value === undefined) { + return []; + } + if (!Array.isArray(value)) { + Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); + } + const valueObject = value; + for (let i = 0; i < valueObject.length; i++) { + Object.keys(valueObject[i]).forEach((vk) => { + const subOptionName = `${key}[${i}].${vk}`; + let d = valueObject[i][vk]; + const dateTime = this.dateConversion(d, subOptionName); + if (!dateTime) { + Namespace.errorMessages.typeMismatch(subOptionName, typeof d, 'DateTime or Date'); + } + dateTime.setLocale(locale); + valueObject[i][vk] = dateTime; + }); + } + return valueObject; + case 'toolbarPlacement': + case 'type': + case 'viewMode': + const optionValues = { + toolbarPlacement: ['top', 'bottom', 'default'], + type: ['icons', 'sprites'], + viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + }; + const keyOptions = optionValues[key]; + if (!keyOptions.includes(value)) + Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); + return value; + case 'meta': + case 'dayViewHeaderFormat': + return value; + case 'container': + if (value && + !(value instanceof HTMLElement || + value instanceof Element || + (value === null || value === void 0 ? void 0 : value.appendChild))) { + Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); + } + return value; + default: + switch (defaultType) { + case 'boolean': + return value === 'true' || value === true; + case 'number': + return +value; + case 'string': + return value.toString(); + case 'object': + return {}; + case 'function': + return value; + default: + Namespace.errorMessages.typeMismatch(path, providedType, defaultType); + } + } + } + static _mergeOptions(providedOptions, mergeTo) { + var _a; + const newOptions = {}; + //see if the options specify a locale + const locale = mergeTo.localization.locale !== 'default' + ? mergeTo.localization.locale + : ((_a = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.localization) === null || _a === void 0 ? void 0 : _a.locale) || 'default'; + OptionConverter.spread(providedOptions, mergeTo, newOptions, '', locale); return newOptions; } static _dataToOptions(element, options) { @@ -1266,11 +1468,16 @@ class OptionConverter { static getFlattenDefaultOptions() { if (this._flattenDefaults) return this._flattenDefaults; - const deepKeys = (t, pre = []) => Array.isArray(t) - ? [] - : Object(t) === t - ? Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])) - : pre.join('.'); + const deepKeys = (t, pre = []) => { + if (Array.isArray(t)) + return []; + if (Object(t) === t) { + return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); + } + else { + return pre.join('.'); + } + }; this._flattenDefaults = deepKeys(DefaultOptions); return this._flattenDefaults; } @@ -1297,175 +1504,8 @@ class OptionConverter { } } } - -class ServiceLocator { - constructor() { - this.cache = new Map(); - } - locate(identifier) { - const service = this.cache.get(identifier); - if (service) - return service; - const value = new identifier(); - this.cache.set(identifier, value); - return value; - } -} -const setupServiceLocator = () => { - serviceLocator = new ServiceLocator(); -}; -let serviceLocator; - -/** - * Main class for date validation rules based on the options provided. - */ -class Validation { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - } - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provide to chek portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate, granularity) { - var _a; - if (this.optionsStore.options.restrictions.disabledDates.length > 0 && - this._isInDisabledDates(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.enabledDates.length > 0 && - !this._isInEnabledDates(targetDate)) { - return false; - } - if (granularity !== Unit.month && - granularity !== Unit.year && - ((_a = this.optionsStore.options.restrictions.daysOfWeekDisabled) === null || _a === void 0 ? void 0 : _a.length) > 0 && - this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) { - return false; - } - if (this.optionsStore.options.restrictions.minDate && - targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { - return false; - } - if (this.optionsStore.options.restrictions.maxDate && - targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { - return false; - } - if (granularity === Unit.hours || - granularity === Unit.minutes || - granularity === Unit.seconds) { - if (this.optionsStore.options.restrictions.disabledHours.length > 0 && - this._isInDisabledHours(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.enabledHours.length > 0 && - !this._isInEnabledHours(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0) { - for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) { - if (targetDate.isBetween(disabledTimeIntervals.from, disabledTimeIntervals.to)) - return false; - } - } - } - return true; - } - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInDisabledDates(testDate) { - if (!this.optionsStore.options.restrictions.disabledDates || - this.optionsStore.options.restrictions.disabledDates.length === 0) - return false; - const formattedDate = testDate.format(getFormatByUnit(Unit.date)); - return this.optionsStore.options.restrictions.disabledDates - .map((x) => x.format(getFormatByUnit(Unit.date))) - .find((x) => x === formattedDate); - } - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInEnabledDates(testDate) { - if (!this.optionsStore.options.restrictions.enabledDates || - this.optionsStore.options.restrictions.enabledDates.length === 0) - return true; - const formattedDate = testDate.format(getFormatByUnit(Unit.date)); - return this.optionsStore.options.restrictions.enabledDates - .map((x) => x.format(getFormatByUnit(Unit.date))) - .find((x) => x === formattedDate); - } - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInDisabledHours(testDate) { - if (!this.optionsStore.options.restrictions.disabledHours || - this.optionsStore.options.restrictions.disabledHours.length === 0) - return false; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.disabledHours.find((x) => x === formattedDate); - } - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInEnabledHours(testDate) { - if (!this.optionsStore.options.restrictions.enabledHours || - this.optionsStore.options.restrictions.enabledHours.length === 0) - return true; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.enabledHours.find((x) => x === formattedDate); - } -} - -class EventEmitter { - constructor() { - this.subscribers = []; - } - subscribe(callback) { - this.subscribers.push(callback); - return this.unsubscribe.bind(this, this.subscribers.length - 1); - } - unsubscribe(index) { - this.subscribers.splice(index, 1); - } - emit(value) { - this.subscribers.forEach((callback) => { - callback(value); - }); - } - destory() { - this.subscribers = null; - this.subscribers = []; - } -} -class EventEmitters { - constructor() { - this.triggerEvent = new EventEmitter(); - this.viewUpdate = new EventEmitter(); - this.updateDisplay = new EventEmitter(); - this.action = new EventEmitter(); - } - destory() { - this.triggerEvent.destory(); - this.viewUpdate.destory(); - this.updateDisplay.destory(); - this.action.destory(); - } -} +OptionConverter.ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; +OptionConverter.isValue = a => a != null; // everything except undefined + null class Dates { constructor() { @@ -1516,6 +1556,13 @@ class Dates { hour12: !components.useTwentyfourHour, }); } + /** + * parse the value into a DateTime object. + * this can be overwritten to supply your own parsing. + */ + parseInput(value) { + return OptionConverter.dateConversion(value, 'input'); + } /** * Tries to convert the provided value to a DateTime object. * If value is null|undefined then clear the value of the provided index (or 0). @@ -1527,7 +1574,7 @@ class Dates { this.setValue(undefined, index); return; } - const converted = OptionConverter.dateConversion(value, 'input'); + const converted = this.parseInput(value); if (converted) { converted.setLocale(this.optionsStore.options.localization.locale); this.setValue(converted, index); @@ -3268,7 +3315,7 @@ class TempusDominus { setViewDate(); } catch (_a) { - console.warn('TD: Something went wrong trying to set the multidate values from the input field.'); + console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.'); } } else { @@ -3282,6 +3329,9 @@ class TempusDominus { * @private */ this._toggleClickEvent = () => { + var _a, _b; + if (((_a = this.optionsStore.element) === null || _a === void 0 ? void 0 : _a.disabled) || ((_b = this.optionsStore.input) === null || _b === void 0 ? void 0 : _b.disabled)) + return; this.toggle(); }; setupServiceLocator(); @@ -3515,37 +3565,38 @@ class TempusDominus { */ _initializeOptions(config, mergeTo, includeDataset = false) { var _a; - config = OptionConverter._mergeOptions(config, mergeTo); + let newConfig = OptionConverter.deepCopy(config); + newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); if (includeDataset) - config = OptionConverter._dataToOptions(this.optionsStore.element, config); - OptionConverter._validateConflicts(config); - config.viewDate = config.viewDate.setLocale(config.localization.locale); - if (!this.optionsStore.viewDate.isSame(config.viewDate)) { - this.optionsStore.viewDate = config.viewDate; + newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig); + OptionConverter._validateConflicts(newConfig); + newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale); + if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { + this.optionsStore.viewDate = newConfig.viewDate; } /** * Sets the minimum view allowed by the picker. For example the case of only * allowing year and month to be selected but not date. */ - if (config.display.components.year) { + if (newConfig.display.components.year) { this.optionsStore.minimumCalendarViewMode = 2; } - if (config.display.components.month) { + if (newConfig.display.components.month) { this.optionsStore.minimumCalendarViewMode = 1; } - if (config.display.components.date) { + if (newConfig.display.components.date) { this.optionsStore.minimumCalendarViewMode = 0; } this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode); // Update view mode if needed if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - config.display.viewMode) { - this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === config.display.viewMode), this.optionsStore.minimumCalendarViewMode); + newConfig.display.viewMode) { + this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode); } if ((_a = this.display) === null || _a === void 0 ? void 0 : _a.isVisible) { this.display._update('all'); } - this.optionsStore.options = config; + this.optionsStore.options = newConfig; } /** * Checks if an input field is being used, attempts to locate one and sets an diff --git a/dist/js/tempus-dominus.esm.js.map b/dist/js/tempus-dominus.esm.js.map index 40168a89d..5f84941da 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/calendar-modes.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/options.ts","../../src/js/utilities/service-locator.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.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 * 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 let formatted =this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n if (formatted === '24') formatted = '00';\r\n return formatted;\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 invalide 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 * 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.`\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 version = '6.0.0-beta5',\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 of 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 most element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer most 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 most 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 most 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 most 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 most 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 most element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer most element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer most element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer most 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\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static version = version;\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","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 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: false\r\n },\r\n inline: false\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 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;","import { DateTime, DateTimeFormatOptions } from '../datetime';\r\nimport Namespace from './namespace';\r\nimport ViewMode from './view-mode';\r\nimport CalendarModes from './calendar-modes';\r\nimport DefaultOptions from './default-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\r\nexport default interface Options {\r\n restrictions?: {\r\n minDate?: DateTime;\r\n maxDate?: DateTime;\r\n enabledDates?: DateTime[];\r\n disabledDates?: DateTime[];\r\n enabledHours?: number[];\r\n disabledHours?: number[];\r\n disabledTimeIntervals?: { from: DateTime; to: DateTime }[];\r\n daysOfWeekDisabled?: number[];\r\n };\r\n display?: {\r\n toolbarPlacement?: 'top' | 'bottom';\r\n components?: {\r\n calendar?: boolean;\r\n date?: boolean;\r\n month?: boolean;\r\n year?: boolean;\r\n decades?: boolean;\r\n clock?: boolean;\r\n hours?: boolean;\r\n minutes?: boolean;\r\n seconds?: boolean;\r\n useTwentyfourHour?: boolean;\r\n };\r\n buttons?: { today?: boolean; close?: boolean; clear?: boolean };\r\n calendarWeeks?: boolean;\r\n icons?: {\r\n date?: string;\r\n next?: string;\r\n previous?: string;\r\n today?: string;\r\n clear?: string;\r\n time?: string;\r\n up?: string;\r\n type?: 'icons' | 'sprites';\r\n down?: string;\r\n close?: string;\r\n };\r\n viewMode: keyof ViewMode | undefined;\r\n sideBySide?: boolean;\r\n inline?: boolean;\r\n keepOpen?: boolean;\r\n };\r\n stepping?: number;\r\n useCurrent?: boolean;\r\n defaultDate?: DateTime;\r\n localization?: {\r\n nextMonth?: string;\r\n pickHour?: string;\r\n incrementSecond?: string;\r\n nextDecade?: string;\r\n selectDecade?: string;\r\n dayViewHeaderFormat?: DateTimeFormatOptions;\r\n decrementHour?: string;\r\n selectDate?: string;\r\n incrementHour?: string;\r\n previousCentury?: string;\r\n decrementSecond?: string;\r\n today?: string;\r\n previousMonth?: string;\r\n selectYear?: string;\r\n pickSecond?: string;\r\n nextCentury?: string;\r\n close?: string;\r\n incrementMinute?: string;\r\n selectTime?: string;\r\n clear?: string;\r\n toggleMeridiem?: string;\r\n selectMonth?: string;\r\n decrementMinute?: string;\r\n pickMinute?: string;\r\n nextYear?: string;\r\n previousYear?: string;\r\n previousDecade?: string;\r\n locale?: string;\r\n startOfTheWeek?: number;\r\n };\r\n keepInvalid?: boolean;\r\n debug?: boolean;\r\n allowInputToggle?: boolean;\r\n viewDate?: DateTime;\r\n multipleDates?: boolean;\r\n multipleDatesSeparator?: string;\r\n promptTimeOnDateChange?: boolean;\r\n promptTimeOnDateChangeTransitionDelay?: number;\r\n meta?: {};\r\n container?: HTMLElement;\r\n}\r\n\r\nexport class OptionConverter {\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newOptions = {} as Options;\r\n let path = '';\r\n const ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container'];\r\n\r\n //see if the options specify a locale\r\n const locale =\r\n mergeTo.localization.locale !== 'default'\r\n ? mergeTo.localization.locale\r\n : providedOptions?.localization?.locale || 'default';\r\n\r\n const processKey = (key, value, providedType, defaultType) => {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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 locale\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 locale\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);\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(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 const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\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 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.substring(1),\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\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 mergeOption Default option to compare types against\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n */\r\n const spread = (provided, mergeOption, copyTo) => {\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(mergeOption).includes(x)\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.substring(1)}.${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 Object.keys(mergeOption).forEach((key) => {\r\n const defaultOptionValue = mergeOption[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n if (!provided.hasOwnProperty(key)) {\r\n if (\r\n defaultType === 'undefined' ||\r\n (value?.length === 0 && Array.isArray(defaultOptionValue))\r\n ) {\r\n copyTo[key] = defaultOptionValue;\r\n return;\r\n }\r\n provided[key] = defaultOptionValue;\r\n value = provided[key];\r\n }\r\n path += `.${key}`;\r\n copyTo[key] = processKey(key, value, providedType, defaultType);\r\n\r\n if (\r\n typeof defaultOptionValue !== 'object' ||\r\n ignoreProperties.includes(key)\r\n ) {\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n if (!Array.isArray(provided[key])) {\r\n spread(provided[key], defaultOptionValue, copyTo[key]);\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n }\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n };\r\n spread(providedOptions, mergeTo, newOptions);\r\n\r\n return newOptions;\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 * @private\r\n */\r\n static _dateTypeCheck(d: any): 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 = new DateTime(d);\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 locale\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n locale: string = 'default'\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);\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(locale);\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 */\r\n static dateConversion(d: any, optionName: string): 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);\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 Array.isArray(t)\r\n ? []\r\n : Object(t) === t\r\n ? Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]))\r\n : pre.join('.');\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","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;","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { OptionsStore } from './utilities/options';\r\nimport { serviceLocator } from './utilities/service-locator';\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 provide to chek 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 destory() {\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 destory() {\r\n this.triggerEvent.destory();\r\n this.viewUpdate.destory();\r\n this.updateDisplay.destory();\r\n this.action.destory();\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 { OptionConverter, OptionsStore } from './utilities/options';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\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 * 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 = OptionConverter.dateConversion(value, 'input');\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 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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 * 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 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.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 let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 { OptionsStore } from '../../utilities/options';\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\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 { OptionsStore } from '../../utilities/options';\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\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.minutesFormatted}`\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 { OptionsStore } from '../../utilities/options';\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\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse);\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 { createPopper } from '@popperjs/core';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport { OptionsStore } from '../utilities/options';\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\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(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement) {\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 (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\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\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 (!onlyClock) {\r\n if (this._hasTime) {\r\n Collapse.hide(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\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\r\n this._popperInstance = createPopper(\r\n this.optionsStore.element,\r\n this.widget,\r\n {\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 }\r\n );\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._popperInstance.update();\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 /**\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 _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('http://www.w3.org/2000/svg', 'use');\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 {OptionsStore} from './utilities/options';\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\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.do(e, ActionTypes.showClock);\r\n this.display._update('clock');\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 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 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, { OptionConverter, OptionsStore } 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\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 config = OptionConverter._mergeOptions(config, mergeTo);\r\n if (includeDataset)\r\n config = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n config\r\n );\r\n\r\n OptionConverter._validateConflicts(config);\r\n\r\n config.viewDate = config.viewDate.setLocale(config.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(config.viewDate)) {\r\n this.optionsStore.viewDate = config.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 (config.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (config.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (config.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 config.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === config.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 this.optionsStore.options = config;\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;\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 multidate 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 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.$i) {\r\n // install plugin only once\r\n plugin.load(option, { TempusDominus, Dates, Display }, this);\r\n plugin.$i = true;\r\n }\r\n return this;\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 Options,\r\n Unit,\r\n DateTimeFormatOptions,\r\n};\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;;;IAAY;AAAZ,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,2BAAmB,CAAA;IACnB,uBAAe,CAAA;IACf,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,qBAAa,CAAA;AACf,CAAC,EAPW,IAAI,KAAJ,IAAI,QAOf;AAED,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,IAAI;CACb,CAAA;AAED,MAAM,0BAA0B,GAAG;IACjC,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,KAAK;CACd,CAA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,CAAC,MAAM,CAAC,IAAI,CAAC;oBAC9B,CAAC,EAAE;wBACD,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAC9C,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,MAAM,CAC/B;qBACF;oBACD,MAAM,EAAEA,aAAW,CAAC,YAAY;iBACjC,CAAC,CAAC;aACJ;SACF,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;KACrE;CA6CF;AAED;;;;AAIA,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB;AACA;;;;MAIM,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO;IAClC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;AACzC,EAAE;AAEF;;;;;MAKM,MAAM,GAAG,CAAC,CAAS;IACvB,IAAI,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;AACtC,EAAE;AAEF;AACA;;;;;MAKM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM;IACrC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;;QAEd,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAC7D,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd;;;;"} \ 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 * 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 let formatted =this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n if (formatted === '24') formatted = '00';\r\n return formatted;\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 * 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.`\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 version = '6.0.0-beta7',\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 of 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 most element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer most 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 most 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 most 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 most 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 most 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 most element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer most element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer most element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer most 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\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static version = version;\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;","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 provide to chek 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 destory() {\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 destory() {\r\n this.triggerEvent.destory();\r\n this.viewUpdate.destory();\r\n this.updateDisplay.destory();\r\n this.action.destory();\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: false\r\n },\r\n inline: false\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 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;","import Namespace from \"./namespace\";\r\nimport {DateTime} from \"../datetime\";\r\nimport DefaultOptions from \"./default-options\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container'];\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 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 mergeOption Default option to compare types against\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param locale\r\n */\r\n static spread(provided, mergeOption, copyTo, path = '', locale = '') {\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(mergeOption).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(mergeOption).forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = OptionConverter.objectPath(path, DefaultOptions);\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (!provided.hasOwnProperty(key)) {\r\n if (\r\n defaultType === 'undefined' ||\r\n (value?.length === 0 && Array.isArray(defaultOptionValue))\r\n ) {\r\n copyTo[key] = defaultOptionValue;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n provided[key] = defaultOptionValue;\r\n value = provided[key];\r\n }\r\n\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n\r\n if (\r\n typeof defaultOptionValue !== 'object' ||\r\n defaultOptionValue instanceof Date ||\r\n OptionConverter.ignoreProperties.includes(key)\r\n ) {\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (!Array.isArray(provided[key])) {\r\n OptionConverter.spread(provided[key], defaultOptionValue, copyTo[key], path, locale);\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, locale) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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 locale\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 locale\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);\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(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 const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\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 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 newOptions = {} as Options;\r\n\r\n //see if the options specify a locale\r\n const locale =\r\n mergeTo.localization.locale !== 'default'\r\n ? mergeTo.localization.locale\r\n : providedOptions?.localization?.locale || 'default';\r\n\r\n OptionConverter.spread(providedOptions, mergeTo, newOptions, '', locale);\r\n\r\n return newOptions;\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 * @private\r\n */\r\n static _dateTypeCheck(d: any): 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 = new DateTime(d);\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 locale\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n locale: string = 'default'\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);\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(locale);\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 */\r\n static dateConversion(d: any, optionName: string): 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);\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');\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 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.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 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 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.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 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 * 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 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.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 let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\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 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.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 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.minutesFormatted}`\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse);\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 { createPopper } from '@popperjs/core';\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(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement) {\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 (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\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\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 (!onlyClock) {\r\n if (this._hasTime) {\r\n Collapse.hide(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\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\r\n this._popperInstance = createPopper(\r\n this.optionsStore.element,\r\n this.widget,\r\n {\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 }\r\n );\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._popperInstance.update();\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 /**\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 _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('http://www.w3.org/2000/svg', 'use');\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.do(e, ActionTypes.showClock);\r\n this.display._update('clock');\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 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 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\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 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;\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.$i) {\r\n // install plugin only once\r\n plugin.load(option, { TempusDominus, Dates, Display }, this);\r\n plugin.$i = true;\r\n }\r\n return this;\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 Options,\r\n Unit,\r\n DateTimeFormatOptions,\r\n};\r\n"],"names":["ActionTypes","SecondDisplay"],"mappings":";;;;;;;IAAY;AAAZ,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,2BAAmB,CAAA;IACnB,uBAAe,CAAA;IACf,qBAAa,CAAA;IACb,uBAAe,CAAA;I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,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;AACzC,EAAE;AAEF;;;;;MAKM,MAAM,GAAG,CAAC,CAAS;IACvB,IAAI,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;AACtC,EAAE;AAEF;AACA;;;;;MAKM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM;IACrC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;;QAEd,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAC7D,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd;;;;"} \ 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 1a9805a62..12a201d1f 100644 --- a/dist/js/tempus-dominus.esm.min.js +++ b/dist/js/tempus-dominus.esm.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -import{createPopper as t}from"@popperjs/core";var e;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(e||(e={}));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)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(t,s=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){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(e.date),this.weekDay===s)break;let t=this.weekDay;0!==s&&0===this.weekDay&&(t=8-s),this.manipulate(s-t,e.date);break;case"month":this.startOf(e.date),this.setDate(1);break;case"year":this.startOf(e.date),this.setMonth(0,1)}return this}endOf(t,s=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){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(e.date),this.manipulate(6+s-this.weekDay,e.date);break;case"month":this.endOf(e.date),this.manipulate(1,e.month),this.setDate(0);break;case"year":this.endOf(e.date),this.manipulate(1,e.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(){let t=this.parts(void 0,i).hour;return"24"===t&&(t="00"),t}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){var e;return null===(e=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type)))||void 0===e?void 0:e.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{}const r="tempus-dominus";class d{}d.NAME=r,d.version="6.0.0-beta5.1",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"}},d.errorMessages=new class{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}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}};const l=[{name:"calendar",className:d.css.daysContainer,unit:e.month,step:1},{name:"months",className:d.css.monthsContainer,unit:e.year,step:1},{name:"years",className:d.css.yearsContainer,unit:e.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:e.year,step:100}],c={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:!1},inline:!1},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},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class h{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=l[t].name}refreshCurrentView(){this.currentView=l[this.currentCalendarViewMode].name}}class p{static _mergeOptions(t,e){var s;const i={};let o="";const a=["meta","dayViewHeaderFormat","container"],n="default"!==e.localization.locale?e.localization.locale:(null===(s=null==t?void 0:t.localization)||void 0===s?void 0:s.locale)||"default",r=(t,e,s,i)=>{switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");if(void 0!==t)return t.setLocale(n),t;d.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate");if(void 0!==t)return t.setLocale(n),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");if(void 0!==t)return t.setLocale(n),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");if(void 0!==t)return t.setLocale(n),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,n),e);case"disabledDates":return void 0===e?[]:(this._typeCheckDateArray("restrictions.disabledDates",e,s,n),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 a=e;for(let e=0;e{const i=`${t}[${e}].${s}`;let o=a[e][s];const r=this.dateConversion(o,i);r||d.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(n),a[e][s]=r}));return a;case"toolbarPlacement":case"type":case"viewMode":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"]}[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||(null==e?void 0:e.appendChild))&&d.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;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.substring(1),s,i)}}},l=(t,e,s)=>{const i=Object.keys(t).filter((t=>!Object.keys(e).includes(t)));if(i.length>0){const t=p.getFlattenDefaultOptions(),e=i.map((e=>{let s=`"${o.substring(1)}.${e}" in not a known option.`,i=t.find((t=>t.includes(e)));return i&&(s+=`Did you mean "${i}"?`),s}));d.errorMessages.unexpectedOptions(e)}Object.keys(e).forEach((i=>{const n=e[i];let d=typeof t[i],c=typeof n,h=t[i];if(!t.hasOwnProperty(i)){if("undefined"===c||0===(null==h?void 0:h.length)&&Array.isArray(n))return void(s[i]=n);t[i]=n,h=t[i]}o+=`.${i}`,s[i]=r(i,h,d,c),"object"!=typeof n||a.includes(i)||Array.isArray(t[i])||(l(t[i],n,s[i]),o=o.substring(0,o.lastIndexOf(`.${i}`))),o=o.substring(0,o.lastIndexOf(`.${i}`))}))};return l(t,e,i),i}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if((null==s?void 0:s.tdTargetInput)&&delete s.tdTargetInput,(null==s?void 0: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){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const e=new a(t);return"null"===JSON.stringify(e)?null:e}return null}static _typeCheckDateArray(t,e,s,i="default"){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){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const s=this._dateTypeCheck(t);return s||d.errorMessages.failedToParseDate(e,t,"input"===e),s}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(c),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"))}}class u{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 m;class y{constructor(){this.optionsStore=m.locate(h)}isValid(t,s){var i;if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(t))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(t))return!1;if(s!==e.month&&s!==e.year&&(null===(i=this.optionsStore.options.restrictions.daysOfWeekDisabled)||void 0===i?void 0:i.length)>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&t.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&t.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===e.hours||s===e.minutes||s===e.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let e of this.optionsStore.options.restrictions.disabledTimeIntervals)if(t.isBetween(e.from,e.to))return!1}return!0}_isInDisabledDates(t){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=t.format(o(e.date));return this.optionsStore.options.restrictions.disabledDates.map((t=>t.format(o(e.date)))).find((t=>t===s))}_isInEnabledDates(t){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=t.format(o(e.date));return this.optionsStore.options.restrictions.enabledDates.map((t=>t.format(o(e.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 v{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)}))}destory(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new v,this.viewUpdate=new v,this.updateDisplay=new v,this.action=new v}destory(){this.triggerEvent.destory(),this.viewUpdate.destory(),this.updateDisplay.destory(),this.action.destory()}}class S{constructor(){this._dates=[],this.optionsStore=m.locate(h),this.validation=m.locate(y),this._eventEmitters=m.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}):""}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=p.dateConversion(t,"input");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: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&&(null==o?void 0: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 b;!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"}(b||(b={}));var w=b;class f{constructor(){this.optionsStore=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y)}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",w.selectDay),t.appendChild(s)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.daysContainer)[0],[o,n,r]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");n.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.month),e.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.month),e.month)?r.classList.remove(d.css.disabled):r.classList.add(d.css.disabled);let l=this.optionsStore.viewDate.clone.startOf(e.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,e.hours);i.querySelectorAll(`[data-action="${w.selectDay}"], .${d.css.calendarWeeks}`).forEach((t=>{if(this.optionsStore.options.display.calendarWeeks&&t.classList.contains(d.css.calendarWeeks)){if("#"===t.innerText)return;return void(t.innerText=`${l.week}`)}let i=[];i.push(d.css.day),l.isBefore(this.optionsStore.viewDate,e.month)&&i.push(d.css.old),l.isAfter(this.optionsStore.viewDate,e.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(l,e.date)&&i.push(d.css.active),this.validation.isValid(l,e.date)||i.push(d.css.disabled),l.isSame(new a,e.date)&&i.push(d.css.today),0!==l.weekDay&&6!==l.weekDay||i.push(d.css.weekend),s(e.date,l,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${l.year}-${l.monthFormatted}-${l.dateFormatted}`),t.setAttribute("data-day",`${l.date}`),t.innerText=l.format({day:"numeric"}),l.manipulate(1,e.date)}))}_daysOfTheWeek(){let t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(e.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=t.format({weekday:"short"}),t.manipulate(1,e.date),s.push(i)}return s}}class D{constructor(){this.optionsStore=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y)}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",w.selectMonth),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.monthsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.year),e.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.year),e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(e.year);i.querySelectorAll(`[data-action="${w.selectMonth}"]`).forEach(((t,i)=>{let o=[];o.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(r,e.month)&&o.push(d.css.active),this.validation.isValid(r,e.month)||o.push(d.css.disabled),s(e.month,r,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${i}`),t.innerText=`${r.format({month:"short"})}`,r.manipulate(1,e.month)}))}}class k{constructor(){this.optionsStore=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y)}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",w.selectYear),t.appendChild(e)}return t}_update(t,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,e.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,e.year);const i=t.getElementsByClassName(d.css.yearsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.validation.isValid(this._startYear,e.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this._endYear,e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(e.year).manipulate(-1,e.year);i.querySelectorAll(`[data-action="${w.selectYear}"]`).forEach((t=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(r,e.year)&&i.push(d.css.active),this.validation.isValid(r,e.year)||i.push(d.css.disabled),s(e.year,r,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${r.year}`),t.innerText=r.format({year:"numeric"}),r.manipulate(1,e.year)}))}}class _{constructor(){this.optionsStore=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y)}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",w.selectDecade),t.appendChild(e)}return t}_update(t,s){const[i,o]=S.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(e.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(e.year),this._endDecade.year=o;const a=t.getElementsByClassName(d.css.decadesContainer)[0],[n,r,l]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,e.year)?l.classList.remove(d.css.disabled):l.classList.add(d.css.disabled);const c=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${w.selectDecade}"]`).forEach(((t,i)=>{if(0===i)return t.classList.add(d.css.old),this._startDecade.year-10<0?(t.textContent=" ",n.classList.add(d.css.disabled),t.classList.add(d.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,e.year).format({year:"numeric"}),void t.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&&c.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,e.year)}))}}class C{constructor(){this._gridColumns="",this.optionsStore=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const s=t.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,e.hours),e.hours)||s.querySelector(`[data-action=${w.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.hours),e.hours)||s.querySelector(`[data-action=${w.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.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,e.minutes),e.minutes)||s.querySelector(`[data-action=${w.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.minutes),e.minutes)||s.querySelector(`[data-action=${w.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.seconds),e.seconds)||s.querySelector(`[data-action=${w.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.seconds),e.seconds)||s.querySelector(`[data-action=${w.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const t=s.querySelector(`[data-action=${w.toggleMeridiem}]`);t.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,e.hours))?t.classList.remove(d.css.disabled):t.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=t(this.optionsStore.options.display.icons.up),r=t(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const l=a.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",w.incrementHours),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",w.showHours),t.setAttribute("data-time-component",e.hours),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",w.decrementHours),t.appendChild(r.cloneNode(!0)),o.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",w.incrementMinutes),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",w.showMinutes),t.setAttribute("data-time-component",e.minutes),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",w.decrementMinutes),t.appendChild(r.cloneNode(!0)),o.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",w.incrementSeconds),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",w.showSeconds),t.setAttribute("data-time-component",e.seconds),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",w.decrementSeconds),t.appendChild(r.cloneNode(!0)),o.push(t)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",w.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=c(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=m.locate(h),this.validation=m.locate(y)}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",w.selectHour),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.date);i.querySelectorAll(`[data-action="${w.selectHour}"]`).forEach((t=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,e.hours)||i.push(d.css.disabled),s(e.hours,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.hours}`),t.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,e.hours)}))}}class M{constructor(){this.optionsStore=m.locate(h),this.validation=m.locate(y)}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",w.selectMinute),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${w.selectMinute}"]`).forEach((t=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,e.minutes)||i.push(d.css.disabled),s(e.minutes,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.minutesFormatted}`),t.innerText=o.minutesFormatted,o.manipulate(a,e.minutes)}))}}class L{constructor(){this.optionsStore=m.locate(h),this.validation=m.locate(y)}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",w.selectSecond),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.minutes);i.querySelectorAll(`[data-action="${w.selectSecond}"]`).forEach((t=>{let i=[];i.push(d.css.second),this.validation.isValid(o,e.seconds)||i.push(d.css.disabled),s(e.seconds,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.seconds}`),t.innerText=o.secondsFormatted,o.manipulate(5,e.seconds)}))}}class T{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}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.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}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.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse)}),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=>{var e;this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||(null===(e=t.composedPath())||void 0===e?void 0:e.includes(this.optionsStore.element))||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=m.locate(h),this.validation=m.locate(y),this.dates=m.locate(S),this.dateDisplay=m.locate(f),this.monthDisplay=m.locate(D),this.yearDisplay=m.locate(k),this.decadeDisplay=m.locate(_),this.timeDisplay=m.locate(C),this.hourDisplay=m.locate(E),this.minuteDisplay=m.locate(M),this.secondDisplay=m.locate(L),this._eventEmitters=m.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(t){if(this.widget)switch(t){case e.seconds:this.secondDisplay._update(this.widget,this.paint);break;case e.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case e.hours:this.hourDisplay._update(this.widget,this.paint);break;case e.date:this.dateDisplay._update(this.widget,this.paint);break;case e.month:this.monthDisplay._update(this.widget,this.paint);break;case e.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(e.hours),this._update(e.minutes),this._update(e.seconds);break;case"calendar":this._update(e.date),this._update(e.year),this._update(e.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(){var s,i;if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const t=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let i=0,o=1;for((null===(s=this.optionsStore.options.restrictions.maxDate)||void 0===s?void 0:s.isBefore(t))&&(o=-1);!(this.validation.isValid(t)||(t.manipulate(o,e.date),i>31));)i++}this.dates.setValue(t)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:w.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||(this._hasTime&&T.hide(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{((null===(i=this.optionsStore.options)||void 0===i?void 0:i.container)||document.body).appendChild(this.widget),this._popperInstance=t(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"})}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:w.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._popperInstance.update(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}_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=l[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()}_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",w.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",w.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",w.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",w.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",w.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",w.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",w.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=m.locate(h),this.dates=m.locate(S),this.validation=m.locate(y),this.display=m.locate(A),this._eventEmitters=m.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,s){var i,o;const n=null==t?void 0:t.currentTarget;if(null===(i=null==n?void 0:n.classList)||void 0===i?void 0:i.contains(d.css.disabled))return!1;s=s||(null===(o=null==n?void 0:n.dataset)||void 0===o?void 0:o.action);const r=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case w.next:case w.previous:this.handleNextPrevious(s);break;case w.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case w.selectMonth:case w.selectYear:case w.selectDecade:const i=+n.dataset.value;switch(s){case w.selectMonth:this.optionsStore.viewDate.month=i;break;case w.selectYear:case w.selectDecade:this.optionsStore.viewDate.year=i}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 w.selectDay:const o=this.optionsStore.viewDate.clone;n.classList.contains(d.css.old)&&o.manipulate(-1,e.month),n.classList.contains(d.css.new)&&o.manipulate(1,e.month),o.date=+n.dataset.day;let l=0;this.optionsStore.options.multipleDates?(l=this.dates.pickedIndex(o,e.date),-1!==l?this.dates.setValue(null,l):this.dates.setValue(o,this.dates.lastPickedIndex+1)):this.dates.setValue(o,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 w.selectHour:let c=+n.dataset.value;r.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(c+=12),r.hours=c,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case w.selectMinute:r.minutes=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case w.selectSecond:r.seconds=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case w.incrementHours:this.manipulateAndSet(r,e.hours);break;case w.incrementMinutes:this.manipulateAndSet(r,e.minutes,this.optionsStore.options.stepping);break;case w.incrementSeconds:this.manipulateAndSet(r,e.seconds);break;case w.decrementHours:this.manipulateAndSet(r,e.hours,-1);break;case w.decrementMinutes:this.manipulateAndSet(r,e.minutes,-1*this.optionsStore.options.stepping);break;case w.decrementSeconds:this.manipulateAndSet(r,e.seconds,-1);break;case w.toggleMeridiem:this.manipulateAndSet(r,e.hours,this.dates.lastPicked.hours>=12?-12:12);break;case w.togglePicker:n.getAttribute("title")===this.optionsStore.options.localization.selectDate?(n.setAttribute("title",this.optionsStore.options.localization.selectTime),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(n.setAttribute("title",this.optionsStore.options.localization.selectDate),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.do(t,w.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 w.showClock:case w.showHours:case w.showMinutes:case w.showSeconds:this.handleShowClockContainers(s);break;case w.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case w.close:this.display.hide();break;case w.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,e.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(t){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(t){case w.showClock:s=d.css.clockContainer,this.display._update("clock");break;case w.showHours:s=d.css.hourContainer,this.display._update(e.hours);break;case w.showMinutes:s=d.css.minuteContainer,this.display._update(e.minutes);break;case w.showSeconds:s=d.css.secondContainer,this.display._update(e.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=l[this.optionsStore.currentCalendarViewMode];t===w.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,w.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=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked)},s=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=s.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.toggle()},m=new u,this._eventEmitters=m.locate(g),this.optionsStore=m.locate(h),this.display=m.locate(A),this.dates=m.locate(S),this.actions=m.locate($),t||d.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,c,!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,c):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(){var t;this._isDisabled=!0,null===(t=this.optionsStore.input)||void 0===t||t.setAttribute("disabled","disabled"),this.display.hide()}enable(){var t;this._isDisabled=!1,null===(t=this.optionsStore.input)||void 0===t||t.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){var i;t=p._mergeOptions(t,e),s&&(t=p._dataToOptions(this.optionsStore.element,t)),p._validateConflicts(t),t.viewDate=t.viewDate.setLocale(t.localization.locale),this.optionsStore.viewDate.isSame(t.viewDate)||(this.optionsStore.viewDate=t.viewDate),t.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),t.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),t.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),l[this.optionsStore.currentCalendarViewMode].name!==t.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(l.findIndex((e=>e.name===t.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),this.optionsStore.options=t}_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){var e,s;!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||(null===(e=this.display.widget)||void 0===e?void 0:e.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer))||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&(null===(s=t.date)||void 0===s?void 0:s.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:w.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const H={},V=t=>{H[t.name]||(H[t.name]=t.localization)},x=t=>{let e=H[t];e&&(c.localization=e)},P=function(t,e){return t.$i||(t.load(e,{TempusDominus:O,Dates:S,Display:A},this),t.$i=!0),this};export{a as DateTime,c as DefaultOptions,d as Namespace,O as TempusDominus,e as Unit,P as extend,V as loadLocale,x as locale}; +import{createPopper as t}from"@popperjs/core";var e;!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(e||(e={}));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)}get clone(){return new a(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocale(this.locale)}startOf(t,s=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){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(e.date),this.weekDay===s)break;let t=this.weekDay;0!==s&&0===this.weekDay&&(t=8-s),this.manipulate(s-t,e.date);break;case"month":this.startOf(e.date),this.setDate(1);break;case"year":this.startOf(e.date),this.setMonth(0,1)}return this}endOf(t,s=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){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(e.date),this.manipulate(6+s-this.weekDay,e.date);break;case"month":this.endOf(e.date),this.manipulate(1,e.month),this.setDate(0);break;case"year":this.endOf(e.date),this.manipulate(1,e.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(){let t=this.parts(void 0,i).hour;return"24"===t&&(t="00"),t}get twelveHoursFormatted(){return this.parts(void 0,s).hour}meridiem(t=this.locale){var e;return null===(e=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type)))||void 0===e?void 0:e.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{}const r="tempus-dominus";class d{}d.NAME=r,d.version="6.0.0-beta7",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"}},d.errorMessages=new class{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}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string.`)}throwError(t){const e=new n(`${this.base} ${t}`);throw e.code=9,e}};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 c;const h=[{name:"calendar",className:d.css.daysContainer,unit:e.month,step:1},{name:"months",className:d.css.monthsContainer,unit:e.year,step:1},{name:"years",className:d.css.yearsContainer,unit:e.year,step:10},{name:"decades",className:d.css.decadesContainer,unit:e.year,step:100}];class p{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=h[t].name}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}}class u{constructor(){this.optionsStore=c.locate(p)}isValid(t,s){var i;if(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(t))return!1;if(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(t))return!1;if(s!==e.month&&s!==e.year&&(null===(i=this.optionsStore.options.restrictions.daysOfWeekDisabled)||void 0===i?void 0:i.length)>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(this.optionsStore.options.restrictions.minDate&&t.isBefore(this.optionsStore.options.restrictions.minDate,s))return!1;if(this.optionsStore.options.restrictions.maxDate&&t.isAfter(this.optionsStore.options.restrictions.maxDate,s))return!1;if(s===e.hours||s===e.minutes||s===e.seconds){if(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))return!1;if(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))return!1;if(this.optionsStore.options.restrictions.disabledTimeIntervals.length>0)for(let e of this.optionsStore.options.restrictions.disabledTimeIntervals)if(t.isBetween(e.from,e.to))return!1}return!0}_isInDisabledDates(t){if(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)return!1;const s=t.format(o(e.date));return this.optionsStore.options.restrictions.disabledDates.map((t=>t.format(o(e.date)))).find((t=>t===s))}_isInEnabledDates(t){if(!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length)return!0;const s=t.format(o(e.date));return this.optionsStore.options.restrictions.enabledDates.map((t=>t.format(o(e.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)}))}destory(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m}destory(){this.triggerEvent.destory(),this.viewUpdate.destory(),this.updateDisplay.destory(),this.action.destory()}}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:!1},inline:!1},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},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class g{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]=g.deepCopy(i))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t.split(".").reduce(((t,e)=>g.isValue(t)||g.isValue(t[e])?t[e]:void 0),e)}static spread(t,e,s,i="",o=""){const a=Object.keys(t).filter((t=>!Object.keys(e).includes(t)));if(a.length>0){const t=g.getFlattenDefaultOptions(),e=a.map((e=>{let s=`"${i}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(s+=`Did you mean "${o}"?`),s}));d.errorMessages.unexpectedOptions(e)}Object.keys(e).forEach((e=>{"."===(i+=`.${e}`).charAt(0)&&(i=i.slice(1));const a=g.objectPath(i,v);let n=typeof t[e],r=typeof a,d=t[e];if(!t.hasOwnProperty(e)){if("undefined"===r||0===(null==d?void 0:d.length)&&Array.isArray(a))return s[e]=a,void(i=i.substring(0,i.lastIndexOf(`.${e}`)));t[e]=a,d=t[e]}s[e]=g.processKey(e,d,n,r,i,o),"object"!=typeof a||a instanceof Date||g.ignoreProperties.includes(e)||Array.isArray(t[e])||g.spread(t[e],a,s[e],i,o),i=i.substring(0,i.lastIndexOf(`.${e}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");if(void 0!==t)return t.setLocale(a),t;d.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate");if(void 0!==t)return t.setLocale(a),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");if(void 0!==t)return t.setLocale(a),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");if(void 0!==t)return t.setLocale(a),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);r||d.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"]}[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||(null==e?void 0:e.appendChild))&&d.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;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){var s;const i={},o="default"!==e.localization.locale?e.localization.locale:(null===(s=null==t?void 0:t.localization)||void 0===s?void 0:s.locale)||"default";return g.spread(t,e,i,"",o),i}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if((null==s?void 0:s.tdTargetInput)&&delete s.tdTargetInput,(null==s?void 0: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){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const e=new a(t);return"null"===JSON.stringify(e)?null:e}return null}static _typeCheckDateArray(t,e,s,i="default"){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){"string"==typeof t&&"input"!==e&&d.errorMessages.dateString();const s=this._dateTypeCheck(t);return s||d.errorMessages.failedToParseDate(e,t,"input"===e),s}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)||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"))}}g.ignoreProperties=["meta","dayViewHeaderFormat","container"],g.isValue=t=>null!=t;class S{constructor(){this._dates=[],this.optionsStore=c.locate(p),this.validation=c.locate(u),this._eventEmitters=c.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 g.dateConversion(t,"input")}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: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&&(null==o?void 0: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 b;!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"}(b||(b={}));var f=b;class w{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate(S),this.validation=c.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",f.selectDay),t.appendChild(s)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.daysContainer)[0],[o,n,r]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");n.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.month),e.month)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.month),e.month)?r.classList.remove(d.css.disabled):r.classList.add(d.css.disabled);let l=this.optionsStore.viewDate.clone.startOf(e.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,e.hours);i.querySelectorAll(`[data-action="${f.selectDay}"], .${d.css.calendarWeeks}`).forEach((t=>{if(this.optionsStore.options.display.calendarWeeks&&t.classList.contains(d.css.calendarWeeks)){if("#"===t.innerText)return;return void(t.innerText=`${l.week}`)}let i=[];i.push(d.css.day),l.isBefore(this.optionsStore.viewDate,e.month)&&i.push(d.css.old),l.isAfter(this.optionsStore.viewDate,e.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(l,e.date)&&i.push(d.css.active),this.validation.isValid(l,e.date)||i.push(d.css.disabled),l.isSame(new a,e.date)&&i.push(d.css.today),0!==l.weekDay&&6!==l.weekDay||i.push(d.css.weekend),s(e.date,l,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${l.year}-${l.monthFormatted}-${l.dateFormatted}`),t.setAttribute("data-day",`${l.date}`),t.innerText=l.format({day:"numeric"}),l.manipulate(1,e.date)}))}_daysOfTheWeek(){let t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(e.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=t.format({weekday:"short"}),t.manipulate(1,e.date),s.push(i)}return s}}class D{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate(S),this.validation=c.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",f.selectMonth),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.monthsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.year),e.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.year),e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(e.year);i.querySelectorAll(`[data-action="${f.selectMonth}"]`).forEach(((t,i)=>{let o=[];o.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(r,e.month)&&o.push(d.css.active),this.validation.isValid(r,e.month)||o.push(d.css.disabled),s(e.month,r,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${i}`),t.innerText=`${r.format({month:"short"})}`,r.manipulate(1,e.month)}))}}class k{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate(S),this.validation=c.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",f.selectYear),t.appendChild(e)}return t}_update(t,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,e.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,e.year);const i=t.getElementsByClassName(d.css.yearsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.validation.isValid(this._startYear,e.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled),this.validation.isValid(this._endYear,e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(e.year).manipulate(-1,e.year);i.querySelectorAll(`[data-action="${f.selectYear}"]`).forEach((t=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(r,e.year)&&i.push(d.css.active),this.validation.isValid(r,e.year)||i.push(d.css.disabled),s(e.year,r,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${r.year}`),t.innerText=r.format({year:"numeric"}),r.manipulate(1,e.year)}))}}class _{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate(S),this.validation=c.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",f.selectDecade),t.appendChild(e)}return t}_update(t,s){const[i,o]=S.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(e.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(e.year),this._endDecade.year=o;const a=t.getElementsByClassName(d.css.decadesContainer)[0],[n,r,l]=a.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");r.setAttribute(d.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,e.year)?n.classList.remove(d.css.disabled):n.classList.add(d.css.disabled),this.validation.isValid(this._endDecade,e.year)?l.classList.remove(d.css.disabled):l.classList.add(d.css.disabled);const c=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${f.selectDecade}"]`).forEach(((t,i)=>{if(0===i)return t.classList.add(d.css.old),this._startDecade.year-10<0?(t.textContent=" ",n.classList.add(d.css.disabled),t.classList.add(d.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,e.year).format({year:"numeric"}),void t.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&&c.filter((t=>t>=a&&t<=r)).length>0&&o.push(d.css.active),s("decade",this._startDecade,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,e.year)}))}}class C{constructor(){this._gridColumns="",this.optionsStore=c.locate(p),this.dates=c.locate(S),this.validation=c.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(d.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const s=t.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,e.hours),e.hours)||s.querySelector(`[data-action=${f.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.hours),e.hours)||s.querySelector(`[data-action=${f.decrementHours}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.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,e.minutes),e.minutes)||s.querySelector(`[data-action=${f.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.minutes),e.minutes)||s.querySelector(`[data-action=${f.decrementMinutes}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.minutes}]`).innerText=i.minutesFormatted),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,e.seconds),e.seconds)||s.querySelector(`[data-action=${f.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.seconds),e.seconds)||s.querySelector(`[data-action=${f.decrementSeconds}]`).classList.add(d.css.disabled),s.querySelector(`[data-time-component=${e.seconds}]`).innerText=i.secondsFormatted),!this.optionsStore.options.display.components.useTwentyfourHour){const t=s.querySelector(`[data-action=${f.toggleMeridiem}]`);t.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,e.hours))?t.classList.remove(d.css.disabled):t.classList.add(d.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const s=[],i=[],o=[],a=document.createElement("div"),n=t(this.optionsStore.options.display.icons.up),r=t(this.optionsStore.options.display.icons.down);a.classList.add(d.css.separator,d.css.noHighlight);const l=a.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):a.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",f.incrementHours),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",f.showHours),t.setAttribute("data-time-component",e.hours),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",f.decrementHours),t.appendChild(r.cloneNode(!0)),o.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",f.incrementMinutes),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",f.showMinutes),t.setAttribute("data-time-component",e.minutes),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",f.decrementMinutes),t.appendChild(r.cloneNode(!0)),o.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",f.incrementSeconds),t.appendChild(n.cloneNode(!0)),s.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",f.showSeconds),t.setAttribute("data-time-component",e.seconds),i.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",f.decrementSeconds),t.appendChild(r.cloneNode(!0)),o.push(t)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",f.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=c(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class E{constructor(){this.optionsStore=c.locate(p),this.validation=c.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",f.selectHour),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.date);i.querySelectorAll(`[data-action="${f.selectHour}"]`).forEach((t=>{let i=[];i.push(d.css.hour),this.validation.isValid(o,e.hours)||i.push(d.css.disabled),s(e.hours,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.hours}`),t.innerText=this.optionsStore.options.display.components.useTwentyfourHour?o.hoursFormatted:o.twelveHoursFormatted,o.manipulate(1,e.hours)}))}}class M{constructor(){this.optionsStore=c.locate(p),this.validation=c.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",f.selectMinute),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.hours),a=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${f.selectMinute}"]`).forEach((t=>{let i=[];i.push(d.css.minute),this.validation.isValid(o,e.minutes)||i.push(d.css.disabled),s(e.minutes,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.minutesFormatted}`),t.innerText=o.minutesFormatted,o.manipulate(a,e.minutes)}))}}class L{constructor(){this.optionsStore=c.locate(p),this.validation=c.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",f.selectSecond),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(e.minutes);i.querySelectorAll(`[data-action="${f.selectSecond}"]`).forEach((t=>{let i=[];i.push(d.css.second),this.validation.isValid(o,e.seconds)||i.push(d.css.disabled),s(e.seconds,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.seconds}`),t.innerText=o.secondsFormatted,o.manipulate(5,e.seconds)}))}}class T{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}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.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}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.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse)}),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=>{var e;this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||(null===(e=t.composedPath())||void 0===e?void 0:e.includes(this.optionsStore.element))||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=c.locate(p),this.validation=c.locate(u),this.dates=c.locate(S),this.dateDisplay=c.locate(w),this.monthDisplay=c.locate(D),this.yearDisplay=c.locate(k),this.decadeDisplay=c.locate(_),this.timeDisplay=c.locate(C),this.hourDisplay=c.locate(E),this.minuteDisplay=c.locate(M),this.secondDisplay=c.locate(L),this._eventEmitters=c.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(t){if(this.widget)switch(t){case e.seconds:this.secondDisplay._update(this.widget,this.paint);break;case e.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case e.hours:this.hourDisplay._update(this.widget,this.paint);break;case e.date:this.dateDisplay._update(this.widget,this.paint);break;case e.month:this.monthDisplay._update(this.widget,this.paint);break;case e.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(e.hours),this._update(e.minutes),this._update(e.seconds);break;case"calendar":this._update(e.date),this._update(e.year),this._update(e.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(){var s,i;if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const t=(new a).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let i=0,o=1;for((null===(s=this.optionsStore.options.restrictions.maxDate)||void 0===s?void 0:s.isBefore(t))&&(o=-1);!(this.validation.isValid(t)||(t.manipulate(o,e.date),i>31));)i++}this.dates.setValue(t)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:f.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||(this._hasTime&&T.hide(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{((null===(i=this.optionsStore.options)||void 0===i?void 0:i.container)||document.body).appendChild(this.widget),this._popperInstance=t(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"})}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:f.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._popperInstance.update(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:d.events.show}),this._isVisible=!0}_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()}_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",f.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",f.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",f.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",f.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",f.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",f.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",f.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=c.locate(p),this.dates=c.locate(S),this.validation=c.locate(u),this.display=c.locate(A),this._eventEmitters=c.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,s){var i,o;const n=null==t?void 0:t.currentTarget;if(null===(i=null==n?void 0:n.classList)||void 0===i?void 0:i.contains(d.css.disabled))return!1;s=s||(null===(o=null==n?void 0:n.dataset)||void 0===o?void 0:o.action);const r=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case f.next:case f.previous:this.handleNextPrevious(s);break;case f.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case f.selectMonth:case f.selectYear:case f.selectDecade:const i=+n.dataset.value;switch(s){case f.selectMonth:this.optionsStore.viewDate.month=i;break;case f.selectYear:case f.selectDecade:this.optionsStore.viewDate.year=i}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 f.selectDay:const o=this.optionsStore.viewDate.clone;n.classList.contains(d.css.old)&&o.manipulate(-1,e.month),n.classList.contains(d.css.new)&&o.manipulate(1,e.month),o.date=+n.dataset.day;let l=0;this.optionsStore.options.multipleDates?(l=this.dates.pickedIndex(o,e.date),-1!==l?this.dates.setValue(null,l):this.dates.setValue(o,this.dates.lastPickedIndex+1)):this.dates.setValue(o,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 f.selectHour:let c=+n.dataset.value;r.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(c+=12),r.hours=c,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case f.selectMinute:r.minutes=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case f.selectSecond:r.seconds=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case f.incrementHours:this.manipulateAndSet(r,e.hours);break;case f.incrementMinutes:this.manipulateAndSet(r,e.minutes,this.optionsStore.options.stepping);break;case f.incrementSeconds:this.manipulateAndSet(r,e.seconds);break;case f.decrementHours:this.manipulateAndSet(r,e.hours,-1);break;case f.decrementMinutes:this.manipulateAndSet(r,e.minutes,-1*this.optionsStore.options.stepping);break;case f.decrementSeconds:this.manipulateAndSet(r,e.seconds,-1);break;case f.toggleMeridiem:this.manipulateAndSet(r,e.hours,this.dates.lastPicked.hours>=12?-12:12);break;case f.togglePicker:n.getAttribute("title")===this.optionsStore.options.localization.selectDate?(n.setAttribute("title",this.optionsStore.options.localization.selectTime),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(n.setAttribute("title",this.optionsStore.options.localization.selectDate),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.do(t,f.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 f.showClock:case f.showHours:case f.showMinutes:case f.showSeconds:this.handleShowClockContainers(s);break;case f.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case f.close:this.display.hide();break;case f.today:const h=(new a).setLocale(this.optionsStore.options.localization.locale);this.optionsStore.viewDate=h,this.validation.isValid(h,e.date)&&this.dates.setValue(h,this.dates.lastPickedIndex)}}handleShowClockContainers(t){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(t){case f.showClock:s=d.css.clockContainer,this.display._update("clock");break;case f.showHours:s=d.css.hourContainer,this.display._update(e.hours);break;case f.showMinutes:s=d.css.minuteContainer,this.display._update(e.minutes);break;case f.showSeconds:s=d.css.secondContainer,this.display._update(e.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===f.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,f.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=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked)},s=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=s.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{var t,e;(null===(t=this.optionsStore.element)||void 0===t?void 0:t.disabled)||(null===(e=this.optionsStore.input)||void 0===e?void 0:e.disabled)||this.toggle()},c=new l,this._eventEmitters=c.locate(y),this.optionsStore=c.locate(p),this.display=c.locate(A),this.dates=c.locate(S),this.actions=c.locate($),t||d.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(){var t;this._isDisabled=!0,null===(t=this.optionsStore.input)||void 0===t||t.setAttribute("disabled","disabled"),this.display.hide()}enable(){var t;this._isDisabled=!1,null===(t=this.optionsStore.input)||void 0===t||t.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){var i;let o=g.deepCopy(t);o=g._mergeOptions(o,e),s&&(o=g._dataToOptions(this.optionsStore.element,o)),g._validateConflicts(o),o.viewDate=o.viewDate.setLocale(o.localization.locale),this.optionsStore.viewDate.isSame(o.viewDate)||(this.optionsStore.viewDate=o.viewDate),o.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),o.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),o.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==o.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===o.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),this.optionsStore.options=o}_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){var e,s;!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||(null===(e=this.display.widget)||void 0===e?void 0:e.getElementsByClassName(d.css.show)[0].classList.contains(d.css.timeContainer))||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&(null===(s=t.date)||void 0===s?void 0:s.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:f.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.$i||(t.load(e,{TempusDominus:O,Dates:S,Display:A},this),t.$i=!0),this};export{a as DateTime,v as DefaultOptions,d as Namespace,O as TempusDominus,e as Unit,P as extend,H as loadLocale,x as locale}; diff --git a/dist/js/tempus-dominus.js b/dist/js/tempus-dominus.js index 7fa880e9d..e69a3d4c8 100644 --- a/dist/js/tempus-dominus.js +++ b/dist/js/tempus-dominus.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -519,7 +519,7 @@ } /** * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalide string or an invalid Date object. + * the option was an invalid string or an invalid Date object. * @param optionName * @param date * @param soft If true, logs a warning instead of an error. @@ -571,7 +571,7 @@ } // this is not the way I want this to stay but nested classes seemed to blown up once its compiled. - const NAME = 'tempus-dominus', version = '6.0.0-beta5.1', dataKey = 'td'; + const NAME = 'tempus-dominus', version = '6.0.0-beta7', dataKey = 'td'; /** * Events */ @@ -792,6 +792,24 @@ Namespace.css = new Css(); Namespace.errorMessages = new ErrorMessages(); + class ServiceLocator { + constructor() { + this.cache = new Map(); + } + locate(identifier) { + const service = this.cache.get(identifier); + if (service) + return service; + const value = new identifier(); + this.cache.set(identifier, value); + return value; + } + } + const setupServiceLocator = () => { + serviceLocator = new ServiceLocator(); + }; + let serviceLocator; + const CalendarModes = [ { name: 'calendar', @@ -819,6 +837,180 @@ }, ]; + class OptionsStore { + constructor() { + this.viewDate = new DateTime(); + this._currentCalendarViewMode = 0; + this.minimumCalendarViewMode = 0; + this.currentView = 'calendar'; + } + get currentCalendarViewMode() { + return this._currentCalendarViewMode; + } + set currentCalendarViewMode(value) { + this._currentCalendarViewMode = value; + this.currentView = CalendarModes[value].name; + } + /** + * When switching back to the calendar from the clock, + * this sets currentView to the correct calendar view. + */ + refreshCurrentView() { + this.currentView = CalendarModes[this.currentCalendarViewMode].name; + } + } + + /** + * Main class for date validation rules based on the options provided. + */ + class Validation { + constructor() { + this.optionsStore = serviceLocator.locate(OptionsStore); + } + /** + * Checks to see if the target date is valid based on the rules provided in the options. + * Granularity can be provide to chek portions of the date instead of the whole. + * @param targetDate + * @param granularity + */ + isValid(targetDate, granularity) { + var _a; + if (this.optionsStore.options.restrictions.disabledDates.length > 0 && + this._isInDisabledDates(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.enabledDates.length > 0 && + !this._isInEnabledDates(targetDate)) { + return false; + } + if (granularity !== exports.Unit.month && + granularity !== exports.Unit.year && + ((_a = this.optionsStore.options.restrictions.daysOfWeekDisabled) === null || _a === void 0 ? void 0 : _a.length) > 0 && + this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) { + return false; + } + if (this.optionsStore.options.restrictions.minDate && + targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { + return false; + } + if (this.optionsStore.options.restrictions.maxDate && + targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { + return false; + } + if (granularity === exports.Unit.hours || + granularity === exports.Unit.minutes || + granularity === exports.Unit.seconds) { + if (this.optionsStore.options.restrictions.disabledHours.length > 0 && + this._isInDisabledHours(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.enabledHours.length > 0 && + !this._isInEnabledHours(targetDate)) { + return false; + } + if (this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0) { + for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) { + if (targetDate.isBetween(disabledTimeIntervals.from, disabledTimeIntervals.to)) + return false; + } + } + } + return true; + } + /** + * Checks to see if the disabledDates option is in use and returns true (meaning invalid) + * if the `testDate` is with in the array. Granularity is by date. + * @param testDate + * @private + */ + _isInDisabledDates(testDate) { + if (!this.optionsStore.options.restrictions.disabledDates || + this.optionsStore.options.restrictions.disabledDates.length === 0) + return false; + const formattedDate = testDate.format(getFormatByUnit(exports.Unit.date)); + return this.optionsStore.options.restrictions.disabledDates + .map((x) => x.format(getFormatByUnit(exports.Unit.date))) + .find((x) => x === formattedDate); + } + /** + * Checks to see if the enabledDates option is in use and returns true (meaning valid) + * if the `testDate` is with in the array. Granularity is by date. + * @param testDate + * @private + */ + _isInEnabledDates(testDate) { + if (!this.optionsStore.options.restrictions.enabledDates || + this.optionsStore.options.restrictions.enabledDates.length === 0) + return true; + const formattedDate = testDate.format(getFormatByUnit(exports.Unit.date)); + return this.optionsStore.options.restrictions.enabledDates + .map((x) => x.format(getFormatByUnit(exports.Unit.date))) + .find((x) => x === formattedDate); + } + /** + * Checks to see if the disabledHours option is in use and returns true (meaning invalid) + * if the `testDate` is with in the array. Granularity is by hours. + * @param testDate + * @private + */ + _isInDisabledHours(testDate) { + if (!this.optionsStore.options.restrictions.disabledHours || + this.optionsStore.options.restrictions.disabledHours.length === 0) + return false; + const formattedDate = testDate.hours; + return this.optionsStore.options.restrictions.disabledHours.find((x) => x === formattedDate); + } + /** + * Checks to see if the enabledHours option is in use and returns true (meaning valid) + * if the `testDate` is with in the array. Granularity is by hours. + * @param testDate + * @private + */ + _isInEnabledHours(testDate) { + if (!this.optionsStore.options.restrictions.enabledHours || + this.optionsStore.options.restrictions.enabledHours.length === 0) + return true; + const formattedDate = testDate.hours; + return this.optionsStore.options.restrictions.enabledHours.find((x) => x === formattedDate); + } + } + + class EventEmitter { + constructor() { + this.subscribers = []; + } + subscribe(callback) { + this.subscribers.push(callback); + return this.unsubscribe.bind(this, this.subscribers.length - 1); + } + unsubscribe(index) { + this.subscribers.splice(index, 1); + } + emit(value) { + this.subscribers.forEach((callback) => { + callback(value); + }); + } + destory() { + this.subscribers = null; + this.subscribers = []; + } + } + class EventEmitters { + constructor() { + this.triggerEvent = new EventEmitter(); + this.viewUpdate = new EventEmitter(); + this.updateDisplay = new EventEmitter(); + this.action = new EventEmitter(); + } + destory() { + this.triggerEvent.destory(); + this.viewUpdate.destory(); + this.updateDisplay.destory(); + this.action.destory(); + } + } + const DefaultOptions = { restrictions: { minDate: undefined, @@ -913,229 +1105,239 @@ container: undefined }; - class OptionsStore { - constructor() { - this.viewDate = new DateTime(); - this._currentCalendarViewMode = 0; - this.minimumCalendarViewMode = 0; - this.currentView = 'calendar'; - } - get currentCalendarViewMode() { - return this._currentCalendarViewMode; + class OptionConverter { + static deepCopy(input) { + const o = {}; + Object.keys(input).forEach((key) => { + const inputElement = input[key]; + o[key] = inputElement; + if (typeof inputElement !== 'object' || + inputElement instanceof HTMLElement || + inputElement instanceof Element || + inputElement instanceof Date) + return; + if (!Array.isArray(inputElement)) { + o[key] = OptionConverter.deepCopy(inputElement); + } + }); + return o; } - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; + /** + * Finds value out of an object based on a string, period delimited, path + * @param paths + * @param obj + */ + static objectPath(paths, obj) { + if (paths.charAt(0) === '.') + paths = paths.slice(1); + return paths.split('.') + .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ? + value[key] : + undefined), obj); } /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. + * The spread operator caused sub keys to be missing after merging. + * This is to fix that issue by using spread on the child objects first. + * Also handles complex options like disabledDates + * @param provided An option from new providedOptions + * @param mergeOption Default option to compare types against + * @param copyTo Destination object. This was added to prevent reference copies + * @param path + * @param locale */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; + static spread(provided, mergeOption, copyTo, path = '', locale = '') { + const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(mergeOption).includes(x)); + if (unsupportedOptions.length > 0) { + const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); + const errors = unsupportedOptions.map((x) => { + let error = `"${path}.${x}" in not a known option.`; + let didYouMean = flattenedOptions.find((y) => y.includes(x)); + if (didYouMean) + error += `Did you mean "${didYouMean}"?`; + return error; + }); + Namespace.errorMessages.unexpectedOptions(errors); + } + Object.keys(mergeOption).forEach((key) => { + path += `.${key}`; + if (path.charAt(0) === '.') + path = path.slice(1); + const defaultOptionValue = OptionConverter.objectPath(path, DefaultOptions); + let providedType = typeof provided[key]; + let defaultType = typeof defaultOptionValue; + let value = provided[key]; + if (!provided.hasOwnProperty(key)) { + if (defaultType === 'undefined' || + ((value === null || value === void 0 ? void 0 : value.length) === 0 && Array.isArray(defaultOptionValue))) { + copyTo[key] = defaultOptionValue; + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + provided[key] = defaultOptionValue; + value = provided[key]; + } + copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale); + if (typeof defaultOptionValue !== 'object' || + defaultOptionValue instanceof Date || + OptionConverter.ignoreProperties.includes(key)) { + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + if (!Array.isArray(provided[key])) { + OptionConverter.spread(provided[key], defaultOptionValue, copyTo[key], path, locale); + } + path = path.substring(0, path.lastIndexOf(`.${key}`)); + }); } - } - class OptionConverter { - static _mergeOptions(providedOptions, mergeTo) { - var _a; - const newOptions = {}; - let path = ''; - const ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; - //see if the options specify a locale - const locale = mergeTo.localization.locale !== 'default' - ? mergeTo.localization.locale - : ((_a = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.localization) === null || _a === void 0 ? void 0 : _a.locale) || 'default'; - const processKey = (key, value, providedType, defaultType) => { - switch (key) { - case 'defaultDate': { - const dateTime = this.dateConversion(value, 'defaultDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('defaultDate', providedType, 'DateTime or Date'); - break; + static processKey(key, value, providedType, defaultType, path, locale) { + switch (key) { + case 'defaultDate': { + const dateTime = this.dateConversion(value, 'defaultDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'viewDate': { - const dateTime = this.dateConversion(value, 'viewDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('viewDate', providedType, 'DateTime or Date'); - break; + Namespace.errorMessages.typeMismatch('defaultDate', providedType, 'DateTime or Date'); + break; + } + case 'viewDate': { + const dateTime = this.dateConversion(value, 'viewDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'minDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.minDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('restrictions.minDate', providedType, 'DateTime or Date'); - break; + Namespace.errorMessages.typeMismatch('viewDate', providedType, 'DateTime or Date'); + break; + } + case 'minDate': { + if (value === undefined) { + return value; } - case 'maxDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.maxDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch('restrictions.maxDate', providedType, 'DateTime or Date'); - break; + const dateTime = this.dateConversion(value, 'restrictions.minDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; } - case 'disabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); - return value; - case 'enabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); - return value; - case 'daysOfWeekDisabled': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); - if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); - return value; - case 'enabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray('restrictions.enabledDates', value, providedType, locale); - return value; - case 'disabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray('restrictions.disabledDates', value, providedType, locale); - return value; - case 'disabledTimeIntervals': - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); - } - const valueObject = value; - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - let d = valueObject[i][vk]; - const dateTime = this.dateConversion(d, subOptionName); - if (!dateTime) { - Namespace.errorMessages.typeMismatch(subOptionName, typeof d, 'DateTime or Date'); - } - dateTime.setLocale(locale); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - case 'toolbarPlacement': - case 'type': - case 'viewMode': - const optionValues = { - toolbarPlacement: ['top', 'bottom', 'default'], - type: ['icons', 'sprites'], - viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], - }; - const keyOptions = optionValues[key]; - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); - return value; - case 'meta': - case 'dayViewHeaderFormat': - return value; - case 'container': - if (value && - !(value instanceof HTMLElement || - value instanceof Element || - (value === null || value === void 0 ? void 0 : value.appendChild))) { - Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); - } + Namespace.errorMessages.typeMismatch('restrictions.minDate', providedType, 'DateTime or Date'); + break; + } + case 'maxDate': { + if (value === undefined) { return value; - default: - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch(path.substring(1), providedType, defaultType); - } + } + const dateTime = this.dateConversion(value, 'restrictions.maxDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch('restrictions.maxDate', providedType, 'DateTime or Date'); + break; } - }; - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param mergeOption Default option to compare types against - * @param copyTo Destination object. This was added to prevent reference copies - */ - const spread = (provided, mergeOption, copyTo) => { - const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(mergeOption).includes(x)); - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - const errors = unsupportedOptions.map((x) => { - let error = `"${path.substring(1)}.${x}" in not a known option.`; - let didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) - error += `Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - Object.keys(mergeOption).forEach((key) => { - const defaultOptionValue = mergeOption[key]; - let providedType = typeof provided[key]; - let defaultType = typeof defaultOptionValue; - let value = provided[key]; - if (!provided.hasOwnProperty(key)) { - if (defaultType === 'undefined' || - ((value === null || value === void 0 ? void 0 : value.length) === 0 && Array.isArray(defaultOptionValue))) { - copyTo[key] = defaultOptionValue; - return; - } - provided[key] = defaultOptionValue; - value = provided[key]; + case 'disabledHours': + if (value === undefined) { + return []; } - path += `.${key}`; - copyTo[key] = processKey(key, value, providedType, defaultType); - if (typeof defaultOptionValue !== 'object' || - ignoreProperties.includes(key)) { - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; + this._typeCheckNumberArray('restrictions.disabledHours', value, providedType); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.disabledHours', 0, 23); + return value; + case 'enabledHours': + if (value === undefined) { + return []; } - if (!Array.isArray(provided[key])) { - spread(provided[key], defaultOptionValue, copyTo[key]); - path = path.substring(0, path.lastIndexOf(`.${key}`)); + this._typeCheckNumberArray('restrictions.enabledHours', value, providedType); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.enabledHours', 0, 23); + return value; + case 'daysOfWeekDisabled': + if (value === undefined) { + return []; } - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - }; - spread(providedOptions, mergeTo, newOptions); + this._typeCheckNumberArray('restrictions.daysOfWeekDisabled', value, providedType); + if (value.filter((x) => x < 0 || x > 6).length > 0) + Namespace.errorMessages.numbersOutOfRage('restrictions.daysOfWeekDisabled', 0, 6); + return value; + case 'enabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray('restrictions.enabledDates', value, providedType, locale); + return value; + case 'disabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray('restrictions.disabledDates', value, providedType, locale); + return value; + case 'disabledTimeIntervals': + if (value === undefined) { + return []; + } + if (!Array.isArray(value)) { + Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }'); + } + const valueObject = value; + for (let i = 0; i < valueObject.length; i++) { + Object.keys(valueObject[i]).forEach((vk) => { + const subOptionName = `${key}[${i}].${vk}`; + let d = valueObject[i][vk]; + const dateTime = this.dateConversion(d, subOptionName); + if (!dateTime) { + Namespace.errorMessages.typeMismatch(subOptionName, typeof d, 'DateTime or Date'); + } + dateTime.setLocale(locale); + valueObject[i][vk] = dateTime; + }); + } + return valueObject; + case 'toolbarPlacement': + case 'type': + case 'viewMode': + const optionValues = { + toolbarPlacement: ['top', 'bottom', 'default'], + type: ['icons', 'sprites'], + viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + }; + const keyOptions = optionValues[key]; + if (!keyOptions.includes(value)) + Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions); + return value; + case 'meta': + case 'dayViewHeaderFormat': + return value; + case 'container': + if (value && + !(value instanceof HTMLElement || + value instanceof Element || + (value === null || value === void 0 ? void 0 : value.appendChild))) { + Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); + } + return value; + default: + switch (defaultType) { + case 'boolean': + return value === 'true' || value === true; + case 'number': + return +value; + case 'string': + return value.toString(); + case 'object': + return {}; + case 'function': + return value; + default: + Namespace.errorMessages.typeMismatch(path, providedType, defaultType); + } + } + } + static _mergeOptions(providedOptions, mergeTo) { + var _a; + const newOptions = {}; + //see if the options specify a locale + const locale = mergeTo.localization.locale !== 'default' + ? mergeTo.localization.locale + : ((_a = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.localization) === null || _a === void 0 ? void 0 : _a.locale) || 'default'; + OptionConverter.spread(providedOptions, mergeTo, newOptions, '', locale); return newOptions; } static _dataToOptions(element, options) { @@ -1270,11 +1472,16 @@ static getFlattenDefaultOptions() { if (this._flattenDefaults) return this._flattenDefaults; - const deepKeys = (t, pre = []) => Array.isArray(t) - ? [] - : Object(t) === t - ? Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])) - : pre.join('.'); + const deepKeys = (t, pre = []) => { + if (Array.isArray(t)) + return []; + if (Object(t) === t) { + return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); + } + else { + return pre.join('.'); + } + }; this._flattenDefaults = deepKeys(DefaultOptions); return this._flattenDefaults; } @@ -1301,175 +1508,8 @@ } } } - - class ServiceLocator { - constructor() { - this.cache = new Map(); - } - locate(identifier) { - const service = this.cache.get(identifier); - if (service) - return service; - const value = new identifier(); - this.cache.set(identifier, value); - return value; - } - } - const setupServiceLocator = () => { - serviceLocator = new ServiceLocator(); - }; - let serviceLocator; - - /** - * Main class for date validation rules based on the options provided. - */ - class Validation { - constructor() { - this.optionsStore = serviceLocator.locate(OptionsStore); - } - /** - * Checks to see if the target date is valid based on the rules provided in the options. - * Granularity can be provide to chek portions of the date instead of the whole. - * @param targetDate - * @param granularity - */ - isValid(targetDate, granularity) { - var _a; - if (this.optionsStore.options.restrictions.disabledDates.length > 0 && - this._isInDisabledDates(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.enabledDates.length > 0 && - !this._isInEnabledDates(targetDate)) { - return false; - } - if (granularity !== exports.Unit.month && - granularity !== exports.Unit.year && - ((_a = this.optionsStore.options.restrictions.daysOfWeekDisabled) === null || _a === void 0 ? void 0 : _a.length) > 0 && - this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1) { - return false; - } - if (this.optionsStore.options.restrictions.minDate && - targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) { - return false; - } - if (this.optionsStore.options.restrictions.maxDate && - targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) { - return false; - } - if (granularity === exports.Unit.hours || - granularity === exports.Unit.minutes || - granularity === exports.Unit.seconds) { - if (this.optionsStore.options.restrictions.disabledHours.length > 0 && - this._isInDisabledHours(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.enabledHours.length > 0 && - !this._isInEnabledHours(targetDate)) { - return false; - } - if (this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0) { - for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) { - if (targetDate.isBetween(disabledTimeIntervals.from, disabledTimeIntervals.to)) - return false; - } - } - } - return true; - } - /** - * Checks to see if the disabledDates option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInDisabledDates(testDate) { - if (!this.optionsStore.options.restrictions.disabledDates || - this.optionsStore.options.restrictions.disabledDates.length === 0) - return false; - const formattedDate = testDate.format(getFormatByUnit(exports.Unit.date)); - return this.optionsStore.options.restrictions.disabledDates - .map((x) => x.format(getFormatByUnit(exports.Unit.date))) - .find((x) => x === formattedDate); - } - /** - * Checks to see if the enabledDates option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by date. - * @param testDate - * @private - */ - _isInEnabledDates(testDate) { - if (!this.optionsStore.options.restrictions.enabledDates || - this.optionsStore.options.restrictions.enabledDates.length === 0) - return true; - const formattedDate = testDate.format(getFormatByUnit(exports.Unit.date)); - return this.optionsStore.options.restrictions.enabledDates - .map((x) => x.format(getFormatByUnit(exports.Unit.date))) - .find((x) => x === formattedDate); - } - /** - * Checks to see if the disabledHours option is in use and returns true (meaning invalid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInDisabledHours(testDate) { - if (!this.optionsStore.options.restrictions.disabledHours || - this.optionsStore.options.restrictions.disabledHours.length === 0) - return false; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.disabledHours.find((x) => x === formattedDate); - } - /** - * Checks to see if the enabledHours option is in use and returns true (meaning valid) - * if the `testDate` is with in the array. Granularity is by hours. - * @param testDate - * @private - */ - _isInEnabledHours(testDate) { - if (!this.optionsStore.options.restrictions.enabledHours || - this.optionsStore.options.restrictions.enabledHours.length === 0) - return true; - const formattedDate = testDate.hours; - return this.optionsStore.options.restrictions.enabledHours.find((x) => x === formattedDate); - } - } - - class EventEmitter { - constructor() { - this.subscribers = []; - } - subscribe(callback) { - this.subscribers.push(callback); - return this.unsubscribe.bind(this, this.subscribers.length - 1); - } - unsubscribe(index) { - this.subscribers.splice(index, 1); - } - emit(value) { - this.subscribers.forEach((callback) => { - callback(value); - }); - } - destory() { - this.subscribers = null; - this.subscribers = []; - } - } - class EventEmitters { - constructor() { - this.triggerEvent = new EventEmitter(); - this.viewUpdate = new EventEmitter(); - this.updateDisplay = new EventEmitter(); - this.action = new EventEmitter(); - } - destory() { - this.triggerEvent.destory(); - this.viewUpdate.destory(); - this.updateDisplay.destory(); - this.action.destory(); - } - } + OptionConverter.ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; + OptionConverter.isValue = a => a != null; // everything except undefined + null class Dates { constructor() { @@ -1520,6 +1560,13 @@ hour12: !components.useTwentyfourHour, }); } + /** + * parse the value into a DateTime object. + * this can be overwritten to supply your own parsing. + */ + parseInput(value) { + return OptionConverter.dateConversion(value, 'input'); + } /** * Tries to convert the provided value to a DateTime object. * If value is null|undefined then clear the value of the provided index (or 0). @@ -1531,7 +1578,7 @@ this.setValue(undefined, index); return; } - const converted = OptionConverter.dateConversion(value, 'input'); + const converted = this.parseInput(value); if (converted) { converted.setLocale(this.optionsStore.options.localization.locale); this.setValue(converted, index); @@ -3272,7 +3319,7 @@ setViewDate(); } catch (_a) { - console.warn('TD: Something went wrong trying to set the multidate values from the input field.'); + console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.'); } } else { @@ -3286,6 +3333,9 @@ * @private */ this._toggleClickEvent = () => { + var _a, _b; + if (((_a = this.optionsStore.element) === null || _a === void 0 ? void 0 : _a.disabled) || ((_b = this.optionsStore.input) === null || _b === void 0 ? void 0 : _b.disabled)) + return; this.toggle(); }; setupServiceLocator(); @@ -3519,37 +3569,38 @@ */ _initializeOptions(config, mergeTo, includeDataset = false) { var _a; - config = OptionConverter._mergeOptions(config, mergeTo); + let newConfig = OptionConverter.deepCopy(config); + newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); if (includeDataset) - config = OptionConverter._dataToOptions(this.optionsStore.element, config); - OptionConverter._validateConflicts(config); - config.viewDate = config.viewDate.setLocale(config.localization.locale); - if (!this.optionsStore.viewDate.isSame(config.viewDate)) { - this.optionsStore.viewDate = config.viewDate; + newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig); + OptionConverter._validateConflicts(newConfig); + newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale); + if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { + this.optionsStore.viewDate = newConfig.viewDate; } /** * Sets the minimum view allowed by the picker. For example the case of only * allowing year and month to be selected but not date. */ - if (config.display.components.year) { + if (newConfig.display.components.year) { this.optionsStore.minimumCalendarViewMode = 2; } - if (config.display.components.month) { + if (newConfig.display.components.month) { this.optionsStore.minimumCalendarViewMode = 1; } - if (config.display.components.date) { + if (newConfig.display.components.date) { this.optionsStore.minimumCalendarViewMode = 0; } this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode); // Update view mode if needed if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - config.display.viewMode) { - this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === config.display.viewMode), this.optionsStore.minimumCalendarViewMode); + newConfig.display.viewMode) { + this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode); } if ((_a = this.display) === null || _a === void 0 ? void 0 : _a.isVisible) { this.display._update('all'); } - this.optionsStore.options = config; + this.optionsStore.options = newConfig; } /** * Checks if an input field is being used, attempts to locate one and sets an diff --git a/dist/js/tempus-dominus.js.map b/dist/js/tempus-dominus.js.map index e0a77711a..00518c319 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/calendar-modes.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/options.ts","../../src/js/utilities/service-locator.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.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 * 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 let formatted =this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n if (formatted === '24') formatted = '00';\r\n return formatted;\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 invalide 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 * 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.`\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 version = '6.0.0-beta5',\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 of 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 most element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer most 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 most 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 most 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 most 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 most 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 most element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer most element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer most element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer most 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\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static version = version;\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","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 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: false\r\n },\r\n inline: false\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 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;","import { DateTime, DateTimeFormatOptions } from '../datetime';\r\nimport Namespace from './namespace';\r\nimport ViewMode from './view-mode';\r\nimport CalendarModes from './calendar-modes';\r\nimport DefaultOptions from './default-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\r\nexport default interface Options {\r\n restrictions?: {\r\n minDate?: DateTime;\r\n maxDate?: DateTime;\r\n enabledDates?: DateTime[];\r\n disabledDates?: DateTime[];\r\n enabledHours?: number[];\r\n disabledHours?: number[];\r\n disabledTimeIntervals?: { from: DateTime; to: DateTime }[];\r\n daysOfWeekDisabled?: number[];\r\n };\r\n display?: {\r\n toolbarPlacement?: 'top' | 'bottom';\r\n components?: {\r\n calendar?: boolean;\r\n date?: boolean;\r\n month?: boolean;\r\n year?: boolean;\r\n decades?: boolean;\r\n clock?: boolean;\r\n hours?: boolean;\r\n minutes?: boolean;\r\n seconds?: boolean;\r\n useTwentyfourHour?: boolean;\r\n };\r\n buttons?: { today?: boolean; close?: boolean; clear?: boolean };\r\n calendarWeeks?: boolean;\r\n icons?: {\r\n date?: string;\r\n next?: string;\r\n previous?: string;\r\n today?: string;\r\n clear?: string;\r\n time?: string;\r\n up?: string;\r\n type?: 'icons' | 'sprites';\r\n down?: string;\r\n close?: string;\r\n };\r\n viewMode: keyof ViewMode | undefined;\r\n sideBySide?: boolean;\r\n inline?: boolean;\r\n keepOpen?: boolean;\r\n };\r\n stepping?: number;\r\n useCurrent?: boolean;\r\n defaultDate?: DateTime;\r\n localization?: {\r\n nextMonth?: string;\r\n pickHour?: string;\r\n incrementSecond?: string;\r\n nextDecade?: string;\r\n selectDecade?: string;\r\n dayViewHeaderFormat?: DateTimeFormatOptions;\r\n decrementHour?: string;\r\n selectDate?: string;\r\n incrementHour?: string;\r\n previousCentury?: string;\r\n decrementSecond?: string;\r\n today?: string;\r\n previousMonth?: string;\r\n selectYear?: string;\r\n pickSecond?: string;\r\n nextCentury?: string;\r\n close?: string;\r\n incrementMinute?: string;\r\n selectTime?: string;\r\n clear?: string;\r\n toggleMeridiem?: string;\r\n selectMonth?: string;\r\n decrementMinute?: string;\r\n pickMinute?: string;\r\n nextYear?: string;\r\n previousYear?: string;\r\n previousDecade?: string;\r\n locale?: string;\r\n startOfTheWeek?: number;\r\n };\r\n keepInvalid?: boolean;\r\n debug?: boolean;\r\n allowInputToggle?: boolean;\r\n viewDate?: DateTime;\r\n multipleDates?: boolean;\r\n multipleDatesSeparator?: string;\r\n promptTimeOnDateChange?: boolean;\r\n promptTimeOnDateChangeTransitionDelay?: number;\r\n meta?: {};\r\n container?: HTMLElement;\r\n}\r\n\r\nexport class OptionConverter {\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newOptions = {} as Options;\r\n let path = '';\r\n const ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container'];\r\n\r\n //see if the options specify a locale\r\n const locale =\r\n mergeTo.localization.locale !== 'default'\r\n ? mergeTo.localization.locale\r\n : providedOptions?.localization?.locale || 'default';\r\n\r\n const processKey = (key, value, providedType, defaultType) => {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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 locale\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 locale\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);\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(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 const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\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 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.substring(1),\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\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 mergeOption Default option to compare types against\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n */\r\n const spread = (provided, mergeOption, copyTo) => {\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(mergeOption).includes(x)\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.substring(1)}.${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 Object.keys(mergeOption).forEach((key) => {\r\n const defaultOptionValue = mergeOption[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n if (!provided.hasOwnProperty(key)) {\r\n if (\r\n defaultType === 'undefined' ||\r\n (value?.length === 0 && Array.isArray(defaultOptionValue))\r\n ) {\r\n copyTo[key] = defaultOptionValue;\r\n return;\r\n }\r\n provided[key] = defaultOptionValue;\r\n value = provided[key];\r\n }\r\n path += `.${key}`;\r\n copyTo[key] = processKey(key, value, providedType, defaultType);\r\n\r\n if (\r\n typeof defaultOptionValue !== 'object' ||\r\n ignoreProperties.includes(key)\r\n ) {\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n if (!Array.isArray(provided[key])) {\r\n spread(provided[key], defaultOptionValue, copyTo[key]);\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n }\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n };\r\n spread(providedOptions, mergeTo, newOptions);\r\n\r\n return newOptions;\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 * @private\r\n */\r\n static _dateTypeCheck(d: any): 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 = new DateTime(d);\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 locale\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n locale: string = 'default'\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);\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(locale);\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 */\r\n static dateConversion(d: any, optionName: string): 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);\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 Array.isArray(t)\r\n ? []\r\n : Object(t) === t\r\n ? Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]))\r\n : pre.join('.');\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","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;","import { DateTime, getFormatByUnit, Unit } from './datetime';\r\nimport { OptionsStore } from './utilities/options';\r\nimport { serviceLocator } from './utilities/service-locator';\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 provide to chek 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 destory() {\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 destory() {\r\n this.triggerEvent.destory();\r\n this.viewUpdate.destory();\r\n this.updateDisplay.destory();\r\n this.action.destory();\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 { OptionConverter, OptionsStore } from './utilities/options';\r\nimport Validation from './validation';\r\nimport { serviceLocator } from './utilities/service-locator';\r\nimport { EventEmitters } from './utilities/event-emitter';\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 * 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 = OptionConverter.dateConversion(value, 'input');\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 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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 * 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 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.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 let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\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 { OptionsStore } from '../../utilities/options';\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\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 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.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 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 { OptionsStore } from '../../utilities/options';\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\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 { OptionsStore } from '../../utilities/options';\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\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 { OptionsStore } from '../../utilities/options';\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\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.minutesFormatted}`\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 { OptionsStore } from '../../utilities/options';\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\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse);\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 { createPopper } from '@popperjs/core';\r\nimport Namespace from '../utilities/namespace';\r\nimport { HideEvent } from '../utilities/event-types';\r\nimport Collapse from './collapse';\r\nimport { OptionsStore } from '../utilities/options';\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\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(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement) {\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 (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\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\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 (!onlyClock) {\r\n if (this._hasTime) {\r\n Collapse.hide(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\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\r\n this._popperInstance = createPopper(\r\n this.optionsStore.element,\r\n this.widget,\r\n {\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 }\r\n );\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._popperInstance.update();\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 /**\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 _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('http://www.w3.org/2000/svg', 'use');\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 {OptionsStore} from './utilities/options';\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\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.do(e, ActionTypes.showClock);\r\n this.display._update('clock');\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 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 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, { OptionConverter, OptionsStore } 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\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 config = OptionConverter._mergeOptions(config, mergeTo);\r\n if (includeDataset)\r\n config = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n config\r\n );\r\n\r\n OptionConverter._validateConflicts(config);\r\n\r\n config.viewDate = config.viewDate.setLocale(config.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(config.viewDate)) {\r\n this.optionsStore.viewDate = config.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 (config.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (config.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (config.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 config.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === config.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 this.optionsStore.options = config;\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;\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 multidate 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 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.$i) {\r\n // install plugin only once\r\n plugin.load(option, { TempusDominus, Dates, Display }, this);\r\n plugin.$i = true;\r\n }\r\n return this;\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,\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AAO,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;SAClB;QACD,OAAO,IAAI,CAAC;IACd;;;;;;;;;;;;;;;;"} \ 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 * 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 let formatted =this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n if (formatted === '24') formatted = '00';\r\n return formatted;\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 * 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.`\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 version = '6.0.0-beta7',\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 of 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 most element for the calendar view.\r\n */\r\n dateContainer = 'date-container';\r\n\r\n /**\r\n * The outer most 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 most 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 most 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 most 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 most 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 most element for the clock view.\r\n */\r\n clockContainer = `${this.timeContainer}-clock`;\r\n\r\n /**\r\n * The outer most element for the hours selection view.\r\n */\r\n hourContainer = `${this.timeContainer}-hour`;\r\n\r\n /**\r\n * The outer most element for the minutes selection view.\r\n */\r\n minuteContainer = `${this.timeContainer}-minute`;\r\n\r\n /**\r\n * The outer most 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\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static version = version;\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;","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 provide to chek 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 destory() {\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 destory() {\r\n this.triggerEvent.destory();\r\n this.viewUpdate.destory();\r\n this.updateDisplay.destory();\r\n this.action.destory();\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: false\r\n },\r\n inline: false\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 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;","import Namespace from \"./namespace\";\r\nimport {DateTime} from \"../datetime\";\r\nimport DefaultOptions from \"./default-options\";\r\nimport Options from \"./options\";\r\n\r\nexport class OptionConverter {\r\n\r\n private static ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container'];\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 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 mergeOption Default option to compare types against\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param locale\r\n */\r\n static spread(provided, mergeOption, copyTo, path = '', locale = '') {\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(mergeOption).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(mergeOption).forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = OptionConverter.objectPath(path, DefaultOptions);\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (!provided.hasOwnProperty(key)) {\r\n if (\r\n defaultType === 'undefined' ||\r\n (value?.length === 0 && Array.isArray(defaultOptionValue))\r\n ) {\r\n copyTo[key] = defaultOptionValue;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n provided[key] = defaultOptionValue;\r\n value = provided[key];\r\n }\r\n\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n\r\n if (\r\n typeof defaultOptionValue !== 'object' ||\r\n defaultOptionValue instanceof Date ||\r\n OptionConverter.ignoreProperties.includes(key)\r\n ) {\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (!Array.isArray(provided[key])) {\r\n OptionConverter.spread(provided[key], defaultOptionValue, copyTo[key], path, locale);\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, locale) {\r\n switch (key) {\r\n case 'defaultDate': {\r\n const dateTime = this.dateConversion(value, 'defaultDate');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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');\r\n if (dateTime !== undefined) {\r\n dateTime.setLocale(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 locale\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 locale\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);\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(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 const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\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 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 newOptions = {} as Options;\r\n\r\n //see if the options specify a locale\r\n const locale =\r\n mergeTo.localization.locale !== 'default'\r\n ? mergeTo.localization.locale\r\n : providedOptions?.localization?.locale || 'default';\r\n\r\n OptionConverter.spread(providedOptions, mergeTo, newOptions, '', locale);\r\n\r\n return newOptions;\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 * @private\r\n */\r\n static _dateTypeCheck(d: any): 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 = new DateTime(d);\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 locale\r\n */\r\n static _typeCheckDateArray(\r\n optionName: string,\r\n value,\r\n providedType: string,\r\n locale: string = 'default'\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);\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(locale);\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 */\r\n static dateConversion(d: any, optionName: string): 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);\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');\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 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.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 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 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.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 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 * 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 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.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 let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\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 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.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 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.minutesFormatted}`\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\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 * 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 target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse);\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 { createPopper } from '@popperjs/core';\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(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement) {\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 (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\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\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 (!onlyClock) {\r\n if (this._hasTime) {\r\n Collapse.hide(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\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\r\n this._popperInstance = createPopper(\r\n this.optionsStore.element,\r\n this.widget,\r\n {\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 }\r\n );\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._popperInstance.update();\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 /**\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 _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('http://www.w3.org/2000/svg', 'use');\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.do(e, ActionTypes.showClock);\r\n this.display._update('clock');\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 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 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\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 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;\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.$i) {\r\n // install plugin only once\r\n plugin.load(option, { TempusDominus, Dates, Display }, this);\r\n plugin.$i = true;\r\n }\r\n return this;\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 Options,\r\n Unit,\r\n DateTimeFormatOptions,\r\n};\r\n"],"names":["Unit","ActionTypes","SecondDisplay","createPopper"],"mappings":";;;;;;;;;;;AAAYA;IAAZ,WAAY,IAAI;QACd,2BAAmB,CAAA;QACnB,2BAAmB,CAAA;QACnB,uBAAe,CAAA;QACf,qBAAa,CAAA;QACb,uBAAe,CAAA;QACf,qBAAa,CAAA;IACf,CAAC,EAPWA,YAAI,KAAJA,YAAI,QAOf;IAED,MAAM,gBAAgB,GAAG;QACvB,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,IAAI;KACb,CAAA;IAED,MAAM,0BAA0B,GAAG;QACjC,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,KAAK;KACd,CAAA;IAQM,MAAM,eAAe,GAAG,CAAC,IAAU;QACxC,QAAQ,IAAI;YACV,KAAK,MAAM;gBACT,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;YAChC,KAAK,OAAO;gBACV,OAAO;oBACL,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,SAAS;iBAChB,CAAC;YACJ,KAAK,MAAM;gBACT,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;SAC9B;IACH,CAAC,CAAC;IAEF;;;;UAIa,QAAS,SAAQ,IAAI;QAAlC;;;;;YAIE,WAAM,GAAG,SAAS,CAAC;YA4bX,kBAAa,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GA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;;;;IAIA,MAAM,aAAa,GAAG,EAAE,CAAC;IAEzB;IACA;;;;UAIM,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAO;QAClC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;IACzC,EAAE;IAEF;;;;;UAKM,MAAM,GAAG,CAAC,CAAS;QACvB,IAAI,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;IACtC,EAAE;IAEF;IACA;;;;;UAKM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM;QACrC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;;YAEd,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;SAClB;QACD,OAAO,IAAI,CAAC;IACd;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.min.js b/dist/js/tempus-dominus.min.js index 3f2d01523..f1df96ddc 100644 --- a/dist/js/tempus-dominus.min.js +++ b/dist/js/tempus-dominus.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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,require("@popperjs/core")):"function"==typeof define&&define.amd?define(["exports","@popperjs/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={},t.Popper)}(this,(function(t,e){"use strict";var s;t.Unit=void 0,(s=t.Unit||(t.Unit={})).seconds="seconds",s.minutes="minutes",s.hours="hours",s.date="date",s.month="month",s.year="year";const i={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},o={hour:"2-digit",hour12:!1},n=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)}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],n=")"===i[1];return(o?this.isAfter(t,s):!this.isBefore(t,s))&&(n?this.isBefore(e,s):!this.isAfter(e,s))||(o?this.isBefore(t,s):!this.isAfter(t,s))&&(n?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,i).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,i).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){let t=this.parts(void 0,o).hour;return"24"===t&&(t="00"),t}get twelveHoursFormatted(){return this.parts(void 0,i).hour}meridiem(t=this.locale){var e;return null===(e=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type)))||void 0===e?void 0:e.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,i).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,i).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 r extends Error{}const d="tempus-dominus";class l{}l.NAME=d,l.version="6.0.0-beta5.1",l.dataKey="td",l.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}`}},l.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"}},l.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new r(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new r(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new r(`${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 r(`${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 r(`${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 r(`${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 r(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new r(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new r(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string.`)}throwError(t){const e=new r(`${this.base} ${t}`);throw e.code=9,e}};const c=[{name:"calendar",className:l.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:l.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:l.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:l.css.decadesContainer,unit:t.Unit.year,step:100}],h={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:!1},inline:!1},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},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new a,multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,meta:{},container:void 0};class p{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=c[t].name}refreshCurrentView(){this.currentView=c[this.currentCalendarViewMode].name}}class u{static _mergeOptions(t,e){var s;const i={};let o="";const n=["meta","dayViewHeaderFormat","container"],a="default"!==e.localization.locale?e.localization.locale:(null===(s=null==t?void 0:t.localization)||void 0===s?void 0:s.locale)||"default",r=(t,e,s,i)=>{switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate");if(void 0!==t)return t.setLocale(a),t;l.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&&l.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&&l.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&&l.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)||l.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);r||l.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"]}[t];return r.includes(e)||l.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||(null==e?void 0:e.appendChild))&&l.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;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:l.errorMessages.typeMismatch(o.substring(1),s,i)}}},d=(t,e,s)=>{const i=Object.keys(t).filter((t=>!Object.keys(e).includes(t)));if(i.length>0){const t=u.getFlattenDefaultOptions(),e=i.map((e=>{let s=`"${o.substring(1)}.${e}" in not a known option.`,i=t.find((t=>t.includes(e)));return i&&(s+=`Did you mean "${i}"?`),s}));l.errorMessages.unexpectedOptions(e)}Object.keys(e).forEach((i=>{const a=e[i];let l=typeof t[i],c=typeof a,h=t[i];if(!t.hasOwnProperty(i)){if("undefined"===c||0===(null==h?void 0:h.length)&&Array.isArray(a))return void(s[i]=a);t[i]=a,h=t[i]}o+=`.${i}`,s[i]=r(i,h,l,c),"object"!=typeof a||n.includes(i)||Array.isArray(t[i])||(d(t[i],a,s[i]),o=o.substring(0,o.lastIndexOf(`.${i}`))),o=o.substring(0,o.lastIndexOf(`.${i}`))}))};return d(t,e,i),i}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if((null==s?void 0:s.tdTargetInput)&&delete s.tdTargetInput,(null==s?void 0: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},n=(t,e,s,i)=>{const a=o(s)[t[e].toLowerCase()],r={};return void 0===a||(s[a].constructor===Object?(e++,r[a]=n(t,e,s[a],i)):r[a]=i),r},a=o(e);return Object.keys(s).filter((t=>t.startsWith(l.dataKey))).map((t=>t.substring(2))).forEach((t=>{let o=a[t.toLowerCase()];if(t.includes("_")){const r=t.split("_");o=a[r[0].toLowerCase()],void 0!==o&&e[o].constructor===Object&&(i[o]=n(r,1,e[o],s[`td${t}`]))}else void 0!==o&&(i[o]=s[`td${t}`])})),this._mergeOptions(i,e)}static _dateTypeCheck(t){if(t.constructor.name===a.name)return t;if(t.constructor.name===Date.name)return a.convert(t);if("string"==typeof t){const e=new a(t);return"null"===JSON.stringify(e)?null:e}return null}static _typeCheckDateArray(t,e,s,i="default"){Array.isArray(e)||l.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||l.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e){"string"==typeof t&&"input"!==e&&l.errorMessages.dateString();const s=this._dateTypeCheck(t);return s||l.errorMessages.failedToParseDate(e,t,"input"===e),s}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(h),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||l.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)&&l.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&l.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}class m{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 y;class v{constructor(){this.optionsStore=y.locate(p)}isValid(e,s){var i;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&&(null===(i=this.optionsStore.options.restrictions.daysOfWeekDisabled)||void 0===i?void 0:i.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(n(t.Unit.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(n(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(n(t.Unit.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(n(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 g{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)}))}destory(){this.subscribers=null,this.subscribers=[]}}class S{constructor(){this.triggerEvent=new g,this.viewUpdate=new g,this.updateDisplay=new g,this.action=new g}destory(){this.triggerEvent.destory(),this.viewUpdate.destory(),this.updateDisplay.destory(),this.action.destory()}}class b{constructor(){this._dates=[],this.optionsStore=y.locate(p),this.validation=y.locate(v),this._eventEmitters=y.locate(S)}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}):""}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=u.dateConversion(t,"input");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=n(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=n(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:l.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 n=()=>{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&&(null==o?void 0:o.isSame(t)))n();else{if(!t)return!this.optionsStore.options.multipleDates||1===this._dates.length||i?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),n(),this._eventEmitters.triggerEvent.emit({type:l.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,n(),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),void this._eventEmitters.triggerEvent.emit({type:l.events.change,date:t,oldDate:o,isClear:i,isValid:!0});this.optionsStore.options.keepInvalid&&(this._dates[e]=t,this.optionsStore.viewDate=t.clone,n(),this._eventEmitters.triggerEvent.emit({type:l.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:l.events.error,reason:l.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 w=f;class D{constructor(){this.optionsStore=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");if(t.classList.add(l.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(l.css.calendarWeeks,l.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(l.css.calendarWeeks,l.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",w.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.daysContainer)[0],[o,n,r]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");n.setAttribute(l.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?r.classList.remove(l.css.disabled):r.classList.add(l.css.disabled);let d=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${w.selectDay}"], .${l.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(l.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${d.week}`)}let i=[];i.push(l.css.day),d.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.old),d.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.new),!this.optionsStore.unset&&this.dates.isPicked(d,t.Unit.date)&&i.push(l.css.active),this.validation.isValid(d,t.Unit.date)||i.push(l.css.disabled),d.isSame(new a,t.Unit.date)&&i.push(l.css.today),0!==d.weekDay&&6!==d.weekDay||i.push(l.css.weekend),s(t.Unit.date,d,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${d.year}-${d.monthFormatted}-${d.dateFormatted}`),e.setAttribute("data-day",`${d.date}`),e.innerText=d.format({day:"numeric"}),d.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(l.css.calendarWeeks,l.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(l.css.dayOfTheWeek,l.css.noHighlight),i.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(i)}return s}}class _{constructor(){this.optionsStore=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.monthsContainer)[0],[o,n,a]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");n.setAttribute(l.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?a.classList.remove(l.css.disabled):a.classList.add(l.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${w.selectMonth}"]`).forEach(((e,i)=>{let o=[];o.push(l.css.month),!this.optionsStore.unset&&this.dates.isPicked(r,t.Unit.month)&&o.push(l.css.active),this.validation.isValid(r,t.Unit.month)||o.push(l.css.disabled),s(t.Unit.month,r,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${i}`),e.innerText=`${r.format({month:"short"})}`,r.manipulate(1,t.Unit.month)}))}}class k{constructor(){this.optionsStore=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.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(l.css.yearsContainer)[0],[o,n,a]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");n.setAttribute(l.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.validation.isValid(this._startYear,t.Unit.year)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?a.classList.remove(l.css.disabled):a.classList.add(l.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${w.selectYear}"]`).forEach((e=>{let i=[];i.push(l.css.year),!this.optionsStore.unset&&this.dates.isPicked(r,t.Unit.year)&&i.push(l.css.active),this.validation.isValid(r,t.Unit.year)||i.push(l.css.disabled),s(t.Unit.year,r,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${r.year}`),e.innerText=r.format({year:"numeric"}),r.manipulate(1,t.Unit.year)}))}}class C{constructor(){this.optionsStore=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=b.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 n=e.getElementsByClassName(l.css.decadesContainer)[0],[a,r,d]=n.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");r.setAttribute(l.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?a.classList.remove(l.css.disabled):a.classList.add(l.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?d.classList.remove(l.css.disabled):d.classList.add(l.css.disabled);const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${w.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(l.css.old),this._startDecade.year-10<0?(e.textContent=" ",a.classList.add(l.css.disabled),e.classList.add(l.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(l.css.decade);const n=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=r)).length>0&&o.push(l.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 E{constructor(){this._gridColumns="",this.optionsStore=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v)}getPicker(t){const e=document.createElement("div");return e.classList.add(l.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(l.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(l.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=${w.incrementHours}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${w.decrementHours}]`).classList.add(l.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=${w.incrementMinutes}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${w.decrementMinutes}]`).classList.add(l.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=${w.incrementSeconds}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${w.decrementSeconds}]`).classList.add(l.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=${w.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(l.css.disabled):e.classList.add(l.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],i=[],o=[],n=document.createElement("div"),a=e(this.optionsStore.options.display.icons.up),r=e(this.optionsStore.options.display.icons.down);n.classList.add(l.css.separator,l.css.noHighlight);const d=n.cloneNode(!0);d.innerHTML=":";const c=(t=!1)=>t?d.cloneNode(!0):n.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",w.incrementHours),e.appendChild(a.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",w.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",w.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(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",w.incrementMinutes),e.appendChild(a.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",w.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",w.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(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",w.incrementSeconds),e.appendChild(a.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",w.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",w.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",w.toggleMeridiem),e.setAttribute("tabindex","-1"),l.css.toggleMeridiem.includes(",")?e.classList.add(...l.css.toggleMeridiem.split(",")):e.classList.add(l.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(l.css.noHighlight),t.appendChild(e),i.push(t),t=c(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class M{constructor(){this.optionsStore=y.locate(p),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.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",w.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${w.selectHour}"]`).forEach((e=>{let i=[];i.push(l.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(l.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=y.locate(p),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.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",w.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.minuteContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;i.querySelectorAll(`[data-action="${w.selectMinute}"]`).forEach((e=>{let i=[];i.push(l.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(l.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutesFormatted}`),e.innerText=o.minutesFormatted,o.manipulate(n,t.Unit.minutes)}))}}class T{constructor(){this.optionsStore=y.locate(p),this.validation=y.locate(v)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${w.selectSecond}"]`).forEach((e=>{let i=[];i.push(l.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(l.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(l.css.show)?this.hide(t):this.show(t)}static show(t){if(t.classList.contains(l.css.collapsing)||t.classList.contains(l.css.show))return;t.style.height="0",t.classList.remove(l.css.collapse),t.classList.add(l.css.collapsing),setTimeout((()=>{t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse,l.css.show),t.style.height=""}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hide(t){if(t.classList.contains(l.css.collapsing)||!t.classList.contains(l.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(l.css.collapse,l.css.show),t.classList.add(l.css.collapsing),t.style.height="",setTimeout((()=>{t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse)}),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=>{var e;this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||(null===(e=t.composedPath())||void 0===e?void 0:e.includes(this.optionsStore.element))||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=y.locate(p),this.validation=y.locate(v),this.dates=y.locate(b),this.dateDisplay=y.locate(D),this.monthDisplay=y.locate(_),this.yearDisplay=y.locate(k),this.decadeDisplay=y.locate(C),this.timeDisplay=y.locate(E),this.hourDisplay=y.locate(M),this.minuteDisplay=y.locate(L),this.secondDisplay=y.locate(T),this._eventEmitters=y.locate(S),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(){var s,i;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 i=0,o=1;for((null===(s=this.optionsStore.options.restrictions.maxDate)||void 0===s?void 0:s.isBefore(e))&&(o=-1);!(this.validation.isValid(e)||(e.manipulate(o,t.Unit.date),i>31));)i++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:w.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||(this._hasTime&&U.hide(this.widget.querySelector(`div.${l.css.timeContainer}`)),U.show(this.widget.querySelector(`div.${l.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{((null===(i=this.optionsStore.options)||void 0===i?void 0:i.container)||document.body).appendChild(this.widget),this._popperInstance=e.createPopper(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"})}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:w.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(l.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(l.css.show),this.optionsStore.options.display.inline||(this._popperInstance.update(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:l.events.show}),this._isVisible=!0}_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(`.${l.css.dateContainer} > div:not(.${l.css.calendarHeader}), .${l.css.timeContainer} > div:not(.${l.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=c[this.optionsStore.currentCalendarViewMode];let s=this.widget.querySelector(`.${e.className}`);switch(e.className){case l.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case l.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case l.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case l.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${l.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(l.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case l.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case l.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 l.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 l.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(l.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:l.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(l.css.widget);const e=document.createElement("div");e.classList.add(l.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(l.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(l.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(l.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(l.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(l.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(l.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(l.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(l.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",w.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",w.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",w.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",w.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(l.css.calendarHeader);const e=document.createElement("div");e.classList.add(l.css.previous),e.setAttribute("data-action",w.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(l.css.switch),s.setAttribute("data-action",w.changeCalendarView);const i=document.createElement("div");return i.classList.add(l.css.next),i.setAttribute("data-action",w.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=y.locate(p),this.dates=y.locate(b),this.validation=y.locate(v),this.display=y.locate(A),this._eventEmitters=y.locate(S),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){var i,o;const n=null==e?void 0:e.currentTarget;if(null===(i=null==n?void 0:n.classList)||void 0===i?void 0:i.contains(l.css.disabled))return!1;s=s||(null===(o=null==n?void 0:n.dataset)||void 0===o?void 0:o.action);const r=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case w.next:case w.previous:this.handleNextPrevious(s);break;case w.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case w.selectMonth:case w.selectYear:case w.selectDecade:const i=+n.dataset.value;switch(s){case w.selectMonth:this.optionsStore.viewDate.month=i;break;case w.selectYear:case w.selectDecade:this.optionsStore.viewDate.year=i}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 w.selectDay:const o=this.optionsStore.viewDate.clone;n.classList.contains(l.css.old)&&o.manipulate(-1,t.Unit.month),n.classList.contains(l.css.new)&&o.manipulate(1,t.Unit.month),o.date=+n.dataset.day;let d=0;this.optionsStore.options.multipleDates?(d=this.dates.pickedIndex(o,t.Unit.date),-1!==d?this.dates.setValue(null,d):this.dates.setValue(o,this.dates.lastPickedIndex+1)):this.dates.setValue(o,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 w.selectHour:let c=+n.dataset.value;r.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(c+=12),r.hours=c,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.selectMinute:r.minutes=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.selectSecond:r.seconds=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.incrementHours:this.manipulateAndSet(r,t.Unit.hours);break;case w.incrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,this.optionsStore.options.stepping);break;case w.incrementSeconds:this.manipulateAndSet(r,t.Unit.seconds);break;case w.decrementHours:this.manipulateAndSet(r,t.Unit.hours,-1);break;case w.decrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case w.decrementSeconds:this.manipulateAndSet(r,t.Unit.seconds,-1);break;case w.toggleMeridiem:this.manipulateAndSet(r,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case w.togglePicker:n.getAttribute("title")===this.optionsStore.options.localization.selectDate?(n.setAttribute("title",this.optionsStore.options.localization.selectTime),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(n.setAttribute("title",this.optionsStore.options.localization.selectDate),n.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.do(e,w.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${l.css.dateContainer}, .${l.css.timeContainer}`).forEach((t=>U.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case w.showClock:case w.showHours:case w.showMinutes:case w.showSeconds:this.handleShowClockContainers(s);break;case w.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case w.close:this.display.hide();break;case w.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 l.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${l.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case w.showClock:s=l.css.clockContainer,this.display._update("clock");break;case w.showHours:s=l.css.hourContainer,this.display._update(t.Unit.hours);break;case w.showMinutes:s=l.css.minuteContainer,this.display._update(t.Unit.minutes);break;case w.showSeconds:s=l.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=c[this.optionsStore.currentCalendarViewMode];t===w.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,w.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=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked)},s=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=s.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.toggle()},y=new m,this._eventEmitters=y.locate(S),this.optionsStore=y.locate(p),this.display=y.locate(A),this.dates=y.locate(b),this.actions=y.locate($),t||l.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,h,!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,h):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(){var t;this._isDisabled=!0,null===(t=this.optionsStore.input)||void 0===t||t.setAttribute("disabled","disabled"),this.display.hide()}enable(){var t;this._isDisabled=!1,null===(t=this.optionsStore.input)||void 0===t||t.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&&l.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:l.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){var i;t=u._mergeOptions(t,e),s&&(t=u._dataToOptions(this.optionsStore.element,t)),u._validateConflicts(t),t.viewDate=t.viewDate.setLocale(t.localization.locale),this.optionsStore.viewDate.isSame(t.viewDate)||(this.optionsStore.viewDate=t.viewDate),t.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),t.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),t.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),c[this.optionsStore.currentCalendarViewMode].name!==t.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(c.findIndex((e=>e.name===t.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),this.optionsStore.options=t}_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){var e,s;!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||(null===(e=this.display.widget)||void 0===e?void 0:e.getElementsByClassName(l.css.show)[0].classList.contains(l.css.timeContainer))||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&(null===(s=t.date)||void 0===s?void 0:s.isSame(t.oldDate))||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${l.css.switch} div`)},action:w.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const H={};t.DateTime=a,t.DefaultOptions=h,t.Namespace=l,t.TempusDominus=O,t.extend=function(t,e){return t.$i||(t.load(e,{TempusDominus:O,Dates:b,Display:A},this),t.$i=!0),this},t.loadLocale=t=>{H[t.name]||(H[t.name]=t.localization)},t.locale=t=>{let e=H[t];e&&(h.localization=e)},Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@popperjs/core")):"function"==typeof define&&define.amd?define(["exports","@popperjs/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={},t.Popper)}(this,(function(t,e){"use strict";var s;t.Unit=void 0,(s=t.Unit||(t.Unit={})).seconds="seconds",s.minutes="minutes",s.hours="hours",s.date="date",s.month="month",s.year="year";const i={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},o={hour:"2-digit",hour12:!1},a=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}};class n 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 n(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocale(e)}get clone(){return new n(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=n.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,i).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,i).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}get hoursFormatted(){let t=this.parts(void 0,o).hour;return"24"===t&&(t="00"),t}get twelveHoursFormatted(){return this.parts(void 0,i).hour}meridiem(t=this.locale){var e;return null===(e=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type)))||void 0===e?void 0:e.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,i).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,i).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 r extends Error{}const d="tempus-dominus";class l{}l.NAME=d,l.version="6.0.0-beta7",l.dataKey="td",l.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}`}},l.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"}},l.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const e=new r(`${this.base} Unexpected option: ${t} does not match a known option.`);throw e.code=1,e}unexpectedOptions(t){const e=new r(`${this.base}: ${t.join(", ")}`);throw e.code=1,e}unexpectedOptionValue(t,e,s){const i=new r(`${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 r(`${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 r(`${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 r(`${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 r(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new r(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const e=new r(`${this.base} A configuration value conflicts with another rule. ${t}`);throw e.code=8,e}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string.`)}throwError(t){const e=new r(`${this.base} ${t}`);throw e.code=9,e}};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 h;const p=[{name:"calendar",className:l.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:l.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:l.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:l.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this.viewDate=new n,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){var i;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&&(null===(i=this.optionsStore.options.restrictions.daysOfWeekDisabled)||void 0===i?void 0:i.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(a(t.Unit.date));return this.optionsStore.options.restrictions.disabledDates.map((e=>e.format(a(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(a(t.Unit.date));return this.optionsStore.options.restrictions.enabledDates.map((e=>e.format(a(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)}))}destory(){this.subscribers=null,this.subscribers=[]}}class v{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y}destory(){this.triggerEvent.destory(),this.viewUpdate.destory(),this.updateDisplay.destory(),this.action.destory()}}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:!1},inline:!1},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},keepInvalid:!1,debug:!1,allowInputToggle:!1,viewDate:new n,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.split(".").reduce(((t,e)=>S.isValue(t)||S.isValue(t[e])?t[e]:void 0),e)}static spread(t,e,s,i="",o=""){const a=Object.keys(t).filter((t=>!Object.keys(e).includes(t)));if(a.length>0){const t=S.getFlattenDefaultOptions(),e=a.map((e=>{let s=`"${i}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(s+=`Did you mean "${o}"?`),s}));l.errorMessages.unexpectedOptions(e)}Object.keys(e).forEach((e=>{"."===(i+=`.${e}`).charAt(0)&&(i=i.slice(1));const a=S.objectPath(i,g);let n=typeof t[e],r=typeof a,d=t[e];if(!t.hasOwnProperty(e)){if("undefined"===r||0===(null==d?void 0:d.length)&&Array.isArray(a))return s[e]=a,void(i=i.substring(0,i.lastIndexOf(`.${e}`)));t[e]=a,d=t[e]}s[e]=S.processKey(e,d,n,r,i,o),"object"!=typeof a||a instanceof Date||S.ignoreProperties.includes(e)||Array.isArray(t[e])||S.spread(t[e],a,s[e],i,o),i=i.substring(0,i.lastIndexOf(`.${e}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("defaultDate",s,"DateTime or Date");break}case"viewDate":{const t=this.dateConversion(e,"viewDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("viewDate",s,"DateTime or Date");break}case"minDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.minDate");if(void 0!==t)return t.setLocale(a),t;l.errorMessages.typeMismatch("restrictions.minDate",s,"DateTime or Date");break}case"maxDate":{if(void 0===e)return e;const t=this.dateConversion(e,"restrictions.maxDate");if(void 0!==t)return t.setLocale(a),t;l.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&&l.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&&l.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&&l.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)||l.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);r||l.errorMessages.typeMismatch(i,typeof o,"DateTime or Date"),r.setLocale(a),n[e][s]=r}));return n;case"toolbarPlacement":case"type":case"viewMode":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"]}[t];return r.includes(e)||l.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||(null==e?void 0:e.appendChild))&&l.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;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:l.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){var s;const i={},o="default"!==e.localization.locale?e.localization.locale:(null===(s=null==t?void 0:t.localization)||void 0===s?void 0:s.locale)||"default";return S.spread(t,e,i,"",o),i}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if((null==s?void 0:s.tdTargetInput)&&delete s.tdTargetInput,(null==s?void 0: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(l.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){if(t.constructor.name===n.name)return t;if(t.constructor.name===Date.name)return n.convert(t);if("string"==typeof t){const e=new n(t);return"null"===JSON.stringify(e)?null:e}return null}static _typeCheckDateArray(t,e,s,i="default"){Array.isArray(e)||l.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||l.errorMessages.typeMismatch(t,s,"array of numbers")}static dateConversion(t,e){"string"==typeof t&&"input"!==e&&l.errorMessages.dateString();const s=this._dateTypeCheck(t);return s||l.errorMessages.failedToParseDate(e,t,"input"===e),s}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)||l.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)&&l.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&l.errorMessages.conflictingConfiguration("maxDate is before minDate"))}}S.ignoreProperties=["meta","dayViewHeaderFormat","container"],S.isValue=t=>null!=t;class b{constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(v)}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")}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=a(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=a(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:l.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&&(null==o?void 0: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:l.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:l.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:l.events.change,date:t,oldDate:o,isClear:i,isValid:!1})),this._eventEmitters.triggerEvent.emit({type:l.events.error,reason:l.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 w=f;class D{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(b),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(l.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(l.css.calendarWeeks,l.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(l.css.calendarWeeks,l.css.noHighlight),t.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-action",w.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.daysContainer)[0],[o,a,r]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(l.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?r.classList.remove(l.css.disabled):r.classList.add(l.css.disabled);let d=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${w.selectDay}"], .${l.css.calendarWeeks}`).forEach((e=>{if(this.optionsStore.options.display.calendarWeeks&&e.classList.contains(l.css.calendarWeeks)){if("#"===e.innerText)return;return void(e.innerText=`${d.week}`)}let i=[];i.push(l.css.day),d.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.old),d.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.new),!this.optionsStore.unset&&this.dates.isPicked(d,t.Unit.date)&&i.push(l.css.active),this.validation.isValid(d,t.Unit.date)||i.push(l.css.disabled),d.isSame(new n,t.Unit.date)&&i.push(l.css.today),0!==d.weekDay&&6!==d.weekDay||i.push(l.css.weekend),s(t.Unit.date,d,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${d.year}-${d.monthFormatted}-${d.dateFormatted}`),e.setAttribute("data-day",`${d.date}`),e.innerText=d.format({day:"numeric"}),d.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(l.css.calendarWeeks,l.css.noHighlight),t.innerText="#",s.push(t)}for(let i=0;i<7;i++){const i=document.createElement("div");i.classList.add(l.css.dayOfTheWeek,l.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(b),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.monthsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(l.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?n.classList.remove(l.css.disabled):n.classList.add(l.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${w.selectMonth}"]`).forEach(((e,i)=>{let o=[];o.push(l.css.month),!this.optionsStore.unset&&this.dates.isPicked(r,t.Unit.month)&&o.push(l.css.active),this.validation.isValid(r,t.Unit.month)||o.push(l.css.disabled),s(t.Unit.month,r,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${i}`),e.innerText=`${r.format({month:"short"})}`,r.manipulate(1,t.Unit.month)}))}}class _{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(b),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.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(l.css.yearsContainer)[0],[o,a,n]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");a.setAttribute(l.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.validation.isValid(this._startYear,t.Unit.year)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?n.classList.remove(l.css.disabled):n.classList.add(l.css.disabled);let r=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${w.selectYear}"]`).forEach((e=>{let i=[];i.push(l.css.year),!this.optionsStore.unset&&this.dates.isPicked(r,t.Unit.year)&&i.push(l.css.active),this.validation.isValid(r,t.Unit.year)||i.push(l.css.disabled),s(t.Unit.year,r,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${r.year}`),e.innerText=r.format({year:"numeric"}),r.manipulate(1,t.Unit.year)}))}}class C{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(b),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=b.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(l.css.decadesContainer)[0],[n,r,d]=a.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");r.setAttribute(l.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?n.classList.remove(l.css.disabled):n.classList.add(l.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?d.classList.remove(l.css.disabled):d.classList.add(l.css.disabled);const c=this.dates.picked.map((t=>t.year));a.querySelectorAll(`[data-action="${w.selectDecade}"]`).forEach(((e,i)=>{if(0===i)return e.classList.add(l.css.old),this._startDecade.year-10<0?(e.textContent=" ",n.classList.add(l.css.disabled),e.classList.add(l.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(l.css.decade);const a=this._startDecade.year,r=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=a&&t<=r)).length>0&&o.push(l.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 E{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate(b),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(l.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(l.css.clockContainer)[0],i=(this.dates.lastPicked||this.optionsStore.viewDate).clone;if(s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(l.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=${w.incrementHours}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${w.decrementHours}]`).classList.add(l.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=${w.incrementMinutes}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${w.decrementMinutes}]`).classList.add(l.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=${w.incrementSeconds}]`).classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${w.decrementSeconds}]`).classList.add(l.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=${w.toggleMeridiem}]`);e.innerText=i.meridiem(),this.validation.isValid(i.clone.manipulate(i.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(l.css.disabled):e.classList.add(l.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(l.css.separator,l.css.noHighlight);const d=a.cloneNode(!0);d.innerHTML=":";const c=(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",w.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",w.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",w.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(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",w.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",w.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",w.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(c()),i.push(c(!0)),o.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",w.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",w.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",w.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",w.toggleMeridiem),e.setAttribute("tabindex","-1"),l.css.toggleMeridiem.includes(",")?e.classList.add(...l.css.toggleMeridiem.split(",")):e.classList.add(l.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(l.css.noHighlight),t.appendChild(e),i.push(t),t=c(),o.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...i,...o]}}class M{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.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",w.selectHour),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.hourContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.date);i.querySelectorAll(`[data-action="${w.selectHour}"]`).forEach((e=>{let i=[];i.push(l.css.hour),this.validation.isValid(o,t.Unit.hours)||i.push(l.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(l.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",w.selectMinute),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.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="${w.selectMinute}"]`).forEach((e=>{let i=[];i.push(l.css.minute),this.validation.isValid(o,t.Unit.minutes)||i.push(l.css.disabled),s(t.Unit.minutes,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.minutesFormatted}`),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(l.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",w.selectSecond),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.secondContainer)[0];let o=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);i.querySelectorAll(`[data-action="${w.selectSecond}"]`).forEach((e=>{let i=[];i.push(l.css.second),this.validation.isValid(o,t.Unit.seconds)||i.push(l.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(l.css.show)?this.hide(t):this.show(t)}static show(t){if(t.classList.contains(l.css.collapsing)||t.classList.contains(l.css.show))return;t.style.height="0",t.classList.remove(l.css.collapse),t.classList.add(l.css.collapsing),setTimeout((()=>{t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse,l.css.show),t.style.height=""}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hide(t){if(t.classList.contains(l.css.collapsing)||!t.classList.contains(l.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(l.css.collapse,l.css.show),t.classList.add(l.css.collapsing),t.style.height="",setTimeout((()=>{t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse)}),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=>{var e;this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||(null===(e=t.composedPath())||void 0===e?void 0:e.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(b),this.dateDisplay=h.locate(D),this.monthDisplay=h.locate(k),this.yearDisplay=h.locate(_),this.decadeDisplay=h.locate(C),this.timeDisplay=h.locate(E),this.hourDisplay=h.locate(M),this.minuteDisplay=h.locate(L),this.secondDisplay=h.locate(T),this._eventEmitters=h.locate(v),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(){var s,i;if(null==this.widget){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new n).setLocale(this.optionsStore.options.localization.locale);if(!this.optionsStore.options.keepInvalid){let i=0,o=1;for((null===(s=this.optionsStore.options.restrictions.maxDate)||void 0===s?void 0:s.isBefore(e))&&(o=-1);!(this.validation.isValid(e)||(e.manipulate(o,t.Unit.date),i>31));)i++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}this._buildWidget();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:w.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||(this._hasTime&&U.hide(this.widget.querySelector(`div.${l.css.timeContainer}`)),U.show(this.widget.querySelector(`div.${l.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{((null===(i=this.optionsStore.options)||void 0===i?void 0:i.container)||document.body).appendChild(this.widget),this._popperInstance=e.createPopper(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?"bottom-end":"bottom-start"})}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:w.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(l.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(l.css.show),this.optionsStore.options.display.inline||(this._popperInstance.update(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:l.events.show}),this._isVisible=!0}_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(`.${l.css.dateContainer} > div:not(.${l.css.calendarHeader}), .${l.css.timeContainer} > div:not(.${l.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 l.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case l.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case l.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case l.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${l.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(l.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case l.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case l.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 l.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 l.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(l.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:l.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(l.css.widget);const e=document.createElement("div");e.classList.add(l.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(l.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(l.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(l.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(l.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(l.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(l.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(l.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(l.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",w.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",w.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",w.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",w.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(l.css.calendarHeader);const e=document.createElement("div");e.classList.add(l.css.previous),e.setAttribute("data-action",w.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(l.css.switch),s.setAttribute("data-action",w.changeCalendarView);const i=document.createElement("div");return i.classList.add(l.css.next),i.setAttribute("data-action",w.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(b),this.validation=h.locate(m),this.display=h.locate(A),this._eventEmitters=h.locate(v),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){var i,o;const a=null==e?void 0:e.currentTarget;if(null===(i=null==a?void 0:a.classList)||void 0===i?void 0:i.contains(l.css.disabled))return!1;s=s||(null===(o=null==a?void 0:a.dataset)||void 0===o?void 0:o.action);const r=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case w.next:case w.previous:this.handleNextPrevious(s);break;case w.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case w.selectMonth:case w.selectYear:case w.selectDecade:const i=+a.dataset.value;switch(s){case w.selectMonth:this.optionsStore.viewDate.month=i;break;case w.selectYear:case w.selectDecade:this.optionsStore.viewDate.year=i}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 w.selectDay:const o=this.optionsStore.viewDate.clone;a.classList.contains(l.css.old)&&o.manipulate(-1,t.Unit.month),a.classList.contains(l.css.new)&&o.manipulate(1,t.Unit.month),o.date=+a.dataset.day;let d=0;this.optionsStore.options.multipleDates?(d=this.dates.pickedIndex(o,t.Unit.date),-1!==d?this.dates.setValue(null,d):this.dates.setValue(o,this.dates.lastPickedIndex+1)):this.dates.setValue(o,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 w.selectHour:let c=+a.dataset.value;r.hours>=12&&!this.optionsStore.options.display.components.useTwentyfourHour&&(c+=12),r.hours=c,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.selectMinute:r.minutes=+a.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.selectSecond:r.seconds=+a.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case w.incrementHours:this.manipulateAndSet(r,t.Unit.hours);break;case w.incrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,this.optionsStore.options.stepping);break;case w.incrementSeconds:this.manipulateAndSet(r,t.Unit.seconds);break;case w.decrementHours:this.manipulateAndSet(r,t.Unit.hours,-1);break;case w.decrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case w.decrementSeconds:this.manipulateAndSet(r,t.Unit.seconds,-1);break;case w.toggleMeridiem:this.manipulateAndSet(r,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case w.togglePicker:a.getAttribute("title")===this.optionsStore.options.localization.selectDate?(a.setAttribute("title",this.optionsStore.options.localization.selectTime),a.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(a.setAttribute("title",this.optionsStore.options.localization.selectDate),a.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.do(e,w.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${l.css.dateContainer}, .${l.css.timeContainer}`).forEach((t=>U.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case w.showClock:case w.showHours:case w.showMinutes:case w.showSeconds:this.handleShowClockContainers(s);break;case w.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case w.close:this.display.hide();break;case w.today:const h=(new n).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 l.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${l.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case w.showClock:s=l.css.clockContainer,this.display._update("clock");break;case w.showHours:s=l.css.hourContainer,this.display._update(t.Unit.hours);break;case w.showMinutes:s=l.css.minuteContainer,this.display._update(t.Unit.minutes);break;case w.showSeconds:s=l.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===w.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,w.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=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked)},s=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=s.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{var t,e;(null===(t=this.optionsStore.element)||void 0===t?void 0:t.disabled)||(null===(e=this.optionsStore.input)||void 0===e?void 0:e.disabled)||this.toggle()},h=new c,this._eventEmitters=h.locate(v),this.optionsStore=h.locate(u),this.display=h.locate(A),this.dates=h.locate(b),this.actions=h.locate($),t||l.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(){var t;this._isDisabled=!0,null===(t=this.optionsStore.input)||void 0===t||t.setAttribute("disabled","disabled"),this.display.hide()}enable(){var t;this._isDisabled=!1,null===(t=this.optionsStore.input)||void 0===t||t.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&&l.errorMessages.subscribeMismatch();const i=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:l.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){var i;let o=S.deepCopy(t);o=S._mergeOptions(o,e),s&&(o=S._dataToOptions(this.optionsStore.element,o)),S._validateConflicts(o),o.viewDate=o.viewDate.setLocale(o.localization.locale),this.optionsStore.viewDate.isSame(o.viewDate)||(this.optionsStore.viewDate=o.viewDate),o.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),o.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),o.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==o.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===o.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),this.optionsStore.options=o}_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){var e,s;!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||(null===(e=this.display.widget)||void 0===e?void 0:e.getElementsByClassName(l.css.show)[0].classList.contains(l.css.timeContainer))||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&(null===(s=t.date)||void 0===s?void 0:s.isSame(t.oldDate))||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${l.css.switch} div`)},action:w.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={};t.DateTime=n,t.DefaultOptions=g,t.Namespace=l,t.TempusDominus=O,t.extend=function(t,e){return t.$i||(t.load(e,{TempusDominus:O,Dates:b,Display:A},this),t.$i=!0),this},t.loadLocale=t=>{V[t.name]||(V[t.name]=t.localization)},t.locale=t=>{let e=V[t];e&&(g.localization=e)},Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/locales/de.js b/dist/locales/de.js index 34c897042..8118f3864 100644 --- a/dist/locales/de.js +++ b/dist/locales/de.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 bda85b7d9..fbb150086 100644 --- a/dist/locales/es.js +++ b/dist/locales/es.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 8f1372f05..8ddf7c7ce 100644 --- a/dist/locales/it.js +++ b/dist/locales/it.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 cd24b5b17..b25268d6e 100644 --- a/dist/locales/nl.js +++ b/dist/locales/nl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 38a8c789e..d15b13702 100644 --- a/dist/locales/ro.js +++ b/dist/locales/ro.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 6e48ae563..ebd2f8263 100644 --- a/dist/locales/ru.js +++ b/dist/locales/ru.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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/examples/sample.js b/dist/plugins/examples/sample.js index a8ada61cd..aa840ffbf 100644 --- a/dist/plugins/examples/sample.js +++ b/dist/plugins/examples/sample.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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/fa-five.js b/dist/plugins/fa-five.js index 003ac4793..98db40c41 100644 --- a/dist/plugins/fa-five.js +++ b/dist/plugins/fa-five.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 a558679c3..0c453f62a 100644 --- a/dist/plugins/moment-parse.js +++ b/dist/plugins/moment-parse.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta7 (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 4e0f96292..522ecb078 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta5.1", + "version": "6.0.0-beta7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta5.1", + "version": "6.0.0-beta7", "license": "MIT", "devDependencies": { "@popperjs/core": "^2.11.2", @@ -14,7 +14,7 @@ "@rollup/plugin-typescript": "^8.3.1", "@types/node": "^17.0.8", "bootstrap": "^5.1.3", - "browser-sync": "^2.27.7", + "browser-sync": "^2.27.9", "chokidar": "^3.5.1", "clean-css": "^5.2.2", "concurrently": "^6.5.1", @@ -235,6 +235,12 @@ "node": ">= 8.0.0" } }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", + "dev": true + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -275,6 +281,24 @@ "dev": true, "peer": true }, + "node_modules/@types/component-emitter": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", + "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", + "dev": true + }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true + }, + "node_modules/@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", + "dev": true + }, "node_modules/@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", @@ -370,12 +394,6 @@ "node": ">=0.4.0" } }, - "node_modules/after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", - "dev": true - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -388,24 +406,6 @@ "node": ">= 6.0.0" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/alphanum-sort": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", @@ -452,12 +452,6 @@ "node": ">=8" } }, - "node_modules/arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", - "dev": true - }, "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -488,27 +482,12 @@ "follow-redirects": "^1.14.0" } }, - "node_modules/backo2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "node_modules/base64-arraybuffer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", - "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", @@ -542,12 +521,6 @@ "node": ">=8" } }, - "node_modules/blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==", - "dev": true - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -596,13 +569,13 @@ "dev": true }, "node_modules/browser-sync": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.7.tgz", - "integrity": "sha512-9ElnnA/u+s2Jd+IgY+2SImB+sAEIteHsMG0NR96m7Ph/wztpvJCUpyC2on1KqmG9iAp941j+5jfmd34tEguGbg==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.9.tgz", + "integrity": "sha512-3zBtggcaZIeU9so4ja9yxk7/CZu9B3DOL6zkxFpzHCHsQmkGBPVXg61jItbeoa+WXgNLnr1sYES/2yQwyEZ2+w==", "dev": true, "dependencies": { - "browser-sync-client": "^2.27.7", - "browser-sync-ui": "^2.27.7", + "browser-sync-client": "^2.27.9", + "browser-sync-ui": "^2.27.9", "bs-recipes": "1.3.4", "bs-snippet-injector": "^2.0.1", "chokidar": "^3.5.1", @@ -628,9 +601,9 @@ "serve-index": "1.9.1", "serve-static": "1.13.2", "server-destroy": "1.0.1", - "socket.io": "2.4.0", + "socket.io": "^4.4.1", "ua-parser-js": "1.0.2", - "yargs": "^15.4.1" + "yargs": "^17.3.1" }, "bin": { "browser-sync": "dist/bin.js" @@ -640,9 +613,9 @@ } }, "node_modules/browser-sync-client": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.7.tgz", - "integrity": "sha512-wKg9UP9a4sCIkBBAXUdbkdWFJzfSAQizGh+nC19W9y9zOo9s5jqeYRFUUbs7x5WKhjtspT+xetVp9AtBJ6BmWg==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.9.tgz", + "integrity": "sha512-FHW8kydp7FXo6jnX3gXJCpHAHtWNLK0nx839nnK+boMfMI1n4KZd0+DmTxHBsHsF3OHud4V4jwoN8U5HExMIdQ==", "dev": true, "dependencies": { "etag": "1.8.1", @@ -655,16 +628,16 @@ } }, "node_modules/browser-sync-ui": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.7.tgz", - "integrity": "sha512-Bt4OQpx9p18OIzk0KKyu7jqlvmjacasUlk8ARY3uuIyiFWSBiRgr2i6XY8dEMF14DtbooaEBOpHEu9VCYvMcCw==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.9.tgz", + "integrity": "sha512-rsduR2bRIwFvM8CX6iY/Nu5aWub0WB9zfSYg9Le/RV5N5DEyxJYey0VxdfWCnzDOoelassTDzYQo+r0iJno3qw==", "dev": true, "dependencies": { "async-each-series": "0.1.1", "connect-history-api-fallback": "^1", "immutable": "^3", "server-destroy": "1.0.1", - "socket.io-client": "^2.4.0", + "socket.io-client": "^4.4.1", "stream-throttle": "^0.1.3" } }, @@ -737,15 +710,6 @@ "tslib": "^2.0.3" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -915,24 +879,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "node_modules/component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", - "dev": true - }, "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, - "node_modules/component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1107,14 +1059,27 @@ } }, "node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, "engines": { "node": ">= 0.6" } }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/css-color-names": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz", @@ -1333,23 +1298,28 @@ } }, "node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, + "ms": "2.1.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/decimal.js": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", @@ -1569,69 +1539,48 @@ } }, "node_modules/engine.io": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.5.0.tgz", - "integrity": "sha512-21HlvPUKaitDGE4GXNtQ7PLP0Sz4aWLddMPw2VTyFz1FVZqu/kZsJUO8WNpKuE/OCL7nkfRaOui2ZCJloGznGA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", + "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", "dev": true, "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", "cookie": "~0.4.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "~7.4.2" + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3" }, "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } }, "node_modules/engine.io-client": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.2.tgz", - "integrity": "sha512-QEqIp+gJ/kMHeUun7f5Vv3bteRHppHH/FMBQX/esFj/fuYfjyUKWGMo3VCvIP/V8bE9KcjHmRZrhIz2Z9oNsDA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.2.2.tgz", + "integrity": "sha512-8ZQmx0LQGRTYkHuogVZuGSpDqYZtCM/nv8zQ68VZ+JkOpazJ7ICdsSpaO6iXwvaU30oFg5QJOJWj8zWqhbKjkQ==", "dev": true, "dependencies": { - "component-emitter": "~1.3.0", - "component-inherit": "0.0.3", - "debug": "~3.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "ws": "~7.4.2", - "xmlhttprequest-ssl": "~1.6.2", - "yeast": "0.1.2" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3", + "xmlhttprequest-ssl": "~2.0.0" } }, "node_modules/engine.io-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", - "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", - "dev": true, - "dependencies": { - "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.4", - "blob": "0.0.5", - "has-binary2": "~1.0.2" - } - }, - "node_modules/engine.io/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", + "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", "dev": true, - "dependencies": { - "ms": "^2.1.1" + "engines": { + "node": ">=10.0.0" } }, - "node_modules/engine.io/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", @@ -2029,21 +1978,6 @@ "node": ">=0.10.0" } }, - "node_modules/has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "dev": true, - "dependencies": { - "isarray": "2.0.1" - } - }, - "node_modules/has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", - "dev": true - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -2192,29 +2126,6 @@ "node": ">= 6" } }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -2228,24 +2139,6 @@ "node": ">= 6" } }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -2318,12 +2211,6 @@ "node": ">=8" } }, - "node_modules/indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2445,12 +2332,6 @@ "node": ">=4" } }, - "node_modules/isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -2538,27 +2419,6 @@ } } }, - "node_modules/jsdom/node_modules/ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -2824,9 +2684,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mitt": { @@ -2963,6 +2823,15 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -3105,18 +2974,6 @@ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true }, - "node_modules/parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==", - "dev": true - }, - "node_modules/parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==", - "dev": true - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3990,12 +3847,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -4511,12 +4362,6 @@ "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=", "dev": true }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -4533,85 +4378,68 @@ } }, "node_modules/socket.io": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.4.0.tgz", - "integrity": "sha512-9UPJ1UTvKayuQfVv2IQ3k7tCQC/fboDyIK62i99dAQIyHKaBsNdTpwHLgKJ6guRWxRtC9H+138UwpaGuQO9uWQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.0.tgz", + "integrity": "sha512-slTYqU2jCgMjXwresG8grhUi/cC6GjzmcfqArzaH3BN/9I/42eZk9yamNvZJdBfTubkjEdKAKs12NEztId+bUA==", "dev": true, "dependencies": { - "debug": "~4.1.0", - "engine.io": "~3.5.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.4.0", - "socket.io-parser": "~3.4.0" + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~6.2.0", + "socket.io-adapter": "~2.4.0", + "socket.io-parser": "~4.0.4" + }, + "engines": { + "node": ">=10.0.0" } }, "node_modules/socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", + "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", "dev": true }, "node_modules/socket.io-client": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", - "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", - "dev": true, - "dependencies": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "engine.io-client": "~3.5.0", - "has-binary2": "~1.0.2", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" - } - }, - "node_modules/socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.0.tgz", + "integrity": "sha512-HW61c1G7OrYGxaI79WRn17+b03iBCdvhBj4iqyXHBoL5M8w2MSO/vChsjA93knG4GYEai1/vbXWJna9dzxXtSg==", "dev": true, "dependencies": { - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "isarray": "2.0.1" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.2.1", + "socket.io-parser": "~4.2.0" + }, + "engines": { + "node": ">=10.0.0" } }, - "node_modules/socket.io/node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "node_modules/socket.io/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "node_modules/socket.io-client/node_modules/socket.io-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.0.tgz", + "integrity": "sha512-tLfmEwcEwnlQTxFB7jibL/q2+q8dlVQzj4JdRLJ/W/G1+Fu9VSxCx1Lo+n1HvXxKnM//dUuD0xgiA7tQf57Vng==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" } }, - "node_modules/socket.io/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/socket.io/node_modules/socket.io-parser": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", - "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", + "node_modules/socket.io-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "dev": true, "dependencies": { - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "isarray": "2.0.1" + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" } }, "node_modules/source-map": { @@ -4686,14 +4514,14 @@ "dev": true }, "node_modules/string-width": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.1.tgz", - "integrity": "sha512-LL0OLyN6AnfV9xqGQpDBwedT2Rt63737LxvsRxbcwpa2aIeynBApG2Sm//F3TaLHIR1aJBN52DWklc06b94o5Q==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" @@ -4709,12 +4537,12 @@ } }, "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -4858,12 +4686,6 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, - "node_modules/to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", - "dev": true - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5063,6 +4885,15 @@ "node": ">= 0.4.0" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vendors": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", @@ -5149,12 +4980,6 @@ "node": ">=12" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -5218,12 +5043,12 @@ "dev": true }, "node_modules/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "dev": true, "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", @@ -5254,9 +5079,9 @@ "dev": true }, "node_modules/xmlhttprequest-ssl": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz", - "integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -5281,25 +5106,21 @@ } }, "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "17.5.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.0.tgz", + "integrity": "sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A==", "dev": true, "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/yargs-parser": { @@ -5311,89 +5132,15 @@ "node": ">=10" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/yargs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", - "dev": true - }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", - "dev": true - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -5558,6 +5305,12 @@ "picomatch": "^2.2.2" } }, + "@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", + "dev": true + }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -5587,6 +5340,24 @@ "dev": true, "peer": true }, + "@types/component-emitter": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", + "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", + "dev": true + }, + "@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true + }, + "@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", + "dev": true + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", @@ -5663,12 +5434,6 @@ "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", - "dev": true - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -5676,23 +5441,6 @@ "dev": true, "requires": { "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "alphanum-sort": { @@ -5729,12 +5477,6 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", - "dev": true - }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -5762,24 +5504,12 @@ "follow-redirects": "^1.14.0" } }, - "backo2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", - "dev": true - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base64-arraybuffer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", - "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=", - "dev": true - }, "base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", @@ -5804,12 +5534,6 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, - "blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==", - "dev": true - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -5849,13 +5573,13 @@ "dev": true }, "browser-sync": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.7.tgz", - "integrity": "sha512-9ElnnA/u+s2Jd+IgY+2SImB+sAEIteHsMG0NR96m7Ph/wztpvJCUpyC2on1KqmG9iAp941j+5jfmd34tEguGbg==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.9.tgz", + "integrity": "sha512-3zBtggcaZIeU9so4ja9yxk7/CZu9B3DOL6zkxFpzHCHsQmkGBPVXg61jItbeoa+WXgNLnr1sYES/2yQwyEZ2+w==", "dev": true, "requires": { - "browser-sync-client": "^2.27.7", - "browser-sync-ui": "^2.27.7", + "browser-sync-client": "^2.27.9", + "browser-sync-ui": "^2.27.9", "bs-recipes": "1.3.4", "bs-snippet-injector": "^2.0.1", "chokidar": "^3.5.1", @@ -5881,15 +5605,15 @@ "serve-index": "1.9.1", "serve-static": "1.13.2", "server-destroy": "1.0.1", - "socket.io": "2.4.0", + "socket.io": "^4.4.1", "ua-parser-js": "1.0.2", - "yargs": "^15.4.1" + "yargs": "^17.3.1" } }, "browser-sync-client": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.7.tgz", - "integrity": "sha512-wKg9UP9a4sCIkBBAXUdbkdWFJzfSAQizGh+nC19W9y9zOo9s5jqeYRFUUbs7x5WKhjtspT+xetVp9AtBJ6BmWg==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.9.tgz", + "integrity": "sha512-FHW8kydp7FXo6jnX3gXJCpHAHtWNLK0nx839nnK+boMfMI1n4KZd0+DmTxHBsHsF3OHud4V4jwoN8U5HExMIdQ==", "dev": true, "requires": { "etag": "1.8.1", @@ -5899,16 +5623,16 @@ } }, "browser-sync-ui": { - "version": "2.27.7", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.7.tgz", - "integrity": "sha512-Bt4OQpx9p18OIzk0KKyu7jqlvmjacasUlk8ARY3uuIyiFWSBiRgr2i6XY8dEMF14DtbooaEBOpHEu9VCYvMcCw==", + "version": "2.27.9", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.9.tgz", + "integrity": "sha512-rsduR2bRIwFvM8CX6iY/Nu5aWub0WB9zfSYg9Le/RV5N5DEyxJYey0VxdfWCnzDOoelassTDzYQo+r0iJno3qw==", "dev": true, "requires": { "async-each-series": "0.1.1", "connect-history-api-fallback": "^1", "immutable": "^3", "server-destroy": "1.0.1", - "socket.io-client": "^2.4.0", + "socket.io-client": "^4.4.1", "stream-throttle": "^0.1.3" } }, @@ -5965,12 +5689,6 @@ "tslib": "^2.0.3" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -6114,24 +5832,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -6270,11 +5976,21 @@ "dev": true }, "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "css-color-names": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz", @@ -6431,20 +6147,22 @@ "dev": true }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, "decimal.js": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", @@ -6613,67 +6331,41 @@ "dev": true }, "engine.io": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.5.0.tgz", - "integrity": "sha512-21HlvPUKaitDGE4GXNtQ7PLP0Sz4aWLddMPw2VTyFz1FVZqu/kZsJUO8WNpKuE/OCL7nkfRaOui2ZCJloGznGA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", + "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", "dev": true, "requires": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", "cookie": "~0.4.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "~7.4.2" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3" } }, "engine.io-client": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.2.tgz", - "integrity": "sha512-QEqIp+gJ/kMHeUun7f5Vv3bteRHppHH/FMBQX/esFj/fuYfjyUKWGMo3VCvIP/V8bE9KcjHmRZrhIz2Z9oNsDA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.2.2.tgz", + "integrity": "sha512-8ZQmx0LQGRTYkHuogVZuGSpDqYZtCM/nv8zQ68VZ+JkOpazJ7ICdsSpaO6iXwvaU30oFg5QJOJWj8zWqhbKjkQ==", "dev": true, "requires": { - "component-emitter": "~1.3.0", - "component-inherit": "0.0.3", - "debug": "~3.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "ws": "~7.4.2", - "xmlhttprequest-ssl": "~1.6.2", - "yeast": "0.1.2" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3", + "xmlhttprequest-ssl": "~2.0.0" } }, "engine.io-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", - "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", - "dev": true, - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.4", - "blob": "0.0.5", - "has-binary2": "~1.0.2" - } + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", + "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", + "dev": true }, "entities": { "version": "2.2.0", @@ -6972,21 +6664,6 @@ "ansi-regex": "^2.0.0" } }, - "has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "dev": true, - "requires": { - "isarray": "2.0.1" - } - }, - "has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", - "dev": true - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -7100,23 +6777,6 @@ "@tootallnate/once": "2", "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "https-proxy-agent": { @@ -7127,23 +6787,6 @@ "requires": { "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "iconv-lite": { @@ -7198,12 +6841,6 @@ "resolve-from": "^5.0.0" } }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -7304,12 +6941,6 @@ "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", "dev": true }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -7377,15 +7008,6 @@ "whatwg-url": "^10.0.0", "ws": "^8.2.3", "xml-name-validator": "^4.0.0" - }, - "dependencies": { - "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "requires": {} - } } }, "json5": { @@ -7599,9 +7221,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mitt": { @@ -7710,6 +7332,12 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -7822,18 +7450,6 @@ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true }, - "parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==", - "dev": true - }, - "parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==", - "dev": true - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -8402,12 +8018,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -8831,12 +8441,6 @@ "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=", "dev": true }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -8850,87 +8454,58 @@ "dev": true }, "socket.io": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.4.0.tgz", - "integrity": "sha512-9UPJ1UTvKayuQfVv2IQ3k7tCQC/fboDyIK62i99dAQIyHKaBsNdTpwHLgKJ6guRWxRtC9H+138UwpaGuQO9uWQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.0.tgz", + "integrity": "sha512-slTYqU2jCgMjXwresG8grhUi/cC6GjzmcfqArzaH3BN/9I/42eZk9yamNvZJdBfTubkjEdKAKs12NEztId+bUA==", "dev": true, "requires": { - "debug": "~4.1.0", - "engine.io": "~3.5.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.4.0", - "socket.io-parser": "~3.4.0" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "socket.io-parser": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", - "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", - "dev": true, - "requires": { - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "isarray": "2.0.1" - } - } + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~6.2.0", + "socket.io-adapter": "~2.4.0", + "socket.io-parser": "~4.0.4" } }, "socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", + "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", "dev": true }, "socket.io-client": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", - "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.0.tgz", + "integrity": "sha512-HW61c1G7OrYGxaI79WRn17+b03iBCdvhBj4iqyXHBoL5M8w2MSO/vChsjA93knG4GYEai1/vbXWJna9dzxXtSg==", "dev": true, "requires": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "engine.io-client": "~3.5.0", - "has-binary2": "~1.0.2", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.2.1", + "socket.io-parser": "~4.2.0" + }, + "dependencies": { + "socket.io-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.0.tgz", + "integrity": "sha512-tLfmEwcEwnlQTxFB7jibL/q2+q8dlVQzj4JdRLJ/W/G1+Fu9VSxCx1Lo+n1HvXxKnM//dUuD0xgiA7tQf57Vng==", + "dev": true, + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + } + } } }, "socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "dev": true, "requires": { + "@types/component-emitter": "^1.2.10", "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "isarray": "2.0.1" + "debug": "~4.3.1" } }, "source-map": { @@ -8990,14 +8565,14 @@ "dev": true }, "string-width": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.1.tgz", - "integrity": "sha512-LL0OLyN6AnfV9xqGQpDBwedT2Rt63737LxvsRxbcwpa2aIeynBApG2Sm//F3TaLHIR1aJBN52DWklc06b94o5Q==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "dependencies": { "ansi-regex": { @@ -9007,12 +8582,12 @@ "dev": true }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } } } @@ -9118,12 +8693,6 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", - "dev": true - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -9265,6 +8834,12 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, "vendors": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", @@ -9331,12 +8906,6 @@ "webidl-conversions": "^7.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -9387,9 +8956,9 @@ "dev": true }, "ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "dev": true, "requires": {} }, @@ -9406,9 +8975,9 @@ "dev": true }, "xmlhttprequest-ssl": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz", - "integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", "dev": true }, "y18n": { @@ -9424,85 +8993,25 @@ "dev": true }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "17.5.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.0.tgz", + "integrity": "sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", - "dev": true - }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "dev": true } } }, @@ -9512,12 +9021,6 @@ "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==", "dev": true }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", - "dev": true - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 94799b27f..dc08724c8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "Jonathan Peterson" }, "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta5.1", + "version": "6.0.0-beta7", "style": "dist/css/tempus-dominus.css", "sass": "scss/tempus-dominus.scss", "main": "dist/js/tempus-dominus.js", @@ -42,7 +42,7 @@ "@rollup/plugin-node-resolve": "^13.1.3", "@types/node": "^17.0.8", "bootstrap": "^5.1.3", - "browser-sync": "^2.27.7", + "browser-sync": "^2.27.9", "chokidar": "^3.5.1", "clean-css": "^5.2.2", "concurrently": "^6.5.1", diff --git a/src/docs/js/docs.js b/src/docs/js/docs.js index a899e558a..e80e72245 100644 --- a/src/docs/js/docs.js +++ b/src/docs/js/docs.js @@ -48,7 +48,7 @@ document.addEventListener('DOMContentLoaded', () => { events.forEach((listen) => { element.addEventListener(listen, (e) => { logger(element.closest('section').getElementsByClassName('logger')[0], - 'log', + listen === 'error.td' ? 'error' : 'log', `${element.getAttribute('id')} -> ${listen}:`, JSON.stringify(e.detail, null, 2)); }); }); diff --git a/src/docs/partials/change-log.html b/src/docs/partials/change-log.html index dd27e9a5c..9b8acd575 100644 --- a/src/docs/partials/change-log.html +++ b/src/docs/partials/change-log.html @@ -1,6 +1,30 @@

Version 6

+

Beta7

+

Bug Fixes

+
    +
  • Fixed options mutable. #2487
  • +
  • Fixed element toggle when input is disabled #2495
  • +
  • Fixed jQuery no conflict #2506
  • +
  • Fixed options update #2549
  • +
+

New

+
    +
  • Added a new example for setting and getting dates.
  • +
+

Beta6

+

Bug Fixes

+
    +
  • viewMode is optional #2550
  • +
+

New

+
    +
  • Introduced a simple overridable function parseInput #2552
  • +

6-beta5

Bug Fixes

    diff --git a/src/docs/partials/examples/index.html b/src/docs/partials/examples/index.html index 508a21a54..132a58f32 100644 --- a/src/docs/partials/examples/index.html +++ b/src/docs/partials/examples/index.html @@ -11,7 +11,7 @@
-

Minimum Setup Minimum Setup

@@ -91,7 +91,7 @@

Minimum Setup Simple Setup - + @@ -206,7 +206,7 @@

Simple Setup

-

Using Locales Using Locales

@@ -392,7 +392,7 @@

Using Locales
-

Time Only Time Only

@@ -528,7 +528,7 @@

Time Only
-

Date Only Date Only

@@ -663,7 +663,7 @@

Date Only
-

Input Only Input Only

@@ -757,7 +757,7 @@

Input Only
-

Enabled/Disabled Dates Enabled/Disabled Dates

@@ -885,7 +885,7 @@

Enabled/Disabled Dates
-

Linked pickers Linked pickers

@@ -1095,7 +1095,7 @@

Linked pickers Custom Icons Custom Icons

@@ -1241,7 +1241,7 @@

Custom Icons
-

View Mode View Mode

@@ -1355,7 +1355,7 @@

View Mode
-

Minimum View Minimum View

@@ -1486,7 +1486,7 @@

Minimum View Disabled Days of the Week Disabled Days of the Week

@@ -1603,7 +1603,7 @@

Disabled Days of the Week Inline Inline

@@ -1687,7 +1687,7 @@

Inline Multiple Dates Multiple Dates

@@ -1804,7 +1804,7 @@

Multiple Dates
-

Update options Update options

@@ -1945,7 +1945,7 @@

Update options Example with container parameterExample with container parameter

@@ -2038,14 +2038,14 @@

Example with container parameter

Plugins - +

Plugins allow you to extend the picker by adding new functionality to either Tempus Dominus globally, - the plugin or by overwritting existing functionality. Check the events tab to see the logs. + the plugin or by overwriting existing functionality. Check the events tab to see the logs.

@@ -2114,6 +2114,7 @@

Plugins 'log', `from plugin:`, value); }; + loadPluginButton.addEventListener('click', () => { const script = document.createElement('script'); script.onload = function () { @@ -2179,6 +2180,7 @@

Plugins 'log', `from plugin:`, value); }; + loadPluginButton.addEventListener('click', () => { const script = document.createElement('script'); script.onload = function () { @@ -2195,6 +2197,156 @@

Plugins

+
+

Picker Functions + + + +

+ +

+ Click to view the code and the log. + Clicking the buttons below will log the results there. +

+ +
+ +
+
+
+           
+ <div
+     class='input-group'
+     id='pickerFunctions'
+     data-td-target-input='nearest'
+     data-td-target-toggle='nearest'
+ >
+   <input
+     id='pickerFunctionsInput'
+     type='text'
+     class='form-control'
+     data-td-target='#pickerFunctions'
+   />
+   <span
+     class='input-group-text'
+     data-td-target='#pickerFunctions'
+     data-td-toggle='datetimepicker'
+   >
+     <span class='fa-solid fa-calendar'></span>
+   </span>
+ </div>
+           
+         
+
+
+
+           
+ new tempusDominus.TempusDominus(document.getElementById('pickerFunctions'));
+           
+         
+
+
+
+ Events will display as you manipulate the picker. +
+
+
+
+ +
+
+
+ +
+ + + + +
+
+
+
+
+ + +
+
+
+ + +
+ diff --git a/src/docs/partials/examples/jquery.html b/src/docs/partials/examples/jquery.html index dddd85057..98d7cdc23 100644 --- a/src/docs/partials/examples/jquery.html +++ b/src/docs/partials/examples/jquery.html @@ -20,7 +20,7 @@

-

Simple Setup Simple Setup diff --git a/src/docs/partials/functions.html b/src/docs/partials/functions.html index 1056ed7ef..cc171f60b 100644 --- a/src/docs/partials/functions.html +++ b/src/docs/partials/functions.html @@ -41,20 +41,20 @@

Dates -

Getting the View Date -

picker.viewDate returns the pickers current view date.

picker.dates -

@@ -62,28 +62,28 @@

picker.dates

picked -

Returns an array of DateTime of the selected date(s).

lastPicked -

Returns the last picked DateTime of the selected date(s).

lastPickedIndex -

Returns the length of picked dates -1 or 0 if none are selected.

add(DateTime) -

@@ -94,7 +94,7 @@

add(DateTime) widget or do any validation.

setValue(value: DateTime, index?: number) -

@@ -102,7 +102,7 @@

setValue(value: DateTime, index?: number)

formatInput(value: DateTime): string -

@@ -111,8 +111,16 @@

formatInput(value: DateTime): string to provide more complex formatting with moment/dayjs or by hand.

+
parseInput(value:any): DateTime + +
+

+ Parse the value into a DateTime object. This can be overwritten to supply your own parsing. +

+
setFromInput(value: any, index?: number) -

@@ -124,7 +132,7 @@

setFromInput(value: any, index?: number)

isPicked(DateTime, Unit?) -

@@ -133,7 +141,7 @@

isPicked(DateTime, Unit?) to that unit will be used.

pickedIndex(DateTime, Unit?) -

@@ -142,7 +150,7 @@

pickedIndex(DateTime, Unit?) multi-date is used. If unit is provided then a granularity to that unit will be used.

clear -

@@ -159,7 +167,7 @@

clear

updateOptions(object, boolean?) -

@@ -178,7 +186,7 @@

updateOptions(object, boolean?)

Display -

@@ -201,7 +209,7 @@

Emits

show -

Shows the widget

Emits

@@ -217,7 +225,7 @@

Emits

hide -

Hides the widget

Emits

@@ -238,14 +246,14 @@

paint(Unit | 'decade', DateTime, string[], HTMLElement)

dispose -

Destroys the widget and removes all attached event listeners. If the picker is open it will be hidden and the event fired.

disable -

Disables the input element and the component is attached to, by adding a disabled="true" attribute @@ -258,7 +266,7 @@

Emits

enable -

Enables the input element and the component is attached to, by removing disabled attribute from it. @@ -266,13 +274,13 @@

enable

clear -

Clears all selected dates. This is a short cut to picker.dates.clear()

subscribe(event | events[], callback | callbacks[]) -

Instead of adding event listeners to the pickers element, you can use the subscribe method. You can provide diff --git a/src/docs/partials/namespace/css.html b/src/docs/partials/namespace/css.html index 70154af72..baad030f3 100644 --- a/src/docs/partials/namespace/css.html +++ b/src/docs/partials/namespace/css.html @@ -3,212 +3,212 @@ The picker uses the following css classes to style the picker.

-

widget widget

The outer element for the widget.

-

calendarHeader calendarHeader

The element for the calendar view header, next and previous actions.

-

switch switch

The element for the action to change the calendar view. E.g. month -> year.

-

sideBySide sideBySide

Applied to the widget element when the side by side option is in use.

-

previous previous

The element for the action to change the calendar view, e.g. August -> July

-

next

+

next

The element for the action to change the calendar view, e.g. August -> September

-

disabled disabled

Applied to any action that would violate any restriction options. ALso applied to an input field if the disabled function is called.

-

old

+

old

Applied to any date that is less than requested view, e.g. the last day of the previous month.

-

new

+

new

Applied to any date that is greater than of requested view, e.g. the last day of the previous month.

-

active active

Applied to any date that is currently selected.

-

dateContainer dateContainer

The outer most element for the calendar view.

-

decadesContainer decadesContainer

The outer most element for the decades view.

-

decade decade

Applied to elements within the decades container, e.g. 2020, 2030

-

yearsContainer yearsContainer

The outer most element for the years view.

-

year

+

year

Applied to elements within the years container, e.g. 2021, 2021

-

monthsContainer monthsContainer

The outer most element for the month view.

-

month +

month

Applied to elements within the month container, e.g. January, February

-

daysContainer daysContainer

The outer most element for the calendar view.

-

day

+

day

Applied to elements within the day container, e.g. 1, 2..31

-

calendarWeeks calendarWeeks

If display.calendarWeeks is enabled, a column displaying the week of year is shown. This class is applied to each cell in that column.

-

dayOfTheWeek dayOfTheWeek

Applied to the first row of the calendar view, e.g. Sunday, Monday

-

today +

today

Applied to the current date on the calendar view.

-

weekend +

weekend

Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday

-

timeContainer timeContainer

The outer most element for all time related elements.

-

separator separator

Applied the separator columns between time elements, e.g. hour *:* minute *:* second

-

clockContainer clockContainer

The outer most element for the clock view.

-

hourContainer hourContainer

The outer most element for the hours selection view.

-

minuteContainer minuteContainer

The outer most element for the minutes selection view.

-

secondContainer secondContainer

The outer most element for the seconds selection view.

-

hour

+

hour

Applied to each element in the hours selection view.

-

minute minute

Applied to each element in the minutes selection view.

-

second second

Applied to each element in the seconds selection view.

-

show

+

show

Applied the element of the current view mode, e.g. calendar or clock.

-

collapsing collapsing

Applied to the currently showing view mode during a transition between calendar and clock views

-

collapse collapse

Applied to the currently hidden view mode.

-

inline inline

Applied to the widget when the option display.inline is enabled. diff --git a/src/docs/partials/namespace/errors.html b/src/docs/partials/namespace/errors.html index 3f232e450..18b70c7fc 100644 --- a/src/docs/partials/namespace/errors.html +++ b/src/docs/partials/namespace/errors.html @@ -11,21 +11,21 @@

-

unexpectedOption (code: 1)unexpectedOption (code: 1)

An error indicating that a key in the options object is invalid.

-

unexpectedOptions (code: 1)unexpectedOptions (code: 1)

An error indicating that one more keys in the options object is invalid.

-

unexpectedOptionValue (code: 2)unexpectedOptionValue (code: 2)

@@ -34,7 +34,7 @@

unexpectedOptionValue (code: 2) -

typeMismatch (code: 3)typeMismatch (code: 3)

@@ -43,7 +43,7 @@

typeMismatch (code: 3)numbersOutOfRage (code: 4)numbersOutOfRage (code: 4)

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

numbersOutOfRage (code: 4)failedToParseDate (code: 5)failedToParseDate (code: 5)

@@ -59,14 +59,14 @@

failedToParseDate (code: 5)mustProvideElement (code: 6)mustProvideElement (code: 6)

An error when an element to attach to was not provided in the constructor.

-

subscribeMismatch (code: 7)subscribeMismatch (code: 7)

@@ -74,7 +74,7 @@

subscribeMismatch (code: 7)conflictingConfiguration (code: 8)conflictingConfiguration (code: 8)

@@ -82,7 +82,7 @@

conflictingConfiguration (code: 8) -

dateStringdateString

Logs a warning if a date option value is provided as a string, instead of @@ -94,7 +94,7 @@

dateStringError Messages

-

failedToSetInvalidDatefailedToSetInvalidDate

@@ -103,7 +103,7 @@

failedToSetInvalidDate -

failedToParseInputfailedToParseInput

diff --git a/src/docs/partials/namespace/events.html b/src/docs/partials/namespace/events.html index 2cd6d6080..7d71b8a23 100644 --- a/src/docs/partials/namespace/events.html +++ b/src/docs/partials/namespace/events.html @@ -16,7 +16,7 @@ } -

change.td change.td

Emit when the date selection is changed. @@ -31,7 +31,7 @@

change.td update.td

Emits when the view changes for example from month view to the year view. @@ -43,7 +43,7 @@

update.td error.td

Emits when a selected date or value from the input field fails to meet the provided validation rules. @@ -57,12 +57,12 @@

error.td show.td

Emits when then picker widget is displayed.

-

hide.td hide.td

Emits when the picker widget is hidden. diff --git a/src/docs/partials/options.html b/src/docs/partials/options.html index 4776a71c4..cccd4ba63 100644 --- a/src/docs/partials/options.html +++ b/src/docs/partials/options.html @@ -1,121 +1,134 @@ -

- Options can be provided during the inital setup through the constructor new tempusDominus.TempusDominus(..., - options);. Take a look at the examples for more information. -

-

- Options can be updated through the updateOptions function. -

-

- All options will throw typeMismatch if the - provided type - does not match the expected type, e.g. a string instead of a boolean. -

-
- While most of the date options accept string values it wil throw a warning. JavaScript's Date objects will be - converted - to the pickers DateTime object. -
- -
-
-
-
-

restrictions

-
-
-
-
-
-

minDate - -

-

- Accepts: string | Date | DateTime Defaults: undefined
- Prevents the user from selecting a date/time before this value. Set to undefined to remove - the - restriction. -

-

- Throws conflictingConfiguration if value is - after maxDate. -

-
-
-

maxDate

-

- Accepts: string | Date | DateTime Defaults: undefined
- Prevents the user from selecting a date/time after this value. Set to undefined to remove the - restriction. -

-

- Throws conflictingConfiguration if value is - after maxDate. -

-
-

enabledDates/disabledDates - -

-
- Accepts: array of string | Date | DateTime Defaults: undefined
-
- Use one or the other, don't provide both enabledDates and disabledDates. -
-
-
-
-

enabledDates

-

- Allows the user to select only from the provided days. Setting this takes precedence over - options.minDate, - options.maxDate configuration. -

-

disabledDates

-

- Disallows the user to select any of the provided days. Setting this takes precedence over - options.minDate, - options.maxDate configuration. -

-
-
-

enabledHours/disabledHours - -

-
- Accepts: array of number from 0-24 Defaults: undefined
-
- Use one or the other, don't provide both enabledHours and disabledHours. -
-

- Throws numbersOutOfRage any value is not between 0-23 -

-
-
-
-

enabledHours

-

- Allows the user to select only from the provided hours. -

-

disabledHours

-

- Disallows the user to select any of the provided hours. -

+

+ Options can be provided during the inital setup through the constructor new + tempusDominus.TempusDominus(..., + options);. Take a look at the examples for more information. +

+

+ Options can be updated through the updateOptions + function. +

+

+ All options will throw typeMismatch if the + provided type + does not match the expected type, e.g. a string instead of a boolean. +

+
+ While most of the date options accept string values it wil throw a warning. JavaScript's Date objects will be + converted + to the pickers DateTime object. +
+ +
+
+
+
+

restrictions

+
-
- -

disabledTimeIntervals - -

-

- Accepts: array of an object with from: DateTime, to: DateTime Defaults: - undefined
- Disables time selection between the given DateTimes. -

-
+            
+
+
+

minDate + +

+

+ Accepts: string | Date | DateTime Defaults: undefined
+ Prevents the user from selecting a date/time before this value. Set to + undefined to remove + the + restriction. +

+

+ Throws conflictingConfiguration + if value is + after maxDate. +

+
+
+

maxDate

+

+ Accepts: string | Date | DateTime Defaults: undefined
+ Prevents the user from selecting a date/time after this value. Set to undefined + to remove the + restriction. +

+

+ Throws conflictingConfiguration + if value is + after maxDate. +

+
+

enabledDates/disabledDates + +

+
+ Accepts: array of string | Date | DateTime Defaults: undefined
+
+ Use one or the other, don't provide both enabledDates and disabledDates. +
+
+
+
+

enabledDates

+

+ Allows the user to select only from the provided days. Setting this takes precedence + over + options.minDate, + options.maxDate configuration. +

+

disabledDates

+

+ Disallows the user to select any of the provided days. Setting this takes precedence + over + options.minDate, + options.maxDate configuration. +

+
+
+

enabledHours/disabledHours + +

+
+ Accepts: array of number from 0-24 Defaults: undefined
+
+ Use one or the other, don't provide both enabledHours and disabledHours. +
+

+ Throws numbersOutOfRage any value is + not between 0-23 +

+
+
+
+

enabledHours

+

+ Allows the user to select only from the provided hours. +

+

disabledHours

+

+ Disallows the user to select any of the provided hours. +

+
+
+ +

disabledTimeIntervals + +

+

+ Accepts: array of an object with from: DateTime, to: DateTime + Defaults: + undefined
+ Disables time selection between the given DateTimes. +

+
 
 const later = new tempusDominus.DateTime();
 later.hours = 8;
@@ -126,731 +139,737 @@ 

disabledTimeIntervals });

-

daysOfWeekDisabled - -

-

- Accepts: array of numbers from 0-6
- Disallow the user to select weekdays that exist in this array. This has lower priority over the - options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings. -

-

- Throws numbersOutOfRage any value is not between 0-6. -

-
-
-
-
-
-

display -

- -
-
-

toolbarPlacement

-
-

- Accepts: 'top' | 'bottom' Defaults: bottom
- Changes the placement of the toolbar where the today, clear, component switch icon are located. -

-

- Throws unexpectedOptionValue if value is not one - of the accepted values. -

+

daysOfWeekDisabled + +

+

+ Accepts: array of numbers from 0-6
+ Disallow the user to select weekdays that exist in this array. This has lower priority over the + options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration + settings. +

+

+ Throws numbersOutOfRage any value is not + between 0-6. +

+
+
- -

components

-

Accepts: true|false

- -

- These options turns on or off the particular views. If option is false for date the user would - only be able to select month and year - for instance. -

+
+
+

display +

-
-

calendar

-

- Defaults: true
- A convenience flag that can enable or disable all of the calendar components like date, month, year, - decades, century. - This flag must be true for any of the calendar components to be visible, even if those options are true. -

- -

date

-

- Defaults: true
- Date View -

- -

month -

-

- Defaults: true
- Month View - Turns on or off the month selection view. -

- -

year

-

- Defaults: true
- Year View -

- -

decades -

-

- Defaults: true
- Decade View -

- -

clock -

-

- Time View -

-

- Defaults: true
- A convenience flag that can enable or disable all of the calendar components like date, month, year, - decades, century. - This flag must be true for any of the calendar components to be visible, even if those options are true. -

- -

hours -

-

- Defaults: true
- Displayed above in red -

- -

minutes -

-

- Defaults: true
- Displayed above in purple -

- -

seconds -

-

- Defaults: false
- Displayed above in green -

- -

useTwentyfourHour

-

- Defaults: false
- Twenty-four View -

-
+
+

toolbarPlacement

+
+

+ Accepts: 'top' | 'bottom' Defaults: bottom
+ Changes the placement of the toolbar where the today, clear, component switch icon are located. +

+

+ Throws unexpectedOptionValue if value + is not one + of the accepted values. +

+
+ +

components

+

Accepts: true|false

+ +

+ These options turns on or off the particular views. If option is false for date the + user would + only be able to select month and year + for instance. +

+ +
+
+

calendar

+

+ Defaults: true
+ A convenience flag that can enable or disable all of the calendar components like date, + month, year, + decades, century. + This flag must be true for any of the calendar components to be visible, even if those + options are true. +

+ +

date

+

+ Defaults: true
+ Date View +

+ +

month +

+

+ Defaults: true
+ Month View + Turns on or off the month selection view. +

+ +

year

+

+ Defaults: true
+ Year View +

+ +

decades +

+

+ Defaults: true
+ Decade View +

+ +

clock +

+

+ Time View +

+

+ Defaults: true
+ A convenience flag that can enable or disable all the calendar components like date, + month, year, + decades, century. + This flag must be true for any of the calendar components to be visible, even if those + options are true. +

+ +

hours +

+

+ Defaults: true
+ Displayed above in red +

+ +

minutes +

+

+ Defaults: true
+ Displayed above in purple +

+ +

seconds +

+

+ Defaults: false
+ Displayed above in green +

+ +

useTwentyfourHour

+

+ Defaults: false
+ Twenty-four View +

+
+
+ +

buttons +

+

Accepts: true|false

+

+ Buttons +

+
+
+

today +

+

+ Defaults: false
+ Displayed above in red +

+ +

close +

+

+ Defaults: false
+ Displayed above in purple +

+ +

clear +

+

+ Defaults: false
+ Displayed above in green +

+ +
+
+

calendarWeeks

+

+ Accepts: true|false Defaults: false
+ Calendar View + Displays an additional column with the calendar week for that week. +

+ +

icons +

+

+ Accepts: string +

+

+ Any icon library that expects icons to be used like + <i class='fas fa-calendar'></i> will work, provided you include the + correct + styles and scripts needed. +

+

Icon sprites are also supported.

+
+
+

type

+

+ Accepts either "icons" or "sprites"
+ Defaults to "icons". If "sprites" is used as the value, the icons will be render with an svg + element + instead + of an "i" element. If you don't know which you should use, leave it as "icons". +

+ +

time

+

+ Defaults: (fas + fa-clock)
+ This icon is used to change the view from the calendar view to the clock view. +

+ +

date

+

+ Defaults: (fas + fa-calendar)
+ This icon is used to change the view from the clock view to the calendar view. +

+ +

up

+

+ Defaults: (fas + fa-arrow-up)
+ This icon is used to incremeant hours, minutes and seconds in the clock view. +

+ +

down

+

+ Defaults: (fas + fa-arrow-down)
+ This icon is used to decremeant hours, minutes and seconds in the clock view. +

+ +

next

+

+ Defaults: (fas + fa-chevron-right)
+ This icon is used to navigation forward in the calendar, month, year, and decade views. +

+ +

previous

+

+ Defaults: (fas + fa-chevron-left)
+ This icon is used to navigation backwards in the calendar, month, year, and decade views. +

+ +

today +

+

+ Defaults: + (fas fa-calendar-check)
+ This icon is used to change the date and view to now. +

+ +

clear +

+

+ Defaults: (fas + fa-trash)
+ This icon is used to clear the currently selected date. +

+ +

close +

+

+ Defaults: (fas + fa-times)
+ This icon is used to close the picker. +

+
+
+

viewMode

+

+ Accepts: 'clock' | 'calendar' | 'months' | 'years' | 'decades' + Defaults: + calendar
+ The default view when the picker is displayed. Set to "years" for a date of birth picker. +

+ +

sideBySide

+

+ Accepts: true|false Defaults: false
+ Side by Side View + Displays the date and time pickers side by side. +

+

inline +

+

+ Accepts: Defaults:boolean
+ Displays the picker in a inline div instead of a popup. +

+

keepOpen

+

+ Accepts: true|false Defaults: false
+ Keep the picker window open even after a date selection. The picker can still be closed by the + target or + clicking on on an outside element. This option will only work when time components are disabled. +

+
+
-

buttons -

-

Accepts: true|false

-

- Buttons -

-
-
-

today -

-

- Defaults: false
- Displayed above in red -

- -

close -

-

- Defaults: false
- Displayed above in purple -

- -

clear -

-

- Defaults: false
- Displayed above in green -

- -
-
-

calendarWeeks

-

- Accepts: true|false Defaults: false
- Calendar View - Displays an additional column with the calendar week for that week. -

- -

icons -

-

- Accepts: string -

-

- Any icon library that expects icons to be used like - <i class='fas fa-calendar'></i> will work, provided you include the correct - styles and scripts needed. -

-

Icon sprites are also supported.

-
-
-

type

-

- Accepts either "icons" or "sprites"
- Defaults to "icons". If "sprites" is used as the value, the icons will be render with an svg element - instead - of an "i" element. If you don't know which you should use, leave it as "icons". -

- -

time

-

- Defaults: (fas fa-clock)
- This icon is used to change the view from the calendar view to the clock view. -

- -

date

-

- Defaults: (fas fa-calendar)
- This icon is used to change the view from the clock view to the calendar view. -

- -

up

-

- Defaults: (fas fa-arrow-up)
- This icon is used to incremeant hours, minutes and seconds in the clock view. -

- -

down

-

- Defaults: (fas fa-arrow-down)
- This icon is used to decremeant hours, minutes and seconds in the clock view. -

- -

next

-

- Defaults: (fas fa-chevron-right)
- This icon is used to navigation forward in the calendar, month, year, and decade views. -

- -

previous

-

- Defaults: (fas fa-chevron-left)
- This icon is used to navigation backwards in the calendar, month, year, and decade views. -

- -

today -

-

- Defaults: (fas fa-calendar-check)
- This icon is used to change the date and view to now. -

- -

clear -

-

- Defaults: (fas fa-trash)
- This icon is used to clear the currently selected date. -

- -

close -

-

- Defaults: (fas fa-times)
- This icon is used to close the picker. -

-
-
-

viewMode

-

- Accepts: 'clock' | 'calendar' | 'months' | 'years' | 'decades' Defaults: - calendar
- The default view when the picker is displayed. Set to "years" for a date of birth picker. -

- -

sideBySide

-

- Accepts: true|false Defaults: false
- Side by Side View - Displays the date and time pickers side by side. -

-

inline -

-

- Accepts: Defaults:boolean
- Displays the picker in a inline div instead of a popup. -

-

keepOpen

-

- Accepts: true|false Defaults: false
- Keep the picker window open even after a date selection. The picker can still be closed by the target or - clicking on on an outside element. This option will only work when time components are disabled. -

-
-
-

-
-

hooks +

stepping

+

+ Accepts number Defaults: 1
+ Controls how much the minutes are changed by. This also changes the minute selection grid to step by this + amount. +

-
-
-

inputFormat -

-

- Accepts: (context: TempusDominus, date: DateTime) => string or undefined - Defaults: - undefined
- Takes a function that turns the selected date(s) into a string. If not provided, Intl formatting will be - used based on configured components. The complete context is provided so you can access the input field itself - via context.input or any of the validation methods and so on. -

-

- Whenever the picker attempts to set the input value from a selection, it will call this function. An example - that would set the value to an ISO string. Obviously, it's up to you how you want the results to be displayed. -

-
-
-inputFormat:(context, date) => { return date.toISOString() }
-
-        
-

inputParse -

-

- Accepts: (context: TempusDominus, value: any) => DateTime or undefined Defaults: - undefined
- Takes a function that turns the input value into a DateTime object. If not provided, the internal parsing - method will be used. The complete context is provided so you can access the input field itself - via context.input or any of the validation methods and so on. -

-

- Whenever the input value changes, this function will be called. The most simple example is just to attempt to - parse the string. -

-
-
-inputParse: (context, value) => { return new tempusDominus.DateTime(value) }
-
-        
-
-
-
-

stepping -

-

- Accepts number Defaults: 1
- Controls how much the minutes are changed by. This also changes the minute selection grid to step by this amount. -

- -

useCurrent

-

- Accepts true|false Defaults: true
- Determines if the current date/time should be used as the default value when the picker is opened. -

- -

defaultDate

-

- Accepts: string | Date | DateTime Defaults: undefined
- Sets the picker default date/time. Overrides useCurrent -

- -
-
-
-
-

localizationuseCurrent

-

- Accepts: string - Most of the localization options are for title tooltips over icons. -

-

- You can provide localization options to override the tooltips as well as the day/month display. -

-

- You could also set this globally via tempusDominus.DefaultOptions.localization = { ... } or by - creating a variable e.g. const ru = { today:'Перейти сегодня' ... }; then provide the options - as -

-
+    

+ Accepts true|false Defaults: true
+ Determines if the current date/time should be used as the default value when the picker is opened. +

+ +

defaultDate

+

+ Accepts: string | Date | DateTime Defaults: undefined
+ Sets the picker default date/time. Overrides useCurrent +

+ +
+
+
+
+

localization

+

+ Accepts: string + Most of the localization options are for title tooltips over icons. +

+

+ You can provide localization options to override the tooltips as well as the day/month display. +

+

+ You could also set this globally via tempusDominus.DefaultOptions.localization = { ... + } or by + creating a variable e.g. const ru = { today:'Перейти сегодня' ... }; then provide + the options + as +

+
          
  new tempusDominus.TempusDominus(document.getElementById('datetimepicker1'), {
    localization: ru
  }
          
      
+
+
+
+
+

today +

+

+ Defaults: Go to today
+

+ +

clear +

+

+ Defaults: Clear selection
+

+ +

close +

+

+ Defaults: Close the picker
+

+ +

selectMonth

+

+ Defaults: Select Month
+

+ +

previousMonth

+

+ Defaults: Previous Month
+

+ +

nextMonth

+

+ Defaults: Next Month
+

+ +

selectYear

+

+ Defaults: Select Year
+

+ +

previousYear

+

+ Defaults: Previous Year
+

+ +

nextYear

+

+ Defaults: Next Year
+

+ +

selectDecade

+

+ Defaults: Select Decade
+

+ +

previousDecade

+

+ Defaults: Previous Decade
+

+ +

nextDecade

+

+ Defaults: Next Decade
+

+ +

previousCentury

+

+ Defaults: Previous Century
+

+ +

nextCentury

+

+ Defaults: Next Century
+

+ +

pickHour

+

+ Defaults: Pick Hour
+

+ +

incrementHour

+

+ Defaults: Increment Hour
+

+ +

decrementHour

+

+ Defaults: Decrement Hour
+

+ +

pickMinute

+

+ Defaults: Pick Minute
+

+ +

incrementMinute

+

+ Defaults: Increment Minute
+

+ +

decrementMinute

+

+ Defaults: Decrement Minute
+

+ +

pickSecond

+

+ Defaults: Pick Second
+

+ +

incrementSecond

+

+ Defaults: Increment Second
+

+ +

decrementSecond

+

+ Defaults: Decrement Second
+

+ +

togglePeriod

+

+ Defaults: Toggle Period
+

+ +

selectTime

+

+ Defaults: Select Time
+

+ +

selectDate

+

+ Defaults: Select Date
+

+ +

dayViewHeaderFormat +

+

+ Accepts: DateTimeFormatOptions Defaults: + { month: 'long', year: '2-digit' }
+ This should be an appropriate value from the Intl.DateFormat options. +

+ +

locale +

+

+ Defaults: default
+ This should be a BCP 47 language tag or a value supported by Intl. +

+ +

startOfTheWeek +

+

+ Accepts: 0-6 Defaults: 0
+ Changes the start of the week to the provided index. Intl/Date does not provide apis to get the + locale's + start of the week. 0 = Sunday, 6 = Saturday. If you want the calendar view to start on Monday, + set this + option to 1. +

+
+
-
-
-
-

today -

-

- Defaults: Go to today
-

+
-

clear -

-

- Defaults: Clear selection
-

+

keepInvalid

+

+ Accepts true|false Defaults: false
+ Allows for the user to select a date that is invalid coording to the rules. For instance, if a user enters a + date + pasted the maxDate. +

+ +

debug

+

+ Accepts true|false Defaults: false
+ Similar to display.keepOpen, if true the picker won't close during any event where that would + normally + occur. This is useful when trying to debug rules or css changes. Note you can also use window.debug = + true in the dev tools console. Using the window object is useful for debugging deployed code without + requiring a configuration change. +

+ +

allowInputToggle

+

+ Accepts true|false Defaults: false
+ If true, the picker will show on textbox focus. +

-

close -

-

- Defaults: Close the picker
-

- -

selectMonth

-

- Defaults: Select Month
-

- -

previousMonth

-

- Defaults: Previous Month
-

- -

nextMonth

-

- Defaults: Next Month
-

- -

selectYear

-

- Defaults: Select Year
-

- -

previousYear

-

- Defaults: Previous Year
-

- -

nextYear

-

- Defaults: Next Year
-

- -

selectDecade

-

- Defaults: Select Decade
-

- -

previousDecade

-

- Defaults: Previous Decade
-

- -

nextDecade

-

- Defaults: Next Decade
-

- -

previousCentury

-

- Defaults: Previous Century
-

- -

nextCentury

-

- Defaults: Next Century
-

- -

pickHour

-

- Defaults: Pick Hour
-

- -

incrementHour

-

- Defaults: Increment Hour
-

- -

decrementHour

-

- Defaults: Decrement Hour
-

- -

pickMinute

-

- Defaults: Pick Minute
-

- -

incrementMinute

-

- Defaults: Increment Minute
-

- -

decrementMinute

-

- Defaults: Decrement Minute
-

- -

pickSecond

-

- Defaults: Pick Second
-

- -

incrementSecond

-

- Defaults: Increment Second
-

- -

decrementSecond

-

- Defaults: Decrement Second
-

- -

togglePeriod

-

- Defaults: Toggle Period
-

- -

selectTime

-

- Defaults: Select Time
-

- -

selectDate

-

- Defaults: Select Date
-

- -

dayViewHeaderFormatviewDate -

-

- Accepts: DateTimeFormatOptions Defaults: - { month: 'long', year: '2-digit' }
- This should be an appropriate value from the Intl.DateFormat options. -

- -

locale +

+ Accepts: string | Date | DateTime Defaults: now
+ Set the view date of the picer. Setting this will not change the selected date(s). +

+ +

multipleDates

+

+ Accepts true|false Defaults: false
+ Allows multiple dates to be selected. +

+ +

multipleDatesSeparator -

-

- Defaults: default
- This should be a BCP 47 language tag or a value supported by Intl. -

- -

startOfTheWeek +

+ Accepts: string Defaults: ;
+ When multipleDates is enabled, this value wil be used to separate the selected dates. E.g. 08/29/2021, + 12:00 AM; 08/30/2021, 12:00 AM; 08/23/2021, 12:00 AM +

+ +

promptTimeOnDateChange -

-

- Accepts: 0-6 Defaults: 0
- Changes the start of the week to the provided index. Intl/Date does not provide apis to get the locale's - start of the week. 0 = Sunday, 6 = Saturday. If you want the calendar view to start on Monday, set this - option to 1. -

-

-

-
-
- -

keepInvalid

-

- Accepts true|false Defaults: false
- Allows for the user to select a date that is invalid coording to the rules. For instance, if a user enters a date - pasted the maxDate. -

- -

debug

-

- Accepts true|false Defaults: false
- Similar to display.keepOpen, if true the picker won't close during any event where that would normally - occur. This is useful when trying to debug rules or css changes. Note you can also use window.debug = - true in the dev tools console. Using the window object is useful for debugging deployed code without - requiring a configuration change. -

- -

allowInputToggle

-

- Accepts true|false Defaults: false
- If true, the picker will show on textbox focus. -

- -

viewDate -

-

- Accepts: string | Date | DateTime Defaults: now
- Set the view date of the picer. Setting this will not change the selected date(s). -

- -

multipleDates

-

- Accepts true|false Defaults: false
- Allows multiple dates to be selected. -

- -

multipleDatesSeparator -

-

- Accepts: string Defaults: ;
- When multipleDates is enabled, this value wil be used to separate the selected dates. E.g. 08/29/2021, - 12:00 AM; 08/30/2021, 12:00 AM; 08/23/2021, 12:00 AM -

- -

promptTimeOnDateChange -

-

- Accepts true|false Defaults: false
- If enabled and any of the time components are enabled, when a user selects a date the picker will automatically - display the clock view after promptTimeOnDateChangeTransitionDelay. -

- -

promptTimeOnDateChangeTransitionDelay - - - -

-

- Accepts number Defaults: 200
- Used with promptTimeOnDateChange. The number of milliseconds before the picker will display the clock - view. -

- -

meta - - - -

-

- Accepts object Defaults: {}
- This property is to provide developers a place to store extra information about the picker. You can use this to store database format strings for instance. There are no rules on what you add to this object and the picker will not reference it. -

- -

container - - - -

-

- Accepts HTMLElement Defaults: undefined
- Change the target container to use for the widget instead of body (In case of application using shadow DOM for example). -

+

+

+ Accepts true|false Defaults: false
+ If enabled and any of the time components are enabled, when a user selects a date the picker will automatically + display the clock view after promptTimeOnDateChangeTransitionDelay. +

+ +

promptTimeOnDateChangeTransitionDelay + + + +

+

+ Accepts number Defaults: 200
+ Used with promptTimeOnDateChange. The number of milliseconds before the picker will display the + clock + view. +

+ +

meta + + + +

+

+ Accepts object Defaults: {}
+ This property is to provide developers a place to store extra information about the picker. You can use this to + store database format strings for instance. There are no rules on what you add to this object and the picker + will not reference it. +

+ +

container + + + +

+

+ Accepts HTMLElement Defaults: undefined
+ Change the target container to use for the widget instead of body (In case of application using + shadow DOM for example). +

- Options - 07/08/2021 - 07/08/2021 - How to use Tempus Dominus datetime picker - - datepicker, javascript, open source, tempus dominus, eonasdan + Options + 07/08/2021 + 07/08/2021 + How to use Tempus Dominus datetime picker + + datepicker, javascript, open source, tempus dominus, eonasdan diff --git a/src/docs/styles/bs5_docs.scss b/src/docs/styles/bs5_docs.scss index 391964391..a0d1ba3d4 100644 --- a/src/docs/styles/bs5_docs.scss +++ b/src/docs/styles/bs5_docs.scss @@ -506,7 +506,7 @@ } } -.anchorjs-link { +.anchor-link { font-size: 1.4rem; font-weight: 400; transition: color 0.15s ease-in-out; @@ -519,7 +519,7 @@ } @media (prefers-reduced-motion: reduce) { - .anchorjs-link { + .anchor-link { transition: none; } -} \ No newline at end of file +} diff --git a/src/docs/templates/index.html b/src/docs/templates/index.html index cdc00bcae..b827a7052 100644 --- a/src/docs/templates/index.html +++ b/src/docs/templates/index.html @@ -16,7 +16,7 @@

Powerful and robust date and time picker

Download

- Currently v6.0.0-beta5.1 + Currently v6.0.0-beta7 · v5 docs

diff --git a/src/js/actions.ts b/src/js/actions.ts index 5a79138e8..b0627b370 100644 --- a/src/js/actions.ts +++ b/src/js/actions.ts @@ -1,7 +1,6 @@ import {DateTime, Unit} from './datetime'; import Collapse from './display/collapse'; import Namespace from './utilities/namespace'; -import {OptionsStore} from './utilities/options'; import Dates from './dates'; import Validation from './validation'; import Display from './display'; @@ -9,6 +8,7 @@ import {EventEmitters} from './utilities/event-emitter'; import {serviceLocator} from './utilities/service-locator.js'; import ActionTypes from './utilities/action-types'; import CalendarModes from './utilities/calendar-modes'; +import {OptionsStore} from "./utilities/optionsStore"; /** * diff --git a/src/js/dates.ts b/src/js/dates.ts index edfb5f3d5..9b86c7e16 100644 --- a/src/js/dates.ts +++ b/src/js/dates.ts @@ -1,10 +1,11 @@ import { DateTime, getFormatByUnit, Unit } from './datetime'; import Namespace from './utilities/namespace'; import { ChangeEvent, FailEvent } from './utilities/event-types'; -import { OptionConverter, OptionsStore } from './utilities/options'; import Validation from './validation'; import { serviceLocator } from './utilities/service-locator'; import { EventEmitters } from './utilities/event-emitter'; +import {OptionsStore} from "./utilities/optionsStore"; +import {OptionConverter} from "./utilities/optionConverter"; export default class Dates { private _dates: DateTime[] = []; @@ -62,6 +63,14 @@ export default class Dates { hour12: !components.useTwentyfourHour, }); } + + /** + * parse the value into a DateTime object. + * this can be overwritten to supply your own parsing. + */ + parseInput(value:any): DateTime { + return OptionConverter.dateConversion(value, 'input'); + } /** * Tries to convert the provided value to a DateTime object. @@ -74,7 +83,7 @@ export default class Dates { this.setValue(undefined, index); return; } - const converted = OptionConverter.dateConversion(value, 'input'); + const converted = this.parseInput(value); if (converted) { converted.setLocale(this.optionsStore.options.localization.locale); this.setValue(converted, index); @@ -262,6 +271,7 @@ export default class Dates { isValid: false, } as ChangeEvent); } + this._eventEmitters.triggerEvent.emit({ type: Namespace.events.error, reason: Namespace.errorMessages.failedToSetInvalidDate, diff --git a/src/js/display/calendar/date-display.ts b/src/js/display/calendar/date-display.ts index 643f04a8f..dae81be79 100644 --- a/src/js/display/calendar/date-display.ts +++ b/src/js/display/calendar/date-display.ts @@ -1,11 +1,11 @@ import { DateTime, Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import Dates from '../../dates'; import { Paint } from '../index'; import { serviceLocator } from '../../utilities/service-locator'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `date` diff --git a/src/js/display/calendar/decade-display.ts b/src/js/display/calendar/decade-display.ts index 536689283..956a90810 100644 --- a/src/js/display/calendar/decade-display.ts +++ b/src/js/display/calendar/decade-display.ts @@ -1,11 +1,11 @@ import Dates from '../../dates'; import { DateTime, Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import { Paint } from '../index'; import { serviceLocator } from '../../utilities/service-locator'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `seconds` diff --git a/src/js/display/calendar/month-display.ts b/src/js/display/calendar/month-display.ts index 2a90aae14..b596751cb 100644 --- a/src/js/display/calendar/month-display.ts +++ b/src/js/display/calendar/month-display.ts @@ -1,11 +1,11 @@ import { Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import Dates from '../../dates'; import { Paint } from '../index'; import { serviceLocator } from '../../utilities/service-locator'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `month` diff --git a/src/js/display/calendar/year-display.ts b/src/js/display/calendar/year-display.ts index 2567c115c..ab166ded0 100644 --- a/src/js/display/calendar/year-display.ts +++ b/src/js/display/calendar/year-display.ts @@ -1,11 +1,11 @@ import { DateTime, Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; import Dates from '../../dates'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import { Paint } from '../index'; import { serviceLocator } from '../../utilities/service-locator'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `year` diff --git a/src/js/display/index.ts b/src/js/display/index.ts index d74b1898e..1a23c46bd 100644 --- a/src/js/display/index.ts +++ b/src/js/display/index.ts @@ -11,13 +11,13 @@ import { createPopper } from '@popperjs/core'; import Namespace from '../utilities/namespace'; import { HideEvent } from '../utilities/event-types'; import Collapse from './collapse'; -import { OptionsStore } from '../utilities/options'; import Validation from '../validation'; import Dates from '../dates'; import { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter'; import { serviceLocator } from '../utilities/service-locator'; import ActionTypes from '../utilities/action-types'; import CalendarModes from '../utilities/calendar-modes'; +import {OptionsStore} from "../utilities/optionsStore"; /** * Main class for all things display related. diff --git a/src/js/display/time/hour-display.ts b/src/js/display/time/hour-display.ts index 6a53e04d8..6d6293885 100644 --- a/src/js/display/time/hour-display.ts +++ b/src/js/display/time/hour-display.ts @@ -1,10 +1,10 @@ import { Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import { serviceLocator } from '../../utilities/service-locator'; import { Paint } from '../index'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `hours` diff --git a/src/js/display/time/minute-display.ts b/src/js/display/time/minute-display.ts index 12bb89afd..6cb3941fd 100644 --- a/src/js/display/time/minute-display.ts +++ b/src/js/display/time/minute-display.ts @@ -1,10 +1,10 @@ import { Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import { serviceLocator } from '../../utilities/service-locator'; import { Paint } from '../index'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `minutes` diff --git a/src/js/display/time/second-display.ts b/src/js/display/time/second-display.ts index c5a5b6a79..653a31861 100644 --- a/src/js/display/time/second-display.ts +++ b/src/js/display/time/second-display.ts @@ -1,10 +1,10 @@ import { Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import { serviceLocator } from '../../utilities/service-locator'; import { Paint } from '../index'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates and updates the grid for `seconds` diff --git a/src/js/display/time/time-display.ts b/src/js/display/time/time-display.ts index c70011113..0b26c64a6 100644 --- a/src/js/display/time/time-display.ts +++ b/src/js/display/time/time-display.ts @@ -1,10 +1,10 @@ import { Unit } from '../../datetime'; import Namespace from '../../utilities/namespace'; -import { OptionsStore } from '../../utilities/options'; import Validation from '../../validation'; import Dates from '../../dates'; import { serviceLocator } from '../../utilities/service-locator'; import ActionTypes from '../../utilities/action-types'; +import {OptionsStore} from "../../utilities/optionsStore"; /** * Creates the clock display diff --git a/src/js/jQuery-provider.js b/src/js/jQuery-provider.js index da6a6f51e..ccdb1d09d 100644 --- a/src/js/jQuery-provider.js +++ b/src/js/jQuery-provider.js @@ -1,9 +1,9 @@ /// -/*global $ */ +/*global $, tempusDominus */ /*! - * Tempus Dominus v6.0.0-beta5.1 (https://getdatepicker.com/) - * Copyright 2013-2021 [object Object] + * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) + * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ tempusDominus.jQueryInterface = function (option, argument) { @@ -145,9 +145,9 @@ $(document) } ); const name = 'tempusDominus'; +const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = tempusDominus.jQueryInterface; $.fn[name].Constructor = tempusDominus.TempusDominus; -const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name].noConflict = function () { $.fn[name] = JQUERY_NO_CONFLICT; return tempusDominus.jQueryInterface; diff --git a/src/js/tempus-dominus.ts b/src/js/tempus-dominus.ts index ade4aeb55..1a7ea128d 100644 --- a/src/js/tempus-dominus.ts +++ b/src/js/tempus-dominus.ts @@ -3,7 +3,7 @@ import Dates from './dates'; import Actions from './actions'; import { DateTime, DateTimeFormatOptions, Unit } from './datetime'; import Namespace from './utilities/namespace'; -import Options, { OptionConverter, OptionsStore } from './utilities/options'; +import Options from './utilities/options'; import { BaseEvent, ChangeEvent, @@ -17,6 +17,8 @@ import { import CalendarModes from './utilities/calendar-modes'; import DefaultOptions from './utilities/default-options'; import ActionTypes from './utilities/action-types'; +import {OptionsStore} from "./utilities/optionsStore"; +import {OptionConverter} from "./utilities/optionConverter"; /** * A robust and powerful date/time picker component. @@ -315,32 +317,33 @@ class TempusDominus { mergeTo: Options, includeDataset = false ): void { - config = OptionConverter._mergeOptions(config, mergeTo); + let newConfig = OptionConverter.deepCopy(config); + newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); if (includeDataset) - config = OptionConverter._dataToOptions( + newConfig = OptionConverter._dataToOptions( this.optionsStore.element, - config + newConfig ); - OptionConverter._validateConflicts(config); + OptionConverter._validateConflicts(newConfig); - config.viewDate = config.viewDate.setLocale(config.localization.locale); + newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale); - if (!this.optionsStore.viewDate.isSame(config.viewDate)) { - this.optionsStore.viewDate = config.viewDate; + if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) { + this.optionsStore.viewDate = newConfig.viewDate; } /** * Sets the minimum view allowed by the picker. For example the case of only * allowing year and month to be selected but not date. */ - if (config.display.components.year) { + if (newConfig.display.components.year) { this.optionsStore.minimumCalendarViewMode = 2; } - if (config.display.components.month) { + if (newConfig.display.components.month) { this.optionsStore.minimumCalendarViewMode = 1; } - if (config.display.components.date) { + if (newConfig.display.components.date) { this.optionsStore.minimumCalendarViewMode = 0; } @@ -352,10 +355,10 @@ class TempusDominus { // Update view mode if needed if ( CalendarModes[this.optionsStore.currentCalendarViewMode].name !== - config.display.viewMode + newConfig.display.viewMode ) { this.optionsStore.currentCalendarViewMode = Math.max( - CalendarModes.findIndex((x) => x.name === config.display.viewMode), + CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode ); } @@ -364,7 +367,7 @@ class TempusDominus { this.display._update('all'); } - this.optionsStore.options = config; + this.optionsStore.options = newConfig; } /** @@ -486,7 +489,7 @@ class TempusDominus { setViewDate(); } catch { console.warn( - 'TD: Something went wrong trying to set the multidate values from the input field.' + 'TD: Something went wrong trying to set the multipleDates values from the input field.' ); } } else { @@ -501,6 +504,7 @@ class TempusDominus { * @private */ private _toggleClickEvent = () => { + if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return this.toggle(); }; } diff --git a/src/js/utilities/errors.ts b/src/js/utilities/errors.ts index d139ac479..ee81b866f 100644 --- a/src/js/utilities/errors.ts +++ b/src/js/utilities/errors.ts @@ -86,7 +86,7 @@ export class ErrorMessages { /** * Throws an error when a value for a date options couldn't be parsed. Either - * the option was an invalide string or an invalid Date object. + * the option was an invalid string or an invalid Date object. * @param optionName * @param date * @param soft If true, logs a warning instead of an error. diff --git a/src/js/utilities/namespace.ts b/src/js/utilities/namespace.ts index f569fdcb7..6311606c8 100644 --- a/src/js/utilities/namespace.ts +++ b/src/js/utilities/namespace.ts @@ -1,7 +1,7 @@ import { ErrorMessages } from './errors'; // this is not the way I want this to stay but nested classes seemed to blown up once its compiled. const NAME = 'tempus-dominus', - version = '6.0.0-beta5.1', + version = '6.0.0-beta7', dataKey = 'td'; /** diff --git a/src/js/utilities/optionConverter.ts b/src/js/utilities/optionConverter.ts new file mode 100644 index 000000000..3a9b4938a --- /dev/null +++ b/src/js/utilities/optionConverter.ts @@ -0,0 +1,580 @@ +import Namespace from "./namespace"; +import {DateTime} from "../datetime"; +import DefaultOptions from "./default-options"; +import Options from "./options"; + +export class OptionConverter { + + private static ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; + + static deepCopy(input): Options { + const o = {}; + + Object.keys(input).forEach((key) => { + const inputElement = input[key]; + o[key] = inputElement; + if (typeof inputElement !== 'object' || + inputElement instanceof HTMLElement || + inputElement instanceof Element || + inputElement instanceof Date) return; + if (!Array.isArray(inputElement)) { + o[key] = OptionConverter.deepCopy(inputElement); + } + }); + + return o; + } + + private static isValue = a => a != null; // everything except undefined + null + + /** + * Finds value out of an object based on a string, period delimited, path + * @param paths + * @param obj + */ + static objectPath(paths: string, obj) { + if (paths.charAt(0) === '.') + paths = paths.slice(1); + return paths.split('.') + .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ? + value[key] : + undefined), obj); + } + + /** + * The spread operator caused sub keys to be missing after merging. + * This is to fix that issue by using spread on the child objects first. + * Also handles complex options like disabledDates + * @param provided An option from new providedOptions + * @param mergeOption Default option to compare types against + * @param copyTo Destination object. This was added to prevent reference copies + * @param path + * @param locale + */ + static spread(provided, mergeOption, copyTo, path = '', locale = '') { + const unsupportedOptions = Object.keys(provided).filter( + (x) => !Object.keys(mergeOption).includes(x) + ); + + if (unsupportedOptions.length > 0) { + const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); + + const errors = unsupportedOptions.map((x) => { + let error = `"${path}.${x}" in not a known option.`; + let didYouMean = flattenedOptions.find((y) => y.includes(x)); + if (didYouMean) error += `Did you mean "${didYouMean}"?`; + return error; + }); + Namespace.errorMessages.unexpectedOptions(errors); + } + + Object.keys(mergeOption).forEach((key) => { + path += `.${key}`; + if (path.charAt(0) === '.') path = path.slice(1); + + const defaultOptionValue = OptionConverter.objectPath(path, DefaultOptions); + let providedType = typeof provided[key]; + let defaultType = typeof defaultOptionValue; + let value = provided[key]; + + if (!provided.hasOwnProperty(key)) { + if ( + defaultType === 'undefined' || + (value?.length === 0 && Array.isArray(defaultOptionValue)) + ) { + copyTo[key] = defaultOptionValue; + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + provided[key] = defaultOptionValue; + value = provided[key]; + } + + copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale); + + if ( + typeof defaultOptionValue !== 'object' || + defaultOptionValue instanceof Date || + OptionConverter.ignoreProperties.includes(key) + ) { + path = path.substring(0, path.lastIndexOf(`.${key}`)); + return; + } + + if (!Array.isArray(provided[key])) { + OptionConverter.spread(provided[key], defaultOptionValue, copyTo[key], path, locale); + } + path = path.substring(0, path.lastIndexOf(`.${key}`)); + }); + } + + static processKey(key, value, providedType, defaultType, path, locale) { + switch (key) { + case 'defaultDate': { + const dateTime = this.dateConversion(value, 'defaultDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch( + 'defaultDate', + providedType, + 'DateTime or Date' + ); + break; + } + case 'viewDate': { + const dateTime = this.dateConversion(value, 'viewDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch( + 'viewDate', + providedType, + 'DateTime or Date' + ); + break; + } + case 'minDate': { + if (value === undefined) { + return value; + } + const dateTime = this.dateConversion(value, 'restrictions.minDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch( + 'restrictions.minDate', + providedType, + 'DateTime or Date' + ); + break; + } + case 'maxDate': { + if (value === undefined) { + return value; + } + const dateTime = this.dateConversion(value, 'restrictions.maxDate'); + if (dateTime !== undefined) { + dateTime.setLocale(locale); + return dateTime; + } + Namespace.errorMessages.typeMismatch( + 'restrictions.maxDate', + providedType, + 'DateTime or Date' + ); + break; + } + case 'disabledHours': + if (value === undefined) { + return []; + } + this._typeCheckNumberArray( + 'restrictions.disabledHours', + value, + providedType + ); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage( + 'restrictions.disabledHours', + 0, + 23 + ); + return value; + case 'enabledHours': + if (value === undefined) { + return []; + } + this._typeCheckNumberArray( + 'restrictions.enabledHours', + value, + providedType + ); + if (value.filter((x) => x < 0 || x > 24).length > 0) + Namespace.errorMessages.numbersOutOfRage( + 'restrictions.enabledHours', + 0, + 23 + ); + return value; + case 'daysOfWeekDisabled': + if (value === undefined) { + return []; + } + this._typeCheckNumberArray( + 'restrictions.daysOfWeekDisabled', + value, + providedType + ); + if (value.filter((x) => x < 0 || x > 6).length > 0) + Namespace.errorMessages.numbersOutOfRage( + 'restrictions.daysOfWeekDisabled', + 0, + 6 + ); + return value; + case 'enabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray( + 'restrictions.enabledDates', + value, + providedType, + locale + ); + return value; + case 'disabledDates': + if (value === undefined) { + return []; + } + this._typeCheckDateArray( + 'restrictions.disabledDates', + value, + providedType, + locale + ); + return value; + case 'disabledTimeIntervals': + if (value === undefined) { + return []; + } + if (!Array.isArray(value)) { + Namespace.errorMessages.typeMismatch( + key, + providedType, + 'array of { from: DateTime|Date, to: DateTime|Date }' + ); + } + const valueObject = value as { from: any; to: any }[]; + for (let i = 0; i < valueObject.length; i++) { + Object.keys(valueObject[i]).forEach((vk) => { + const subOptionName = `${key}[${i}].${vk}`; + let d = valueObject[i][vk]; + const dateTime = this.dateConversion(d, subOptionName); + if (!dateTime) { + Namespace.errorMessages.typeMismatch( + subOptionName, + typeof d, + 'DateTime or Date' + ); + } + dateTime.setLocale(locale); + valueObject[i][vk] = dateTime; + }); + } + return valueObject; + case 'toolbarPlacement': + case 'type': + case 'viewMode': + const optionValues = { + toolbarPlacement: ['top', 'bottom', 'default'], + type: ['icons', 'sprites'], + viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + }; + const keyOptions = optionValues[key]; + if (!keyOptions.includes(value)) + Namespace.errorMessages.unexpectedOptionValue( + path.substring(1), + value, + keyOptions + ); + + return value; + case 'meta': + case 'dayViewHeaderFormat': + return value; + case 'container': + if ( + value && + !( + value instanceof HTMLElement || + value instanceof Element || + value?.appendChild + ) + ) { + Namespace.errorMessages.typeMismatch( + path.substring(1), + typeof value, + 'HTMLElement' + ); + } + return value; + default: + switch (defaultType) { + case 'boolean': + return value === 'true' || value === true; + case 'number': + return +value; + case 'string': + return value.toString(); + case 'object': + return {}; + case 'function': + return value; + default: + Namespace.errorMessages.typeMismatch( + path, + providedType, + defaultType + ); + } + } + } + + static _mergeOptions(providedOptions: Options, mergeTo: Options): Options { + const newOptions = {} as Options; + + //see if the options specify a locale + const locale = + mergeTo.localization.locale !== 'default' + ? mergeTo.localization.locale + : providedOptions?.localization?.locale || 'default'; + + OptionConverter.spread(providedOptions, mergeTo, newOptions, '', locale); + + return newOptions; + } + + static _dataToOptions(element, options: Options): Options { + const eData = JSON.parse(JSON.stringify(element.dataset)); + + if (eData?.tdTargetInput) delete eData.tdTargetInput; + if (eData?.tdTargetToggle) delete eData.tdTargetToggle; + + if ( + !eData || + Object.keys(eData).length === 0 || + eData.constructor !== DOMStringMap + ) + return options; + let dataOptions = {} as Options; + + // because dataset returns camelCase including the 'td' key the option + // key won't align + const objectToNormalized = (object) => { + const lowered = {}; + Object.keys(object).forEach((x) => { + lowered[x.toLowerCase()] = x; + }); + + return lowered; + }; + + const rabbitHole = ( + split: string[], + index: number, + optionSubgroup: {}, + value: any + ) => { + // first round = display { ... } + const normalizedOptions = objectToNormalized(optionSubgroup); + + const keyOption = normalizedOptions[split[index].toLowerCase()]; + const internalObject = {}; + + if (keyOption === undefined) return internalObject; + + // if this is another object, continue down the rabbit hole + if (optionSubgroup[keyOption].constructor === Object) { + index++; + internalObject[keyOption] = rabbitHole( + split, + index, + optionSubgroup[keyOption], + value + ); + } else { + internalObject[keyOption] = value; + } + return internalObject; + }; + const optionsLower = objectToNormalized(options); + + Object.keys(eData) + .filter((x) => x.startsWith(Namespace.dataKey)) + .map((x) => x.substring(2)) + .forEach((key) => { + let keyOption = optionsLower[key.toLowerCase()]; + + // dataset merges dashes to camelCase... yay + // i.e. key = display_components_seconds + if (key.includes('_')) { + // [display, components, seconds] + const split = key.split('_'); + // display + keyOption = optionsLower[split[0].toLowerCase()]; + if ( + keyOption !== undefined && + options[keyOption].constructor === Object + ) { + dataOptions[keyOption] = rabbitHole( + split, + 1, + options[keyOption], + eData[`td${key}`] + ); + } + } + // or key = multipleDate + else if (keyOption !== undefined) { + dataOptions[keyOption] = eData[`td${key}`]; + } + }); + + return this._mergeOptions(dataOptions, options); + } + + /** + * Attempts to prove `d` is a DateTime or Date or can be converted into one. + * @param d If a string will attempt creating a date from it. + * @private + */ + static _dateTypeCheck(d: any): DateTime | null { + if (d.constructor.name === DateTime.name) return d; + if (d.constructor.name === Date.name) { + return DateTime.convert(d); + } + if (typeof d === typeof '') { + const dateTime = new DateTime(d); + if (JSON.stringify(dateTime) === 'null') { + return null; + } + return dateTime; + } + return null; + } + + /** + * Type checks that `value` is an array of Date or DateTime + * @param optionName Provides text to error messages e.g. disabledDates + * @param value Option value + * @param providedType Used to provide text to error messages + * @param locale + */ + static _typeCheckDateArray( + optionName: string, + value, + providedType: string, + locale: string = 'default' + ) { + if (!Array.isArray(value)) { + Namespace.errorMessages.typeMismatch( + optionName, + providedType, + 'array of DateTime or Date' + ); + } + for (let i = 0; i < value.length; i++) { + let d = value[i]; + const dateTime = this.dateConversion(d, optionName); + if (!dateTime) { + Namespace.errorMessages.typeMismatch( + optionName, + typeof d, + 'DateTime or Date' + ); + } + dateTime.setLocale(locale); + value[i] = dateTime; + } + } + + /** + * Type checks that `value` is an array of numbers + * @param optionName Provides text to error messages e.g. disabledDates + * @param value Option value + * @param providedType Used to provide text to error messages + */ + static _typeCheckNumberArray( + optionName: string, + value, + providedType: string + ) { + if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) { + Namespace.errorMessages.typeMismatch( + optionName, + providedType, + 'array of numbers' + ); + } + } + + /** + * Attempts to convert `d` to a DateTime object + * @param d value to convert + * @param optionName Provides text to error messages e.g. disabledDates + */ + static dateConversion(d: any, optionName: string): DateTime { + if (typeof d === typeof '' && optionName !== 'input') { + Namespace.errorMessages.dateString(); + } + + const converted = this._dateTypeCheck(d); + + if (!converted) { + Namespace.errorMessages.failedToParseDate( + optionName, + d, + optionName === 'input' + ); + } + return converted; + } + + private static _flattenDefaults: string[]; + + private static getFlattenDefaultOptions(): string[] { + if (this._flattenDefaults) return this._flattenDefaults; + const deepKeys = (t, pre = []) => { + if (Array.isArray(t)) return []; + if (Object(t) === t) { + return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])); + } else { + return pre.join('.'); + } + }; + + this._flattenDefaults = deepKeys(DefaultOptions); + + return this._flattenDefaults; + } + + /** + * Some options conflict like min/max date. Verify that these kinds of options + * are set correctly. + * @param config + */ + static _validateConflicts(config: Options) { + if ( + config.display.sideBySide && + (!config.display.components.clock || + !( + config.display.components.hours || + config.display.components.minutes || + config.display.components.seconds + )) + ) { + Namespace.errorMessages.conflictingConfiguration( + 'Cannot use side by side mode without the clock components' + ); + } + + if (config.restrictions.minDate && config.restrictions.maxDate) { + if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) { + Namespace.errorMessages.conflictingConfiguration( + 'minDate is after maxDate' + ); + } + + if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) { + Namespace.errorMessages.conflictingConfiguration( + 'maxDate is before minDate' + ); + } + } + } +} diff --git a/src/js/utilities/options.ts b/src/js/utilities/options.ts index 346c0d2b8..6a3ef266e 100644 --- a/src/js/utilities/options.ts +++ b/src/js/utilities/options.ts @@ -1,651 +1,92 @@ -import { DateTime, DateTimeFormatOptions } from '../datetime'; -import Namespace from './namespace'; +import {DateTime, DateTimeFormatOptions} from '../datetime'; import ViewMode from './view-mode'; -import CalendarModes from './calendar-modes'; -import DefaultOptions from './default-options'; - -export class OptionsStore { - options: Options; - element: HTMLElement; - viewDate = new DateTime(); - input: HTMLInputElement; - unset: boolean; - private _currentCalendarViewMode = 0; - get currentCalendarViewMode() { - return this._currentCalendarViewMode; - } - - set currentCalendarViewMode(value) { - this._currentCalendarViewMode = value; - this.currentView = CalendarModes[value].name; - } - - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView() { - this.currentView = CalendarModes[this.currentCalendarViewMode].name; - } - - minimumCalendarViewMode = 0; - currentView: keyof ViewMode = 'calendar'; -} export default interface Options { - restrictions?: { - minDate?: DateTime; - maxDate?: DateTime; - enabledDates?: DateTime[]; - disabledDates?: DateTime[]; - enabledHours?: number[]; - disabledHours?: number[]; - disabledTimeIntervals?: { from: DateTime; to: DateTime }[]; - daysOfWeekDisabled?: number[]; - }; - display?: { - toolbarPlacement?: 'top' | 'bottom'; - components?: { - calendar?: boolean; - date?: boolean; - month?: boolean; - year?: boolean; - decades?: boolean; - clock?: boolean; - hours?: boolean; - minutes?: boolean; - seconds?: boolean; - useTwentyfourHour?: boolean; - }; - buttons?: { today?: boolean; close?: boolean; clear?: boolean }; - calendarWeeks?: boolean; - icons?: { - date?: string; - next?: string; - previous?: string; - today?: string; - clear?: string; - time?: string; - up?: string; - type?: 'icons' | 'sprites'; - down?: string; - close?: string; + restrictions?: { + minDate?: DateTime; + maxDate?: DateTime; + enabledDates?: DateTime[]; + disabledDates?: DateTime[]; + enabledHours?: number[]; + disabledHours?: number[]; + disabledTimeIntervals?: { from: DateTime; to: DateTime }[]; + daysOfWeekDisabled?: number[]; }; - viewMode: keyof ViewMode | undefined; - sideBySide?: boolean; - inline?: boolean; - keepOpen?: boolean; - }; - stepping?: number; - useCurrent?: boolean; - defaultDate?: DateTime; - localization?: { - nextMonth?: string; - pickHour?: string; - incrementSecond?: string; - nextDecade?: string; - selectDecade?: string; - dayViewHeaderFormat?: DateTimeFormatOptions; - decrementHour?: string; - selectDate?: string; - incrementHour?: string; - previousCentury?: string; - decrementSecond?: string; - today?: string; - previousMonth?: string; - selectYear?: string; - pickSecond?: string; - nextCentury?: string; - close?: string; - incrementMinute?: string; - selectTime?: string; - clear?: string; - toggleMeridiem?: string; - selectMonth?: string; - decrementMinute?: string; - pickMinute?: string; - nextYear?: string; - previousYear?: string; - previousDecade?: string; - locale?: string; - startOfTheWeek?: number; - }; - keepInvalid?: boolean; - debug?: boolean; - allowInputToggle?: boolean; - viewDate?: DateTime; - multipleDates?: boolean; - multipleDatesSeparator?: string; - promptTimeOnDateChange?: boolean; - promptTimeOnDateChangeTransitionDelay?: number; - meta?: {}; - container?: HTMLElement; -} - -export class OptionConverter { - static _mergeOptions(providedOptions: Options, mergeTo: Options): Options { - const newOptions = {} as Options; - let path = ''; - const ignoreProperties = ['meta', 'dayViewHeaderFormat', 'container']; - - //see if the options specify a locale - const locale = - mergeTo.localization.locale !== 'default' - ? mergeTo.localization.locale - : providedOptions?.localization?.locale || 'default'; - - const processKey = (key, value, providedType, defaultType) => { - switch (key) { - case 'defaultDate': { - const dateTime = this.dateConversion(value, 'defaultDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch( - 'defaultDate', - providedType, - 'DateTime or Date' - ); - break; - } - case 'viewDate': { - const dateTime = this.dateConversion(value, 'viewDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch( - 'viewDate', - providedType, - 'DateTime or Date' - ); - break; - } - case 'minDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.minDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch( - 'restrictions.minDate', - providedType, - 'DateTime or Date' - ); - break; - } - case 'maxDate': { - if (value === undefined) { - return value; - } - const dateTime = this.dateConversion(value, 'restrictions.maxDate'); - if (dateTime !== undefined) { - dateTime.setLocale(locale); - return dateTime; - } - Namespace.errorMessages.typeMismatch( - 'restrictions.maxDate', - providedType, - 'DateTime or Date' - ); - break; - } - case 'disabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray( - 'restrictions.disabledHours', - value, - providedType - ); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage( - 'restrictions.disabledHours', - 0, - 23 - ); - return value; - case 'enabledHours': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray( - 'restrictions.enabledHours', - value, - providedType - ); - if (value.filter((x) => x < 0 || x > 24).length > 0) - Namespace.errorMessages.numbersOutOfRage( - 'restrictions.enabledHours', - 0, - 23 - ); - return value; - case 'daysOfWeekDisabled': - if (value === undefined) { - return []; - } - this._typeCheckNumberArray( - 'restrictions.daysOfWeekDisabled', - value, - providedType - ); - if (value.filter((x) => x < 0 || x > 6).length > 0) - Namespace.errorMessages.numbersOutOfRage( - 'restrictions.daysOfWeekDisabled', - 0, - 6 - ); - return value; - case 'enabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray( - 'restrictions.enabledDates', - value, - providedType, - locale - ); - return value; - case 'disabledDates': - if (value === undefined) { - return []; - } - this._typeCheckDateArray( - 'restrictions.disabledDates', - value, - providedType, - locale - ); - return value; - case 'disabledTimeIntervals': - if (value === undefined) { - return []; - } - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch( - key, - providedType, - 'array of { from: DateTime|Date, to: DateTime|Date }' - ); - } - const valueObject = value as { from: any; to: any }[]; - for (let i = 0; i < valueObject.length; i++) { - Object.keys(valueObject[i]).forEach((vk) => { - const subOptionName = `${key}[${i}].${vk}`; - let d = valueObject[i][vk]; - const dateTime = this.dateConversion(d, subOptionName); - if (!dateTime) { - Namespace.errorMessages.typeMismatch( - subOptionName, - typeof d, - 'DateTime or Date' - ); - } - dateTime.setLocale(locale); - valueObject[i][vk] = dateTime; - }); - } - return valueObject; - case 'toolbarPlacement': - case 'type': - case 'viewMode': - const optionValues = { - toolbarPlacement: ['top', 'bottom', 'default'], - type: ['icons', 'sprites'], - viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], - }; - const keyOptions = optionValues[key]; - if (!keyOptions.includes(value)) - Namespace.errorMessages.unexpectedOptionValue( - path.substring(1), - value, - keyOptions - ); - - return value; - case 'meta': - case 'dayViewHeaderFormat': - return value; - case 'container': - if ( - value && - !( - value instanceof HTMLElement || - value instanceof Element || - value?.appendChild - ) - ) { - Namespace.errorMessages.typeMismatch( - path.substring(1), - typeof value, - 'HTMLElement' - ); - } - return value; - default: - switch (defaultType) { - case 'boolean': - return value === 'true' || value === true; - case 'number': - return +value; - case 'string': - return value.toString(); - case 'object': - return {}; - case 'function': - return value; - default: - Namespace.errorMessages.typeMismatch( - path.substring(1), - providedType, - defaultType - ); - } - } - }; - - /** - * The spread operator caused sub keys to be missing after merging. - * This is to fix that issue by using spread on the child objects first. - * Also handles complex options like disabledDates - * @param provided An option from new providedOptions - * @param mergeOption Default option to compare types against - * @param copyTo Destination object. This was added to prevent reference copies - */ - const spread = (provided, mergeOption, copyTo) => { - const unsupportedOptions = Object.keys(provided).filter( - (x) => !Object.keys(mergeOption).includes(x) - ); - if (unsupportedOptions.length > 0) { - const flattenedOptions = OptionConverter.getFlattenDefaultOptions(); - - const errors = unsupportedOptions.map((x) => { - let error = `"${path.substring(1)}.${x}" in not a known option.`; - let didYouMean = flattenedOptions.find((y) => y.includes(x)); - if (didYouMean) error += `Did you mean "${didYouMean}"?`; - return error; - }); - Namespace.errorMessages.unexpectedOptions(errors); - } - Object.keys(mergeOption).forEach((key) => { - const defaultOptionValue = mergeOption[key]; - let providedType = typeof provided[key]; - let defaultType = typeof defaultOptionValue; - let value = provided[key]; - if (!provided.hasOwnProperty(key)) { - if ( - defaultType === 'undefined' || - (value?.length === 0 && Array.isArray(defaultOptionValue)) - ) { - copyTo[key] = defaultOptionValue; - return; - } - provided[key] = defaultOptionValue; - value = provided[key]; - } - path += `.${key}`; - copyTo[key] = processKey(key, value, providedType, defaultType); - - if ( - typeof defaultOptionValue !== 'object' || - ignoreProperties.includes(key) - ) { - path = path.substring(0, path.lastIndexOf(`.${key}`)); - return; - } - if (!Array.isArray(provided[key])) { - spread(provided[key], defaultOptionValue, copyTo[key]); - path = path.substring(0, path.lastIndexOf(`.${key}`)); - } - path = path.substring(0, path.lastIndexOf(`.${key}`)); - }); - }; - spread(providedOptions, mergeTo, newOptions); - - return newOptions; - } - - static _dataToOptions(element, options: Options): Options { - const eData = JSON.parse(JSON.stringify(element.dataset)); - - if (eData?.tdTargetInput) delete eData.tdTargetInput; - if (eData?.tdTargetToggle) delete eData.tdTargetToggle; - - if ( - !eData || - Object.keys(eData).length === 0 || - eData.constructor !== DOMStringMap - ) - return options; - let dataOptions = {} as Options; - - // because dataset returns camelCase including the 'td' key the option - // key won't align - const objectToNormalized = (object) => { - const lowered = {}; - Object.keys(object).forEach((x) => { - lowered[x.toLowerCase()] = x; - }); - - return lowered; + display?: { + toolbarPlacement?: 'top' | 'bottom'; + components?: { + calendar?: boolean; + date?: boolean; + month?: boolean; + year?: boolean; + decades?: boolean; + clock?: boolean; + hours?: boolean; + minutes?: boolean; + seconds?: boolean; + useTwentyfourHour?: boolean; + }; + buttons?: { today?: boolean; close?: boolean; clear?: boolean }; + calendarWeeks?: boolean; + icons?: { + date?: string; + next?: string; + previous?: string; + today?: string; + clear?: string; + time?: string; + up?: string; + type?: 'icons' | 'sprites'; + down?: string; + close?: string; + }; + viewMode?: keyof ViewMode; + sideBySide?: boolean; + inline?: boolean; + keepOpen?: boolean; }; - - const rabbitHole = ( - split: string[], - index: number, - optionSubgroup: {}, - value: any - ) => { - // first round = display { ... } - const normalizedOptions = objectToNormalized(optionSubgroup); - - const keyOption = normalizedOptions[split[index].toLowerCase()]; - const internalObject = {}; - - if (keyOption === undefined) return internalObject; - - // if this is another object, continue down the rabbit hole - if (optionSubgroup[keyOption].constructor === Object) { - index++; - internalObject[keyOption] = rabbitHole( - split, - index, - optionSubgroup[keyOption], - value - ); - } else { - internalObject[keyOption] = value; - } - return internalObject; + stepping?: number; + useCurrent?: boolean; + defaultDate?: DateTime; + localization?: { + nextMonth?: string; + pickHour?: string; + incrementSecond?: string; + nextDecade?: string; + selectDecade?: string; + dayViewHeaderFormat?: DateTimeFormatOptions; + decrementHour?: string; + selectDate?: string; + incrementHour?: string; + previousCentury?: string; + decrementSecond?: string; + today?: string; + previousMonth?: string; + selectYear?: string; + pickSecond?: string; + nextCentury?: string; + close?: string; + incrementMinute?: string; + selectTime?: string; + clear?: string; + toggleMeridiem?: string; + selectMonth?: string; + decrementMinute?: string; + pickMinute?: string; + nextYear?: string; + previousYear?: string; + previousDecade?: string; + locale?: string; + startOfTheWeek?: number; }; - const optionsLower = objectToNormalized(options); - - Object.keys(eData) - .filter((x) => x.startsWith(Namespace.dataKey)) - .map((x) => x.substring(2)) - .forEach((key) => { - let keyOption = optionsLower[key.toLowerCase()]; - - // dataset merges dashes to camelCase... yay - // i.e. key = display_components_seconds - if (key.includes('_')) { - // [display, components, seconds] - const split = key.split('_'); - // display - keyOption = optionsLower[split[0].toLowerCase()]; - if ( - keyOption !== undefined && - options[keyOption].constructor === Object - ) { - dataOptions[keyOption] = rabbitHole( - split, - 1, - options[keyOption], - eData[`td${key}`] - ); - } - } - // or key = multipleDate - else if (keyOption !== undefined) { - dataOptions[keyOption] = eData[`td${key}`]; - } - }); - - return this._mergeOptions(dataOptions, options); - } - - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @private - */ - static _dateTypeCheck(d: any): DateTime | null { - if (d.constructor.name === DateTime.name) return d; - if (d.constructor.name === Date.name) { - return DateTime.convert(d); - } - if (typeof d === typeof '') { - const dateTime = new DateTime(d); - if (JSON.stringify(dateTime) === 'null') { - return null; - } - return dateTime; - } - return null; - } - - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param locale - */ - static _typeCheckDateArray( - optionName: string, - value, - providedType: string, - locale: string = 'default' - ) { - if (!Array.isArray(value)) { - Namespace.errorMessages.typeMismatch( - optionName, - providedType, - 'array of DateTime or Date' - ); - } - for (let i = 0; i < value.length; i++) { - let d = value[i]; - const dateTime = this.dateConversion(d, optionName); - if (!dateTime) { - Namespace.errorMessages.typeMismatch( - optionName, - typeof d, - 'DateTime or Date' - ); - } - dateTime.setLocale(locale); - value[i] = dateTime; - } - } - - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray( - optionName: string, - value, - providedType: string - ) { - if (!Array.isArray(value) || value.find((x) => typeof x !== typeof 0)) { - Namespace.errorMessages.typeMismatch( - optionName, - providedType, - 'array of numbers' - ); - } - } - - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - */ - static dateConversion(d: any, optionName: string): DateTime { - if (typeof d === typeof '' && optionName !== 'input') { - Namespace.errorMessages.dateString(); - } - - const converted = this._dateTypeCheck(d); - - if (!converted) { - Namespace.errorMessages.failedToParseDate( - optionName, - d, - optionName === 'input' - ); - } - return converted; - } - - private static _flattenDefaults: string[]; - - private static getFlattenDefaultOptions(): string[] { - if (this._flattenDefaults) return this._flattenDefaults; - const deepKeys = (t, pre = []) => - Array.isArray(t) - ? [] - : Object(t) === t - ? Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k])) - : pre.join('.'); - - this._flattenDefaults = deepKeys(DefaultOptions); - - return this._flattenDefaults; - } - - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config: Options) { - if ( - config.display.sideBySide && - (!config.display.components.clock || - !( - config.display.components.hours || - config.display.components.minutes || - config.display.components.seconds - )) - ) { - Namespace.errorMessages.conflictingConfiguration( - 'Cannot use side by side mode without the clock components' - ); - } - - if (config.restrictions.minDate && config.restrictions.maxDate) { - if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) { - Namespace.errorMessages.conflictingConfiguration( - 'minDate is after maxDate' - ); - } - - if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) { - Namespace.errorMessages.conflictingConfiguration( - 'maxDate is before minDate' - ); - } - } - } + keepInvalid?: boolean; + debug?: boolean; + allowInputToggle?: boolean; + viewDate?: DateTime; + multipleDates?: boolean; + multipleDatesSeparator?: string; + promptTimeOnDateChange?: boolean; + promptTimeOnDateChangeTransitionDelay?: number; + meta?: {}; + container?: HTMLElement; } diff --git a/src/js/utilities/optionsStore.ts b/src/js/utilities/optionsStore.ts new file mode 100644 index 000000000..292e73425 --- /dev/null +++ b/src/js/utilities/optionsStore.ts @@ -0,0 +1,32 @@ +import {DateTime} from "../datetime"; +import CalendarModes from "./calendar-modes"; +import ViewMode from "./view-mode"; +import Options from "./options"; + +export class OptionsStore { + options: Options; + element: HTMLElement; + viewDate = new DateTime(); + input: HTMLInputElement; + unset: boolean; + private _currentCalendarViewMode = 0; + get currentCalendarViewMode() { + return this._currentCalendarViewMode; + } + + set currentCalendarViewMode(value) { + this._currentCalendarViewMode = value; + this.currentView = CalendarModes[value].name; + } + + /** + * When switching back to the calendar from the clock, + * this sets currentView to the correct calendar view. + */ + refreshCurrentView() { + this.currentView = CalendarModes[this.currentCalendarViewMode].name; + } + + minimumCalendarViewMode = 0; + currentView: keyof ViewMode = 'calendar'; +} diff --git a/src/js/validation.ts b/src/js/validation.ts index 0266f8720..5d8686585 100644 --- a/src/js/validation.ts +++ b/src/js/validation.ts @@ -1,6 +1,6 @@ import { DateTime, getFormatByUnit, Unit } from './datetime'; -import { OptionsStore } from './utilities/options'; import { serviceLocator } from './utilities/service-locator'; +import {OptionsStore} from "./utilities/optionsStore"; /** * Main class for date validation rules based on the options provided. diff --git a/types/dates.d.ts b/types/dates.d.ts index 6a8bdd0e0..2a88d7c82 100644 --- a/types/dates.d.ts +++ b/types/dates.d.ts @@ -22,6 +22,11 @@ export default class Dates { * @param date */ formatInput(date: DateTime): string; + /** + * parse the value into a DateTime object. + * this can be overwritten to supply your own parsing. + */ + parseInput(value: any): DateTime; /** * Tries to convert the provided value to a DateTime object. * If value is null|undefined then clear the value of the provided index (or 0). diff --git a/types/utilities/errors.d.ts b/types/utilities/errors.d.ts index 4b60781e1..09cbab8d9 100644 --- a/types/utilities/errors.d.ts +++ b/types/utilities/errors.d.ts @@ -41,7 +41,7 @@ export declare class ErrorMessages { numbersOutOfRage(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 invalide string or an invalid Date object. + * the option was an invalid string or an invalid Date object. * @param optionName * @param date * @param soft If true, logs a warning instead of an error. diff --git a/types/utilities/optionConverter.d.ts b/types/utilities/optionConverter.d.ts new file mode 100644 index 000000000..1c713ef19 --- /dev/null +++ b/types/utilities/optionConverter.d.ts @@ -0,0 +1,62 @@ +import { DateTime } from "../datetime"; +import Options from "./options"; +export declare class OptionConverter { + private static ignoreProperties; + static deepCopy(input: any): Options; + private static isValue; + /** + * Finds value out of an object based on a string, period delimited, path + * @param paths + * @param obj + */ + static objectPath(paths: string, obj: any): any; + /** + * The spread operator caused sub keys to be missing after merging. + * This is to fix that issue by using spread on the child objects first. + * Also handles complex options like disabledDates + * @param provided An option from new providedOptions + * @param mergeOption Default option to compare types against + * @param copyTo Destination object. This was added to prevent reference copies + * @param path + * @param locale + */ + static spread(provided: any, mergeOption: any, copyTo: any, path?: string, locale?: string): void; + static processKey(key: any, value: any, providedType: any, defaultType: any, path: any, locale: any): any; + static _mergeOptions(providedOptions: Options, mergeTo: Options): Options; + static _dataToOptions(element: any, options: Options): Options; + /** + * Attempts to prove `d` is a DateTime or Date or can be converted into one. + * @param d If a string will attempt creating a date from it. + * @private + */ + static _dateTypeCheck(d: any): DateTime | null; + /** + * Type checks that `value` is an array of Date or DateTime + * @param optionName Provides text to error messages e.g. disabledDates + * @param value Option value + * @param providedType Used to provide text to error messages + * @param locale + */ + static _typeCheckDateArray(optionName: string, value: any, providedType: string, locale?: string): void; + /** + * Type checks that `value` is an array of numbers + * @param optionName Provides text to error messages e.g. disabledDates + * @param value Option value + * @param providedType Used to provide text to error messages + */ + static _typeCheckNumberArray(optionName: string, value: any, providedType: string): void; + /** + * Attempts to convert `d` to a DateTime object + * @param d value to convert + * @param optionName Provides text to error messages e.g. disabledDates + */ + static dateConversion(d: any, optionName: string): DateTime; + private static _flattenDefaults; + private static getFlattenDefaultOptions; + /** + * Some options conflict like min/max date. Verify that these kinds of options + * are set correctly. + * @param config + */ + static _validateConflicts(config: Options): void; +} diff --git a/types/utilities/options.d.ts b/types/utilities/options.d.ts index ec1a805cf..9bcfa2444 100644 --- a/types/utilities/options.d.ts +++ b/types/utilities/options.d.ts @@ -1,22 +1,5 @@ import { DateTime, DateTimeFormatOptions } from '../datetime'; import ViewMode from './view-mode'; -export declare class OptionsStore { - options: Options; - element: HTMLElement; - viewDate: DateTime; - input: HTMLInputElement; - unset: boolean; - private _currentCalendarViewMode; - get currentCalendarViewMode(): number; - set currentCalendarViewMode(value: number); - /** - * When switching back to the calendar from the clock, - * this sets currentView to the correct calendar view. - */ - refreshCurrentView(): void; - minimumCalendarViewMode: number; - currentView: keyof ViewMode; -} export default interface Options { restrictions?: { minDate?: DateTime; @@ -63,7 +46,7 @@ export default interface Options { down?: string; close?: string; }; - viewMode: keyof ViewMode | undefined; + viewMode?: keyof ViewMode; sideBySide?: boolean; inline?: boolean; keepOpen?: boolean; @@ -113,42 +96,3 @@ export default interface Options { meta?: {}; container?: HTMLElement; } -export declare class OptionConverter { - static _mergeOptions(providedOptions: Options, mergeTo: Options): Options; - static _dataToOptions(element: any, options: Options): Options; - /** - * Attempts to prove `d` is a DateTime or Date or can be converted into one. - * @param d If a string will attempt creating a date from it. - * @private - */ - static _dateTypeCheck(d: any): DateTime | null; - /** - * Type checks that `value` is an array of Date or DateTime - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - * @param locale - */ - static _typeCheckDateArray(optionName: string, value: any, providedType: string, locale?: string): void; - /** - * Type checks that `value` is an array of numbers - * @param optionName Provides text to error messages e.g. disabledDates - * @param value Option value - * @param providedType Used to provide text to error messages - */ - static _typeCheckNumberArray(optionName: string, value: any, providedType: string): void; - /** - * Attempts to convert `d` to a DateTime object - * @param d value to convert - * @param optionName Provides text to error messages e.g. disabledDates - */ - static dateConversion(d: any, optionName: string): DateTime; - private static _flattenDefaults; - private static getFlattenDefaultOptions; - /** - * Some options conflict like min/max date. Verify that these kinds of options - * are set correctly. - * @param config - */ - static _validateConflicts(config: Options): void; -} diff --git a/types/utilities/optionsStore.d.ts b/types/utilities/optionsStore.d.ts new file mode 100644 index 000000000..fcba667bd --- /dev/null +++ b/types/utilities/optionsStore.d.ts @@ -0,0 +1,20 @@ +import { DateTime } from "../datetime"; +import ViewMode from "./view-mode"; +import Options from "./options"; +export declare class OptionsStore { + options: Options; + element: HTMLElement; + viewDate: DateTime; + input: HTMLInputElement; + unset: boolean; + private _currentCalendarViewMode; + get currentCalendarViewMode(): number; + set currentCalendarViewMode(value: number); + /** + * When switching back to the calendar from the clock, + * this sets currentView to the correct calendar view. + */ + refreshCurrentView(): void; + minimumCalendarViewMode: number; + currentView: keyof ViewMode; +}