diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 1929acb68..ede9258eb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -39,5 +39,3 @@ git checkout development # all patches against development branch, please! | docs | Builds the docs. | | docs-watch | Watches for changes to the docs files. | | release-version | Creates a new release version. | - -**All PR's MUST pass tests in place** diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index e6ad14e4e..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Tell us about a bug you might have found. -title: '' -labels: '' -assignees: '' - ---- - -Before opening: -- Please read this [blog post](https://eonasdan.com/posts/state-of-my-picker). -- [Search for duplicate or closed issues](https://github.com/eonasdan/tempus-dominus/issues?utf8=%E2%9C%93&q=is%3Aissue) -- Read the [contributing guidelines](https://github.com/eonasdan/tempus-dominus/blob/main/.github/CONTRIBUTING.md) - -Bug reports must include: - -- Operating system and version (Windows, macOS, Android, iOS) -- Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser) -- Version of the plugin. There is no support for version 3, 4 or 5. -- A test and or fork [this StackBlitz](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup) - -# Issues that do not fork one of the following stackblitz projects will be closed! - -* [Basic](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup) - -* [Dev branch](https://stackblitz.com/edit/tempus-dominus-v6-next) - -* [Typescript](https://stackblitz.com/edit/v6-typescript) - -* [Using import](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-import) - -* [jQuery](https://stackblitz.com/edit/tempus-dominus-v6-simple-jquery-setup) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..f0b7e3626 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,68 @@ +name: Report a bug +description: Tell us about your issue. +title: "Provide a general summary of the issue" +assignees: "-" +body: + - type: checkboxes + attributes: + label: Prerequisites + description: Take a couple minutes to help our maintainers work faster. + options: + - label: I have [searched](https://github.com/Eonasdan/tempus-dominus/issues?q=is%3Aissue) for duplicate or closed issues. + required: true + - label: I have validated my setup against the latest version on [StackBlitz](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup). + required: true + - label: I have read the [contributing guidelines](https://github.com/Eonasdan/tempus-dominus/blob/master/.github/CONTRIBUTING.md). + required: true + - type: textarea + id: what-happened + attributes: + label: Describe the issue + description: Provide a summary of the issue and what you expected to happen, including specific steps to reproduce. + validations: + required: true + - type: textarea + id: reduced-test-case + attributes: + label: StackBlitz fork + description: You MUST provide an StackBlitz fork of one of the following examples:: [HTML](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup), [Dev branch](https://stackblitz.com/edit/tempus-dominus-v6-next), [Typescript](https://stackblitz.com/edit/v6-typescript), [Using import](https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-import), or [jQuery](https://stackblitz.com/edit/tempus-dominus-v6-simple-jquery-setup). + validations: + required: true + - type: dropdown + id: os + attributes: + label: What operating system(s) are you seeing the problem on? + multiple: true + options: + - Windows + - macOS + - Android + - iOS + - Linux + validations: + required: true + - type: dropdown + id: browser + attributes: + label: What browser(s) are you seeing the problem on? + multiple: true + options: + - Chrome + - Safari + - Firefox + - Microsoft Edge + - Opera + - type: input + id: version + attributes: + label: What version of are you using? You can find this information from the sample StackBlitz. + placeholder: "e.g., v5.1.0 or v4.5.2" + validations: + required: true + - type: input + id: locale + attributes: + label: What your browser's locale? You can find this information from the sample StackBlitz. + placeholder: "e.g., 'en-US'" + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 73b5af17f..3485ff41d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,6 @@ contact_links: - name: Ask a question - url: https://github.com/Eonasdan/tempus-dominus/discussions + url: https://github.com/Eonasdan/tempus-dominus/discussions/new about: Ask and discuss questions with other community members + - name: Join the discord + url: https://discord.gg/BHS9jw9YPf diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index fecc73e3e..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for a new feature in Tempus Dominus. -title: '' -labels: "feature request" -assignees: '' - ---- - -Before opening: - -- Please read this [blog post](https://eonasdan.com/posts/state-of-my-picker). -- [Search for duplicate or closed issues](https://github.com/eonasdan/tempus-dominus/issues?utf8=%E2%9C%93&q=is%3Aissue) -- Read the [contributing guidelines](https://github.com/eonasdan/tempus-dominus/blob/main/.github/CONTRIBUTING.md) - -Feature requests must include: - -- As much detail as possible for what we should add and why it's important to Tempus Dominus -- Relevant links to prior art, screenshots, or live demos whenever possible diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..35ef44078 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,29 @@ +name: Feature request +description: Suggest new or updated features. +title: "Suggest a new feature" +labels: ["Type: feature request"] +assignees: [] +body: + - type: checkboxes + attributes: + label: Prerequisites + description: Take a couple minutes to help our maintainers work faster. + options: + - label: I have [searched](https://github.com/Eonasdan/tempus-dominus/issues?q=label%3A%22Type%3A+feature+request%22+) for duplicate or closed feature requests. + required: true + - label: I have read the [contributing guidelines](https://github.com/Eonasdan/tempus-dominus/blob/master/.github/CONTRIBUTING.md). + required: true + - type: textarea + id: proposal + attributes: + label: Proposal + description: Provide detailed information for what we should add, including relevant links to prior art, screenshots, or live demos whenever possible. + validations: + required: true + - type: textarea + id: motivation + attributes: + label: Motivation and context + description: Tell us why this change is needed or helpful, and what problems it may help solve. + validations: + required: true diff --git a/.gitignore b/.gitignore index ed9d188c6..74dd2d334 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,6 @@ site *.nupkg src/docs/partials/examples/test.html /docs/ -/dist/plugins/examples/ \ No newline at end of file +/dist/plugins/examples/ + +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index de314a8ee..224f432e8 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-beta8 +# Tempus Dominus Date/Time Picker v6.0.0-beta9 Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions. diff --git a/build/change-version.js b/build/change-version.js index 7b335f06f..17e86f9af 100644 --- a/build/change-version.js +++ b/build/change-version.js @@ -18,7 +18,7 @@ const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-r // These are the filetypes we only care about replacing the version const GLOB = [ - '**/*.{css,html,js,json,md,scss,txt,yml,ts}' + '**/*.{css,html,js,json,md,scss,txt,yml,ts,nuspec}' ] const GLOBBY_OPTIONS = { cwd: path.join(__dirname, '..'), @@ -78,4 +78,4 @@ async function main(args) { } } -main(process.argv.slice(2)) \ No newline at end of file +main(process.argv.slice(2)) diff --git a/build/rollup.config.js b/build/rollup.config.js index b6e0849f2..415cae796 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -65,7 +65,7 @@ export default [ plugins: [terser()] }, { - input: 'src/sass/tempus-dominus.scss', + input: 'src/scss/tempus-dominus.scss', output: [ { banner, @@ -80,7 +80,7 @@ export default [ ] }, { - input: 'src/sass/tempus-dominus.scss', + input: 'src/scss/tempus-dominus.scss', output: [ { banner, diff --git a/dist/css/tempus-dominus.css b/dist/css/tempus-dominus.css index 6aedb4765..75f85e80f 100644 --- a/dist/css/tempus-dominus.css +++ b/dist/css/tempus-dominus.css @@ -16,7 +16,6 @@ width: 19rem; border-radius: 4px; display: none; - background-color: #fff; z-index: 9999; box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12); } @@ -35,7 +34,6 @@ } .tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover { background: none; - color: #6c757d; cursor: not-allowed; } .tempus-dominus-widget .arrow { @@ -121,9 +119,6 @@ box-sizing: border-box; display: flex; } -.tempus-dominus-widget .toolbar div:hover { - background: #e9ecef; -} .tempus-dominus-widget .date-container-days { display: grid; grid-template-areas: "a a a a a a a"; @@ -131,7 +126,6 @@ grid-auto-columns: 14.2857142857%; } .tempus-dominus-widget .date-container-days .dow { - color: rgba(0, 0, 0, 0.5); align-items: center; justify-content: center; text-align: center; @@ -144,15 +138,18 @@ display: flex; font-size: 0.8em; line-height: 20px; - color: rgba(0, 0, 0, 0.38); cursor: default; } -.tempus-dominus-widget .date-container-decades, .tempus-dominus-widget .date-container-years, .tempus-dominus-widget .date-container-months { +.tempus-dominus-widget .date-container-decades, +.tempus-dominus-widget .date-container-years, +.tempus-dominus-widget .date-container-months { display: grid; grid-template-areas: "a a a"; grid-auto-rows: calc((19rem - 8px) / 7); } -.tempus-dominus-widget .time-container-hour, .tempus-dominus-widget .time-container-minute, .tempus-dominus-widget .time-container-second { +.tempus-dominus-widget .time-container-hour, +.tempus-dominus-widget .time-container-minute, +.tempus-dominus-widget .time-container-second { display: grid; grid-template-areas: "a a a a"; grid-auto-rows: calc((19rem - 8px) / 7); @@ -168,8 +165,14 @@ justify-content: center; display: flex; } -.tempus-dominus-widget .date-container-decades div:not(.no-highlight), .tempus-dominus-widget .date-container-years div:not(.no-highlight), .tempus-dominus-widget .date-container-months div:not(.no-highlight), .tempus-dominus-widget .date-container-days div:not(.no-highlight), -.tempus-dominus-widget .time-container-clock div:not(.no-highlight), .tempus-dominus-widget .time-container-hour div:not(.no-highlight), .tempus-dominus-widget .time-container-minute div:not(.no-highlight), .tempus-dominus-widget .time-container-second div:not(.no-highlight) { +.tempus-dominus-widget .date-container-decades div:not(.no-highlight), +.tempus-dominus-widget .date-container-years div:not(.no-highlight), +.tempus-dominus-widget .date-container-months div:not(.no-highlight), +.tempus-dominus-widget .date-container-days div:not(.no-highlight), +.tempus-dominus-widget .time-container-clock div:not(.no-highlight), +.tempus-dominus-widget .time-container-hour div:not(.no-highlight), +.tempus-dominus-widget .time-container-minute div:not(.no-highlight), +.tempus-dominus-widget .time-container-second div:not(.no-highlight) { width: 90%; height: 90%; border-radius: 999px; @@ -178,49 +181,46 @@ box-sizing: border-box; display: flex; } -.tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight):hover, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight):hover { - background: #e9ecef; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active { - background-color: #0d6efd; - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new { - color: #fff; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before { - border-bottom-color: #fff; -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).new, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).new { - color: rgba(0, 0, 0, 0.38); -} -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, +.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, +.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, +.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover { +.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, +.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, +.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, +.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover { background: none; - color: #6c757d; cursor: not-allowed; } -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today { +.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today, +.tempus-dominus-widget .date-container-years div:not(.no-highlight).today, +.tempus-dominus-widget .date-container-months div:not(.no-highlight).today, +.tempus-dominus-widget .date-container-days div:not(.no-highlight).today, +.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today, +.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today, +.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today, +.tempus-dominus-widget .time-container-second div:not(.no-highlight).today { position: relative; } -.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before { +.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, +.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, +.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, +.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before, +.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, +.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, +.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, +.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before { content: ""; display: inline-block; border: solid transparent; border-width: 0 0 7px 7px; - border-bottom-color: #0d6efd; - border-top-color: rgba(0, 0, 0, 0.2); position: absolute; bottom: 6px; right: 6px; @@ -229,9 +229,6 @@ margin-bottom: 0.5rem; } .tempus-dominus-widget button { - color: #fff; - background-color: #0d6efd; - border-color: #0d6efd; display: inline-block; font-weight: 400; line-height: 1.5; @@ -280,62 +277,234 @@ .tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover { background: none; } - -@media (prefers-color-scheme: dark) { - .tempus-dominus-widget { - color: #e3e3e3; - background-color: #1b1b1b; - } - .tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover { - color: #6c757d; - } - .tempus-dominus-widget .toolbar div:hover { - background: #232627; - } - .tempus-dominus-widget .date-container-days .dow { - color: rgba(232, 230, 227, 0.5); - } - .tempus-dominus-widget .date-container-days .cw { - color: rgba(232, 230, 227, 0.38); - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight):hover, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight):hover { - background: #232627; - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active { - background-color: #4db2ff; - color: #fff; - text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25); - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new { - color: #fff; - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before { - border-bottom-color: #1b1b1b; - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).new, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).new { - color: rgba(232, 230, 227, 0.38); - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover { - color: #6c757d; - } - .tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before, -.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before { - border-bottom-color: #4db2ff; - border-top-color: rgba(232, 230, 227, 0.2); - } - .tempus-dominus-widget button { - color: #fff; - background-color: #4db2ff; - border-color: #4db2ff; - } +.tempus-dominus-widget.light { + color: #000; + background-color: #fff; +} +.tempus-dominus-widget.light [data-action].disabled, .tempus-dominus-widget.light [data-action].disabled:hover { + color: #6c757d; +} +.tempus-dominus-widget.light .toolbar div:hover { + background: #e9ecef; +} +.tempus-dominus-widget.light .date-container-days .dow { + color: rgba(0, 0, 0, 0.5); +} +.tempus-dominus-widget.light .date-container-days .cw { + color: rgba(0, 0, 0, 0.38); +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover { + background: #e9ecef; +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active { + background-color: #0d6efd; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new { + color: #fff; +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before { + border-bottom-color: #fff; +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new { + color: rgba(0, 0, 0, 0.38); +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover { + color: #6c757d; +} +.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before, +.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before { + border-bottom-color: #0d6efd; + border-top-color: rgba(0, 0, 0, 0.2); +} +.tempus-dominus-widget.light button { + color: #fff; + background-color: #0d6efd; + border-color: #0d6efd; +} +.tempus-dominus-widget.dark { + color: #e3e3e3; + background-color: #1b1b1b; +} +.tempus-dominus-widget.dark [data-action].disabled, .tempus-dominus-widget.dark [data-action].disabled:hover { + color: #6c757d; +} +.tempus-dominus-widget.dark .toolbar div:hover { + background: #232627; +} +.tempus-dominus-widget.dark .date-container-days .dow { + color: rgba(232, 230, 227, 0.5); +} +.tempus-dominus-widget.dark .date-container-days .cw { + color: rgba(232, 230, 227, 0.38); +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover { + background: #232627; +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active { + background-color: #4db2ff; + color: #fff; + text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25); +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new { + color: #fff; +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before { + border-bottom-color: #1b1b1b; +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new { + color: rgba(232, 230, 227, 0.38); +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover { + color: #6c757d; +} +.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before, +.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before { + border-bottom-color: #4db2ff; + border-top-color: rgba(232, 230, 227, 0.2); +} +.tempus-dominus-widget.dark button { + color: #fff; + background-color: #4db2ff; + border-color: #4db2ff; } /*# sourceMappingURL=tempus-dominus.css.map */ \ No newline at end of file diff --git a/dist/css/tempus-dominus.css.map b/dist/css/tempus-dominus.css.map index 878ede7c4..fc88490bc 100644 --- a/dist/css/tempus-dominus.css.map +++ b/dist/css/tempus-dominus.css.map @@ -1 +1 @@ -{"version":3,"sources":["tempus-dominus.scss"],"names":[],"mappings":"AAAA;EACE,6BAA6B;EAC7B,qBAAqB;EACrB,sBAAsB;EACtB,qBAAqB;EACrB,uBAAuB;EACvB,2BAA2B;EAC3B,iCAAiC;EACjC,8BAA8B;EAC9B,oBAAoB;AACtB;;AAEA;EACE,gBAAgB;EAChB,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,sBAAsB;EACtB,aAAa;EACb,gHAAgH;AAClH;AACA;EACE,YAAY;AACd;AACA;EACE,wBAAwB;EACxB,sCAAsC;AACxC;AACA;EACE,eAAe;AACjB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,gBAAgB;EAChB,cAAc;EACd,mBAAmB;AACrB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;EACE,aAAa;AACf;AACA;EACE,SAAS;EACT,gBAAgB;EAChB,6BAA6B;AAC/B;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;EACd,UAAU;AACZ;AACA;EACE,gBAAgB;AAClB;AACA;;;EAGE,WAAW;EACX,iBAAiB;EACjB,gBAAgB;EAChB,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,aAAa;EACb,4BAA4B;EAC5B,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,iBAAiB;EACjB,mBAAmB;AACrB;AACA;EACE,gBAAgB;E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EAChB,gBAAgB;EAChB,kBAAkB;EAClB,qBAAqB;EACrB,sBAAsB;EACtB,eAAe;EACf,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EACjB,yBAAyB;EACzB,eAAe;EACf,sBAAsB;EACtB,qIAAqI;AACvI;AACA;;;;;;;;;;;;;;EAcE,oBAAoB;EACpB,eAAe;AACjB;AACA;;;;;;;;;;;;;;EAcE,gBAAgB;AAClB;;AAEA;EACE;IACE,cAAc;IACd,yBAAyB;EAC3B;EACA;IACE,cAAc;EAChB;EACA;IACE,mBAAmB;EACrB;EACA;IACE,+BAA+B;EACjC;EACA;IACE,gCAAgC;EAClC;EACA;;IAEE,mBAAmB;EACrB;EACA;;IAEE,yBAAyB;IACzB,WAAW;IACX,+CAA+C;EACjD;EACA;;;IAGE,WAAW;EACb;EACA;;IAEE,4BAA4B;EAC9B;EACA;;;IAGE,gCAAgC;EAClC;EACA;;;IAGE,cAAc;EAChB;EACA;;IAEE,4BAA4B;IAC5B,0CAA0C;EAC5C;EACA;IACE,WAAW;IACX,yBAAyB;IACzB,qBAAqB;EACvB;AACF","file":"tempus-dominus.css","sourcesContent":[".visually-hidden, .tempus-dominus-widget [data-action]::after {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n}\n\n.tempus-dominus-widget {\n list-style: none;\n padding: 4px;\n width: 19rem;\n border-radius: 4px;\n display: none;\n background-color: #fff;\n z-index: 9999;\n box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);\n}\n.tempus-dominus-widget.calendarWeeks {\n width: 21rem;\n}\n.tempus-dominus-widget.calendarWeeks .date-container-days {\n grid-auto-columns: 12.5%;\n grid-template-areas: \"a a a a a a a a\";\n}\n.tempus-dominus-widget [data-action] {\n cursor: pointer;\n}\n.tempus-dominus-widget [data-action]::after {\n content: attr(title);\n}\n.tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover {\n background: none;\n color: #6c757d;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .arrow {\n display: none;\n}\n.tempus-dominus-widget.show {\n display: block;\n}\n.tempus-dominus-widget .td-collapse:not(.show) {\n display: none;\n}\n.tempus-dominus-widget .td-collapsing {\n height: 0;\n overflow: hidden;\n transition: height 0.35s ease;\n}\n@media (min-width: 576px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 768px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 992px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n.tempus-dominus-widget.timepicker-sbs .td-row {\n display: flex;\n}\n.tempus-dominus-widget.timepicker-sbs .td-row .td-half {\n flex: 0 0 auto;\n width: 50%;\n}\n.tempus-dominus-widget div[data-action]:active {\n box-shadow: none;\n}\n.tempus-dominus-widget .timepicker-hour,\n.tempus-dominus-widget .timepicker-minute,\n.tempus-dominus-widget .timepicker-second {\n width: 54px;\n font-weight: bold;\n font-size: 1.2em;\n margin: 0;\n}\n.tempus-dominus-widget button[data-action] {\n padding: 6px;\n}\n.tempus-dominus-widget .toggleMeridiem {\n text-align: center;\n height: 38px;\n}\n.tempus-dominus-widget .calendar-header {\n display: grid;\n grid-template-areas: \"a a a\";\n margin-bottom: 10px;\n font-weight: bold;\n}\n.tempus-dominus-widget .calendar-header .next {\n text-align: right;\n padding-right: 10px;\n}\n.tempus-dominus-widget .calendar-header .previous {\n text-align: left;\n padding-left: 10px;\n}\n.tempus-dominus-widget .calendar-header .picker-switch {\n text-align: center;\n}\n.tempus-dominus-widget .toolbar {\n display: grid;\n grid-auto-flow: column;\n grid-auto-rows: 40px;\n}\n.tempus-dominus-widget .toolbar div {\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .toolbar div:hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget .date-container-days {\n display: grid;\n grid-template-areas: \"a a a a a a a\";\n grid-auto-rows: 40px;\n grid-auto-columns: 14.2857142857%;\n}\n.tempus-dominus-widget .date-container-days .dow {\n color: rgba(0, 0, 0, 0.5);\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n.tempus-dominus-widget .date-container-days .cw {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n font-size: 0.8em;\n line-height: 20px;\n color: rgba(0, 0, 0, 0.38);\n cursor: default;\n}\n.tempus-dominus-widget .date-container-decades, .tempus-dominus-widget .date-container-years, .tempus-dominus-widget .date-container-months {\n display: grid;\n grid-template-areas: \"a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-hour, .tempus-dominus-widget .time-container-minute, .tempus-dominus-widget .time-container-second {\n display: grid;\n grid-template-areas: \"a a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock {\n display: grid;\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock .no-highlight {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight), .tempus-dominus-widget .date-container-years div:not(.no-highlight), .tempus-dominus-widget .date-container-months div:not(.no-highlight), .tempus-dominus-widget .date-container-days div:not(.no-highlight),\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight), .tempus-dominus-widget .time-container-hour div:not(.no-highlight), .tempus-dominus-widget .time-container-minute div:not(.no-highlight), .tempus-dominus-widget .time-container-second div:not(.no-highlight) {\n width: 90%;\n height: 90%;\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight):hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active {\n background-color: #0d6efd;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new {\n color: #fff;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #fff;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).new {\n color: rgba(0, 0, 0, 0.38);\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover {\n background: none;\n color: #6c757d;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today {\n position: relative;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before {\n content: \"\";\n display: inline-block;\n border: solid transparent;\n border-width: 0 0 7px 7px;\n border-bottom-color: #0d6efd;\n border-top-color: rgba(0, 0, 0, 0.2);\n position: absolute;\n bottom: 6px;\n right: 6px;\n}\n.tempus-dominus-widget .time-container {\n margin-bottom: 0.5rem;\n}\n.tempus-dominus-widget button {\n color: #fff;\n background-color: #0d6efd;\n border-color: #0d6efd;\n display: inline-block;\n font-weight: 400;\n line-height: 1.5;\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod] {\n pointer-events: none;\n cursor: default;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover {\n background: none;\n}\n\n@media (prefers-color-scheme: dark) {\n .tempus-dominus-widget {\n color: #e3e3e3;\n background-color: #1b1b1b;\n }\n .tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover {\n color: #6c757d;\n }\n .tempus-dominus-widget .toolbar div:hover {\n background: #232627;\n }\n .tempus-dominus-widget .date-container-days .dow {\n color: rgba(232, 230, 227, 0.5);\n }\n .tempus-dominus-widget .date-container-days .cw {\n color: rgba(232, 230, 227, 0.38);\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight):hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight):hover {\n background: #232627;\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active {\n background-color: #4db2ff;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25);\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new {\n color: #fff;\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #1b1b1b;\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).new, .tempus-dominus-widget .date-container-years div:not(.no-highlight).old, .tempus-dominus-widget .date-container-years div:not(.no-highlight).new, .tempus-dominus-widget .date-container-months div:not(.no-highlight).old, .tempus-dominus-widget .date-container-months div:not(.no-highlight).new, .tempus-dominus-widget .date-container-days div:not(.no-highlight).old, .tempus-dominus-widget .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).old, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).new, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).old, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).new, .tempus-dominus-widget .time-container-second div:not(.no-highlight).old, .tempus-dominus-widget .time-container-second div:not(.no-highlight).new {\n color: rgba(232, 230, 227, 0.38);\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled, .tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover {\n color: #6c757d;\n }\n .tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before, .tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before, .tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before {\n border-bottom-color: #4db2ff;\n border-top-color: rgba(232, 230, 227, 0.2);\n }\n .tempus-dominus-widget button {\n color: #fff;\n background-color: #4db2ff;\n border-color: #4db2ff;\n }\n}"]} \ No newline at end of file +{"version":3,"sources":["tempus-dominus.scss"],"names":[],"mappings":"AAAA;EACE,6BAA6B;EAC7B,qBAAqB;EACrB,sBAAsB;EACtB,qBAAqB;EACrB,uBAAuB;EACvB,2BAA2B;EAC3B,iCAAiC;EACjC,8BAA8B;EAC9B,oBAAoB;AACtB;;AAEA;EACE,gBAAgB;EAChB,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,aAAa;EACb,gHAAgH;AAClH;AACA;EACE,YAAY;AACd;AACA;EACE,wBAAwB;EACxB,sCAAsC;AACxC;AACA;EACE,eAAe;AACjB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;EACE,aAAa;AACf;AACA;EACE,SAAS;EACT,gBAAgB;EAChB,6BAA6B;AAC/B;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE;IACE,WAAW;EACb;AACF;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;EACd,UAAU;AACZ;AACA;EACE,gBAAgB;AAClB;AACA;;;EAGE,WAAW;EACX,iBAAiB;EACjB,gBAAgB;EAChB,SAAS;AACX;AACA;EACE,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,aAAa;EACb,4BAA4B;EAC5B,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,iBAAiB;EACjB,mBAAmB;AACrB;AACA;EACE,gBAAgB;EAChB,kBAAkB;AACpB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,aAAa;EACb,sBAAsB;EACtB,oBAAoB;AACtB;AACA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;AACf;AACA;EACE,aAAa;EACb,oCAAoC;EACpC,oBAAoB;EACpB,iCAAiC;AACnC;AACA;EACE,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;AACpB;AACA;EACE,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,uBAAuB;EACvB,aAAa;EACb,gBAAgB;EAChB,iBAAiB;EACjB,eAAe;AACjB;AACA;;;EAGE,aAAa;EACb,4BAA4B;EAC5B,uCAAuC;AACzC;AACA;;;EAGE,aAAa;EACb,8BAA8B;EAC9B,uCAAuC;AACzC;AACA;EACE,aAAa;EACb,uCAAuC;AACzC;AACA;EACE,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,uBAAuB;EACvB,aAAa;AACf;AACA;;;;;;;;EAQE,UAAU;EACV,WAAW;EACX,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;AACf;AACA;;;;;;;;;;;;;;;EAeE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;;;;;;;;EAQE,kBAAkB;AACpB;AACA;;;;;;;;EAQE,WAAW;EACX,qBAAqB;EACrB,yBA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AAc;AAChB;AACA;;;;;;;;EAQE,4BAA4B;EAC5B,0CAA0C;AAC5C;AACA;EACE,WAAW;EACX,yBAAyB;EACzB,qBAAqB;AACvB","file":"tempus-dominus.css","sourcesContent":[".visually-hidden, .tempus-dominus-widget [data-action]::after {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n}\n\n.tempus-dominus-widget {\n list-style: none;\n padding: 4px;\n width: 19rem;\n border-radius: 4px;\n display: none;\n z-index: 9999;\n box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);\n}\n.tempus-dominus-widget.calendarWeeks {\n width: 21rem;\n}\n.tempus-dominus-widget.calendarWeeks .date-container-days {\n grid-auto-columns: 12.5%;\n grid-template-areas: \"a a a a a a a a\";\n}\n.tempus-dominus-widget [data-action] {\n cursor: pointer;\n}\n.tempus-dominus-widget [data-action]::after {\n content: attr(title);\n}\n.tempus-dominus-widget [data-action].disabled, .tempus-dominus-widget [data-action].disabled:hover {\n background: none;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .arrow {\n display: none;\n}\n.tempus-dominus-widget.show {\n display: block;\n}\n.tempus-dominus-widget .td-collapse:not(.show) {\n display: none;\n}\n.tempus-dominus-widget .td-collapsing {\n height: 0;\n overflow: hidden;\n transition: height 0.35s ease;\n}\n@media (min-width: 576px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 768px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n@media (min-width: 992px) {\n .tempus-dominus-widget.timepicker-sbs {\n width: 38em;\n }\n}\n.tempus-dominus-widget.timepicker-sbs .td-row {\n display: flex;\n}\n.tempus-dominus-widget.timepicker-sbs .td-row .td-half {\n flex: 0 0 auto;\n width: 50%;\n}\n.tempus-dominus-widget div[data-action]:active {\n box-shadow: none;\n}\n.tempus-dominus-widget .timepicker-hour,\n.tempus-dominus-widget .timepicker-minute,\n.tempus-dominus-widget .timepicker-second {\n width: 54px;\n font-weight: bold;\n font-size: 1.2em;\n margin: 0;\n}\n.tempus-dominus-widget button[data-action] {\n padding: 6px;\n}\n.tempus-dominus-widget .toggleMeridiem {\n text-align: center;\n height: 38px;\n}\n.tempus-dominus-widget .calendar-header {\n display: grid;\n grid-template-areas: \"a a a\";\n margin-bottom: 10px;\n font-weight: bold;\n}\n.tempus-dominus-widget .calendar-header .next {\n text-align: right;\n padding-right: 10px;\n}\n.tempus-dominus-widget .calendar-header .previous {\n text-align: left;\n padding-left: 10px;\n}\n.tempus-dominus-widget .calendar-header .picker-switch {\n text-align: center;\n}\n.tempus-dominus-widget .toolbar {\n display: grid;\n grid-auto-flow: column;\n grid-auto-rows: 40px;\n}\n.tempus-dominus-widget .toolbar div {\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .date-container-days {\n display: grid;\n grid-template-areas: \"a a a a a a a\";\n grid-auto-rows: 40px;\n grid-auto-columns: 14.2857142857%;\n}\n.tempus-dominus-widget .date-container-days .dow {\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n.tempus-dominus-widget .date-container-days .cw {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n font-size: 0.8em;\n line-height: 20px;\n cursor: default;\n}\n.tempus-dominus-widget .date-container-decades,\n.tempus-dominus-widget .date-container-years,\n.tempus-dominus-widget .date-container-months {\n display: grid;\n grid-template-areas: \"a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-hour,\n.tempus-dominus-widget .time-container-minute,\n.tempus-dominus-widget .time-container-second {\n display: grid;\n grid-template-areas: \"a a a a\";\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock {\n display: grid;\n grid-auto-rows: calc((19rem - 8px) / 7);\n}\n.tempus-dominus-widget .time-container-clock .no-highlight {\n width: 90%;\n height: 90%;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight),\n.tempus-dominus-widget .date-container-years div:not(.no-highlight),\n.tempus-dominus-widget .date-container-months div:not(.no-highlight),\n.tempus-dominus-widget .date-container-days div:not(.no-highlight),\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight),\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight),\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight),\n.tempus-dominus-widget .time-container-second div:not(.no-highlight) {\n width: 90%;\n height: 90%;\n border-radius: 999px;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n display: flex;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover {\n background: none;\n cursor: not-allowed;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).today,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).today {\n position: relative;\n}\n.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before {\n content: \"\";\n display: inline-block;\n border: solid transparent;\n border-width: 0 0 7px 7px;\n position: absolute;\n bottom: 6px;\n right: 6px;\n}\n.tempus-dominus-widget .time-container {\n margin-bottom: 0.5rem;\n}\n.tempus-dominus-widget button {\n display: inline-block;\n font-weight: 400;\n line-height: 1.5;\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod] {\n pointer-events: none;\n cursor: default;\n}\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,\n.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover {\n background: none;\n}\n.tempus-dominus-widget.light {\n color: #000;\n background-color: #fff;\n}\n.tempus-dominus-widget.light [data-action].disabled, .tempus-dominus-widget.light [data-action].disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.light .toolbar div:hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget.light .date-container-days .dow {\n color: rgba(0, 0, 0, 0.5);\n}\n.tempus-dominus-widget.light .date-container-days .cw {\n color: rgba(0, 0, 0, 0.38);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover {\n background: #e9ecef;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active {\n background-color: #0d6efd;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new {\n color: #fff;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #fff;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new {\n color: rgba(0, 0, 0, 0.38);\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before {\n border-bottom-color: #0d6efd;\n border-top-color: rgba(0, 0, 0, 0.2);\n}\n.tempus-dominus-widget.light button {\n color: #fff;\n background-color: #0d6efd;\n border-color: #0d6efd;\n}\n.tempus-dominus-widget.dark {\n color: #e3e3e3;\n background-color: #1b1b1b;\n}\n.tempus-dominus-widget.dark [data-action].disabled, .tempus-dominus-widget.dark [data-action].disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.dark .toolbar div:hover {\n background: #232627;\n}\n.tempus-dominus-widget.dark .date-container-days .dow {\n color: rgba(232, 230, 227, 0.5);\n}\n.tempus-dominus-widget.dark .date-container-days .cw {\n color: rgba(232, 230, 227, 0.38);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover {\n background: #232627;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active {\n background-color: #4db2ff;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(232, 230, 227, 0.25);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new {\n color: #fff;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before {\n border-bottom-color: #1b1b1b;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new {\n color: rgba(232, 230, 227, 0.38);\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled, .tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover {\n color: #6c757d;\n}\n.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before,\n.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before {\n border-bottom-color: #4db2ff;\n border-top-color: rgba(232, 230, 227, 0.2);\n}\n.tempus-dominus-widget.dark button {\n color: #fff;\n background-color: #4db2ff;\n border-color: #4db2ff;\n}"]} \ No newline at end of file diff --git a/dist/css/tempus-dominus.min.css b/dist/css/tempus-dominus.min.css index 41fe6923a..6d42a60d0 100644 --- a/dist/css/tempus-dominus.min.css +++ b/dist/css/tempus-dominus.min.css @@ -1 +1 @@ -.tempus-dominus-widget [data-action]:after,.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.tempus-dominus-widget{background-color:#fff;border-radius:4px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);display:none;list-style:none;padding:4px;width:19rem;z-index:9999}.tempus-dominus-widget.calendarWeeks{width:21rem}.tempus-dominus-widget.calendarWeeks .date-container-days{grid-auto-columns:12.5%;grid-template-areas:"a a a a a a a a"}.tempus-dominus-widget [data-action]{cursor:pointer}.tempus-dominus-widget [data-action]:after{content:attr(title)}.tempus-dominus-widget [data-action].disabled,.tempus-dominus-widget [data-action].disabled:hover{background:none;color:#6c757d;cursor:not-allowed}.tempus-dominus-widget .arrow{display:none}.tempus-dominus-widget.show{display:block}.tempus-dominus-widget .td-collapse:not(.show){display:none}.tempus-dominus-widget .td-collapsing{height:0;overflow:hidden;transition:height .35s ease}@media (min-width:576px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:768px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:992px){.tempus-dominus-widget.timepicker-sbs{width:38em}}.tempus-dominus-widget.timepicker-sbs .td-row{display:flex}.tempus-dominus-widget.timepicker-sbs .td-row .td-half{flex:0 0 auto;width:50%}.tempus-dominus-widget div[data-action]:active{box-shadow:none}.tempus-dominus-widget .timepicker-hour,.tempus-dominus-widget .timepicker-minute,.tempus-dominus-widget .timepicker-second{font-size:1.2em;font-weight:700;margin:0;width:54px}.tempus-dominus-widget button[data-action]{padding:6px}.tempus-dominus-widget .toggleMeridiem{height:38px;text-align:center}.tempus-dominus-widget .calendar-header{display:grid;font-weight:700;grid-template-areas:"a a a";margin-bottom:10px}.tempus-dominus-widget .calendar-header .next{padding-right:10px;text-align:right}.tempus-dominus-widget .calendar-header .previous{padding-left:10px;text-align:left}.tempus-dominus-widget .calendar-header .picker-switch{text-align:center}.tempus-dominus-widget .toolbar{display:grid;grid-auto-flow:column;grid-auto-rows:40px}.tempus-dominus-widget .toolbar div{align-items:center;border-radius:999px;box-sizing:border-box;display:flex;justify-content:center}.tempus-dominus-widget .toolbar div:hover{background:#e9ecef}.tempus-dominus-widget .date-container-days{display:grid;grid-auto-columns:14.2857142857%;grid-auto-rows:40px;grid-template-areas:"a a a a a a a"}.tempus-dominus-widget .date-container-days .dow{align-items:center;color:rgba(0,0,0,.5);justify-content:center;text-align:center}.tempus-dominus-widget .date-container-days .cw{align-items:center;color:rgba(0,0,0,.38);cursor:default;display:flex;font-size:.8em;height:90%;justify-content:center;line-height:20px;width:90%}.tempus-dominus-widget .date-container-decades,.tempus-dominus-widget .date-container-months,.tempus-dominus-widget .date-container-years{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a"}.tempus-dominus-widget .time-container-hour,.tempus-dominus-widget .time-container-minute,.tempus-dominus-widget .time-container-second{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a a"}.tempus-dominus-widget .time-container-clock{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px)}.tempus-dominus-widget .time-container-clock .no-highlight{align-items:center;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight),.tempus-dominus-widget .date-container-decades div:not(.no-highlight),.tempus-dominus-widget .date-container-months div:not(.no-highlight),.tempus-dominus-widget .date-container-years div:not(.no-highlight),.tempus-dominus-widget .time-container-clock div:not(.no-highlight),.tempus-dominus-widget .time-container-hour div:not(.no-highlight),.tempus-dominus-widget .time-container-minute div:not(.no-highlight),.tempus-dominus-widget .time-container-second div:not(.no-highlight){align-items:center;border-radius:999px;box-sizing:border-box;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight):hover{background:#e9ecef}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active{background-color:#0d6efd;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#fff}.tempus-dominus-widget .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget .time-container-second div:not(.no-highlight).old{color:rgba(0,0,0,.38)}.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover{background:none;color:#6c757d;cursor:not-allowed}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today{position:relative}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before{border-color:rgba(0,0,0,.2) transparent #0d6efd;border-style:solid;border-width:0 0 7px 7px;bottom:6px;content:"";display:inline-block;position:absolute;right:6px}.tempus-dominus-widget .time-container{margin-bottom:.5rem}.tempus-dominus-widget button{background-color:#0d6efd;border-color:#0d6efd;border-radius:.25rem;color:#fff;cursor:pointer;display:inline-block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]{cursor:default;pointer-events:none}.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover{background:none}@media (prefers-color-scheme:dark){.tempus-dominus-widget{background-color:#1b1b1b;color:#e3e3e3}.tempus-dominus-widget [data-action].disabled,.tempus-dominus-widget [data-action].disabled:hover{color:#6c757d}.tempus-dominus-widget .toolbar div:hover{background:#232627}.tempus-dominus-widget .date-container-days .dow{color:hsla(36,10%,90%,.5)}.tempus-dominus-widget .date-container-days .cw{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight):hover{background:#232627}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active{background-color:#4db2ff;color:#fff;text-shadow:0 -1px 0 hsla(36,10%,90%,.25)}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#1b1b1b}.tempus-dominus-widget .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget .time-container-second div:not(.no-highlight).old{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover{color:#6c757d}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before{border-bottom-color:#4db2ff;border-top-color:hsla(36,10%,90%,.2)}.tempus-dominus-widget button{background-color:#4db2ff;border-color:#4db2ff;color:#fff}} \ No newline at end of file +.tempus-dominus-widget [data-action]:after,.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.tempus-dominus-widget{border-radius:4px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);display:none;list-style:none;padding:4px;width:19rem;z-index:9999}.tempus-dominus-widget.calendarWeeks{width:21rem}.tempus-dominus-widget.calendarWeeks .date-container-days{grid-auto-columns:12.5%;grid-template-areas:"a a a a a a a a"}.tempus-dominus-widget [data-action]{cursor:pointer}.tempus-dominus-widget [data-action]:after{content:attr(title)}.tempus-dominus-widget [data-action].disabled,.tempus-dominus-widget [data-action].disabled:hover{background:none;cursor:not-allowed}.tempus-dominus-widget .arrow{display:none}.tempus-dominus-widget.show{display:block}.tempus-dominus-widget .td-collapse:not(.show){display:none}.tempus-dominus-widget .td-collapsing{height:0;overflow:hidden;transition:height .35s ease}@media (min-width:576px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:768px){.tempus-dominus-widget.timepicker-sbs{width:38em}}@media (min-width:992px){.tempus-dominus-widget.timepicker-sbs{width:38em}}.tempus-dominus-widget.timepicker-sbs .td-row{display:flex}.tempus-dominus-widget.timepicker-sbs .td-row .td-half{flex:0 0 auto;width:50%}.tempus-dominus-widget div[data-action]:active{box-shadow:none}.tempus-dominus-widget .timepicker-hour,.tempus-dominus-widget .timepicker-minute,.tempus-dominus-widget .timepicker-second{font-size:1.2em;font-weight:700;margin:0;width:54px}.tempus-dominus-widget button[data-action]{padding:6px}.tempus-dominus-widget .toggleMeridiem{height:38px;text-align:center}.tempus-dominus-widget .calendar-header{display:grid;font-weight:700;grid-template-areas:"a a a";margin-bottom:10px}.tempus-dominus-widget .calendar-header .next{padding-right:10px;text-align:right}.tempus-dominus-widget .calendar-header .previous{padding-left:10px;text-align:left}.tempus-dominus-widget .calendar-header .picker-switch{text-align:center}.tempus-dominus-widget .toolbar{display:grid;grid-auto-flow:column;grid-auto-rows:40px}.tempus-dominus-widget .toolbar div{align-items:center;border-radius:999px;box-sizing:border-box;display:flex;justify-content:center}.tempus-dominus-widget .date-container-days{display:grid;grid-auto-columns:14.2857142857%;grid-auto-rows:40px;grid-template-areas:"a a a a a a a"}.tempus-dominus-widget .date-container-days .dow{align-items:center;justify-content:center;text-align:center}.tempus-dominus-widget .date-container-days .cw{align-items:center;cursor:default;display:flex;font-size:.8em;height:90%;justify-content:center;line-height:20px;width:90%}.tempus-dominus-widget .date-container-decades,.tempus-dominus-widget .date-container-months,.tempus-dominus-widget .date-container-years{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a"}.tempus-dominus-widget .time-container-hour,.tempus-dominus-widget .time-container-minute,.tempus-dominus-widget .time-container-second{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px);grid-template-areas:"a a a a"}.tempus-dominus-widget .time-container-clock{display:grid;grid-auto-rows:calc(2.71429rem - 1.14286px)}.tempus-dominus-widget .time-container-clock .no-highlight{align-items:center;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight),.tempus-dominus-widget .date-container-decades div:not(.no-highlight),.tempus-dominus-widget .date-container-months div:not(.no-highlight),.tempus-dominus-widget .date-container-years div:not(.no-highlight),.tempus-dominus-widget .time-container-clock div:not(.no-highlight),.tempus-dominus-widget .time-container-hour div:not(.no-highlight),.tempus-dominus-widget .time-container-minute div:not(.no-highlight),.tempus-dominus-widget .time-container-second div:not(.no-highlight){align-items:center;border-radius:999px;box-sizing:border-box;display:flex;height:90%;justify-content:center;width:90%}.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget .time-container-second div:not(.no-highlight).disabled:hover{background:none;cursor:not-allowed}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today{position:relative}.tempus-dominus-widget .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget .time-container-second div:not(.no-highlight).today:before{border:solid transparent;border-width:0 0 7px 7px;bottom:6px;content:"";display:inline-block;position:absolute;right:6px}.tempus-dominus-widget .time-container{margin-bottom:.5rem}.tempus-dominus-widget button{border-radius:.25rem;cursor:pointer;display:inline-block;font-size:1rem;font-weight:400;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds],.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]{cursor:default;pointer-events:none}.tempus-dominus-widget.tempus-dominus-widget-readonly table td.day:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.hour:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.minute:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td.second:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=decrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=incrementSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showHours]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showMinutes]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=showSeconds]:hover,.tempus-dominus-widget.tempus-dominus-widget-readonly table td [data-action=togglePeriod]:hover{background:none}.tempus-dominus-widget.light{background-color:#fff;color:#000}.tempus-dominus-widget.light [data-action].disabled,.tempus-dominus-widget.light [data-action].disabled:hover{color:#6c757d}.tempus-dominus-widget.light .toolbar div:hover{background:#e9ecef}.tempus-dominus-widget.light .date-container-days .dow{color:rgba(0,0,0,.5)}.tempus-dominus-widget.light .date-container-days .cw{color:rgba(0,0,0,.38)}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight):hover{background:#e9ecef}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active{background-color:#0d6efd;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#fff}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).old{color:rgba(0,0,0,.38)}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).disabled:hover{color:#6c757d}.tempus-dominus-widget.light .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget.light .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget.light .time-container-second div:not(.no-highlight).today:before{border-bottom-color:#0d6efd;border-top-color:rgba(0,0,0,.2)}.tempus-dominus-widget.light button{background-color:#0d6efd;border-color:#0d6efd;color:#fff}.tempus-dominus-widget.dark{background-color:#1b1b1b;color:#e3e3e3}.tempus-dominus-widget.dark [data-action].disabled,.tempus-dominus-widget.dark [data-action].disabled:hover{color:#6c757d}.tempus-dominus-widget.dark .toolbar div:hover{background:#232627}.tempus-dominus-widget.dark .date-container-days .dow{color:hsla(36,10%,90%,.5)}.tempus-dominus-widget.dark .date-container-days .cw{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight):hover,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight):hover,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight):hover{background:#232627}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active{background-color:#4db2ff;color:#fff;text-shadow:0 -1px 0 hsla(36,10%,90%,.25)}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.old,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.new,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.old{color:#fff}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).active.today:before,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).active.today:before{border-bottom-color:#1b1b1b}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).old,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).new,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).old,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).new,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).old{color:hsla(36,10%,90%,.38)}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).disabled:hover,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).disabled:hover{color:#6c757d}.tempus-dominus-widget.dark .date-container-days div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-decades div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-months div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .date-container-years div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-clock div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-hour div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-minute div:not(.no-highlight).today:before,.tempus-dominus-widget.dark .time-container-second div:not(.no-highlight).today:before{border-bottom-color:#4db2ff;border-top-color:hsla(36,10%,90%,.2)}.tempus-dominus-widget.dark button{background-color:#4db2ff;border-color:#4db2ff;color:#fff} \ No newline at end of file diff --git a/dist/js/jQuery-provider.js b/dist/js/jQuery-provider.js index fbca55673..f7ca1333a 100644 --- a/dist/js/jQuery-provider.js +++ b/dist/js/jQuery-provider.js @@ -2,66 +2,66 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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) { - if (this.length === 1) { - return tempusDominus.jQueryHandleThis(this, option, argument); - } - // "this" is jquery here - return this.each(function () { - tempusDominus.jQueryHandleThis(this, option, argument); - }); + if (this.length === 1) { + return tempusDominus.jQueryHandleThis(this, option, argument); + } + // "this" is jquery here + return this.each(function () { + tempusDominus.jQueryHandleThis(this, option, argument); + }); }; tempusDominus.jQueryHandleThis = function (me, option, argument) { - let data = $(me).data(tempusDominus.Namespace.dataKey); - if (typeof option === 'object') { - $.extend({}, tempusDominus.DefaultOptions, option); - } - - if (!data) { - data = new tempusDominus.TempusDominus($(me)[0], option); - $(me).data(tempusDominus.Namespace.dataKey, data); - } + let data = $(me).data(tempusDominus.Namespace.dataKey); + if (typeof option === 'object') { + option = $.extend({}, tempusDominus.DefaultOptions, option); + } - if (typeof option === 'string') { - if (data[option] === undefined) { - throw new Error(`No method named "${option}"`); + if (!data) { + data = new tempusDominus.TempusDominus($(me)[0], option); + $(me).data(tempusDominus.Namespace.dataKey, data); } - if (argument === undefined) { - return data[option](); - } else { - if (option === 'date') { - data.isDateUpdateThroughDateOptionFromClientCode = true; - } - const ret = data[option](argument); - data.isDateUpdateThroughDateOptionFromClientCode = false; - return ret; + + if (typeof option === 'string') { + if (data[option] === undefined) { + throw new Error(`No method named "${option}"`); + } + if (argument === undefined) { + return data[option](); + } else { + if (option === 'date') { + data.isDateUpdateThroughDateOptionFromClientCode = true; + } + const ret = data[option](argument); + data.isDateUpdateThroughDateOptionFromClientCode = false; + return ret; + } } - } }; tempusDominus.getSelectorFromElement = function ($element) { - let selector = $element.data('target'), - $selector; + let selector = $element.data('target'), + $selector; - if (!selector) { - selector = $element.attr('href') || ''; - selector = /^#[a-z]/i.test(selector) ? selector : null; - } - $selector = $(selector); - if ($selector.length === 0) { - return $element; - } + if (!selector) { + selector = $element.attr('href') || ''; + selector = /^#[a-z]/i.test(selector) ? selector : null; + } + $selector = $(selector); + if ($selector.length === 0) { + return $element; + } - if (!$selector.data(tempusDominus.Namespace.dataKey)) { - $.extend({}, $selector.data(), $(this).data()); - } + if (!$selector.data(tempusDominus.Namespace.dataKey)) { + $.extend({}, $selector.data(), $(this).data()); + } - return $selector; + return $selector; }; /** @@ -70,85 +70,85 @@ tempusDominus.getSelectorFromElement = function ($element) { * ------------------------------------------------------------------------ */ $(document) - .on( - `click${tempusDominus.Namespace.events.key}.data-api`, - `[data-toggle="${tempusDominus.Namespace.dataKey}"]`, - function () { - const $originalTarget = $(this), - $target = tempusDominus.getSelectorFromElement($originalTarget), - config = $target.data(tempusDominus.Namespace.dataKey); - if ($target.length === 0) { - return; - } - if ( - config._options.allowInputToggle && - $originalTarget.is('input[data-toggle="datetimepicker"]') - ) { - return; - } - tempusDominus.jQueryInterface.call($target, 'toggle'); - } - ) - .on( - tempusDominus.Namespace.events.change, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { + .on( + `click${tempusDominus.Namespace.events.key}.data-api`, + `[data-toggle="${tempusDominus.Namespace.dataKey}"]`, + function () { + const $originalTarget = $(this), + $target = tempusDominus.getSelectorFromElement($originalTarget), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if ( + config._options.allowInputToggle && + $originalTarget.is('input[data-toggle="datetimepicker"]') + ) { + return; + } + tempusDominus.jQueryInterface.call($target, 'toggle'); + } + ) + .on( + tempusDominus.Namespace.events.change, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)); + if ($target.length === 0 || event.isInit) { + return; + } + tempusDominus.jQueryInterface.call($target, '_change', event); + } + ) + .on( + tempusDominus.Namespace.events.blur, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if (config._options.debug || window.debug) { + return; + } + tempusDominus.jQueryInterface.call($target, 'hide', event); + } + ) + /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) { const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0 || event.isInit) { - return; - } - tempusDominus.jQueryInterface.call($target, '_change', event); - } - ) - .on( - tempusDominus.Namespace.events.blur, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); if ($target.length === 0) { return; } - if (config._options.debug || window.debug) { - return; - } - tempusDominus.jQueryInterface.call($target, 'hide', event); - } - ) - /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keydown', event); - }) - .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keyup', event); - })*/ - .on( - tempusDominus.Namespace.events.focus, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); + tempusDominus.jQueryInterface.call($target, '_keydown', event); + }) + .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)); if ($target.length === 0) { return; } - if (!config._options.allowInputToggle) { - return; - } - tempusDominus.jQueryInterface.call($target, 'show', event); - } - ); + tempusDominus.jQueryInterface.call($target, '_keyup', event); + })*/ + .on( + tempusDominus.Namespace.events.focus, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if (!config._options.allowInputToggle) { + return; + } + tempusDominus.jQueryInterface.call($target, 'show', event); + } + ); const name = 'tempusDominus'; const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = tempusDominus.jQueryInterface; $.fn[name].Constructor = tempusDominus.TempusDominus; $.fn[name].noConflict = function () { - $.fn[name] = JQUERY_NO_CONFLICT; - return tempusDominus.jQueryInterface; + $.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 c8c2320e9..7a2121414 100644 --- a/dist/js/jQuery-provider.min.js +++ b/dist/js/jQuery-provider.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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",t=$.fn[e];$.fn[e]=tempusDominus.jQueryInterface,$.fn[e].Constructor=tempusDominus.TempusDominus,$.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&&(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 66b546b03..4ab171730 100644 --- a/dist/js/tempus-dominus.esm.js +++ b/dist/js/tempus-dominus.esm.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -316,10 +316,7 @@ class DateTime extends Date { * Returns two digit hours */ get hoursFormatted() { - let formatted = this.parts(undefined, twoDigitTwentyFourTemplate).hour; - if (formatted === '24') - formatted = '00'; - return formatted; + return this.parts(undefined, twoDigitTwentyFourTemplate).hour; } /** * Returns two digit hours but in twelve hour mode e.g. 13 -> 1 @@ -567,7 +564,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-beta8', dataKey = 'td'; +const NAME = 'tempus-dominus', version$1 = '6.0.0-beta9', dataKey = 'td'; /** * Events */ @@ -776,13 +773,25 @@ class Css { * Applied to the widget when the option display.inline is enabled. */ this.inline = 'inline'; + /** + * Applied to the widget when the option display.theme is light. + */ + this.lightTheme = 'light'; + /** + * Applied to the widget when the option display.theme is dark. + */ + this.darkTheme = 'dark'; + /** + * Used for detecting if the system color preference is dark mode + */ + this.isDarkPreferedQuery = '(prefers-color-scheme: dark)'; } } class Namespace { } Namespace.NAME = NAME; // noinspection JSUnusedGlobalSymbols -Namespace.version = version; +Namespace.version = version$1; Namespace.dataKey = dataKey; Namespace.events = new Events(); Namespace.css = new Css(); @@ -865,7 +874,7 @@ class Validation { } /** * 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. + * Granularity can be provided to check portions of the date instead of the whole. * @param targetDate * @param granularity */ @@ -987,7 +996,7 @@ class EventEmitter { callback(value); }); } - destory() { + destroy() { this.subscribers = null; this.subscribers = []; } @@ -999,11 +1008,11 @@ class EventEmitters { this.updateDisplay = new EventEmitter(); this.action = new EventEmitter(); } - destory() { - this.triggerEvent.destory(); - this.viewUpdate.destory(); - this.updateDisplay.destory(); - this.action.destory(); + destroy() { + this.triggerEvent.destroy(); + this.viewUpdate.destroy(); + this.updateDisplay.destroy(); + this.action.destroy(); } } @@ -1051,9 +1060,10 @@ const DefaultOptions = { hours: true, minutes: true, seconds: false, - useTwentyfourHour: false + useTwentyfourHour: undefined }, - inline: false + inline: false, + theme: 'auto' }, stepping: 1, useCurrent: true, @@ -1133,78 +1143,11 @@ class OptionConverter { 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], mergeOption[key], copyTo[key], path, locale); - // } - // path = path.substring(0, path.lastIndexOf(`.${key}`)); - // }); - // } /** * 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 @@ -1223,7 +1166,7 @@ class OptionConverter { }); Namespace.errorMessages.unexpectedOptions(errors); } - Object.keys(provided).forEach((key) => { + Object.keys(provided).filter(key => key !== "__proto__" && key !== "constructor").forEach((key) => { path += `.${key}`; if (path.charAt(0) === '.') path = path.slice(1); @@ -1351,10 +1294,12 @@ class OptionConverter { case 'toolbarPlacement': case 'type': case 'viewMode': + case 'theme': const optionValues = { toolbarPlacement: ['top', 'bottom', 'default'], type: ['icons', 'sprites'], viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + theme: ['light', 'dark', 'auto'], }; const keyOptions = optionValues[key]; if (!keyOptions.includes(value)) @@ -1371,6 +1316,11 @@ class OptionConverter { Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); } return value; + case 'useTwentyfourHour': + if (value === undefined || providedType === 'boolean') + return value; + Namespace.errorMessages.typeMismatch(path, providedType, defaultType); + break; default: switch (defaultType) { case 'boolean': @@ -1843,24 +1793,24 @@ class DateDisplay { * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.daysContainer); container.append(...this._daysOfTheWeek()); if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); container.appendChild(div); } for (let i = 0; i < 42; i++) { if (i !== 0 && i % 7 === 0) { if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); container.appendChild(div); } } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDay); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectDay); container.appendChild(div); } return container; @@ -1871,26 +1821,31 @@ class DateDisplay { */ _update(widget, paint) { const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), Unit.month) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.month), Unit.month) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === "calendar") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); + this.optionsStore.options.display.components.month + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), Unit.month) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.month), Unit.month) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone .startOf(Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .manipulate(12, Unit.hours); container .querySelectorAll(`[data-action="${ActionTypes$1.selectDay}"], .${Namespace.css.calendarWeeks}`) .forEach((containerClone) => { if (this.optionsStore.options.display.calendarWeeks && containerClone.classList.contains(Namespace.css.calendarWeeks)) { - if (containerClone.innerText === '#') + if (containerClone.innerText === "#") return; containerClone.innerText = `${innerDate.week}`; return; @@ -1919,9 +1874,9 @@ class DateDisplay { paint(Unit.date, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`); - containerClone.setAttribute('data-day', `${innerDate.date}`); - containerClone.innerText = innerDate.format({ day: 'numeric' }); + containerClone.setAttribute("data-value", `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`); + containerClone.setAttribute("data-day", `${innerDate.date}`); + containerClone.innerText = innerDate.format({ day: "numeric" }); innerDate.manipulate(1, Unit.date); }); } @@ -1931,20 +1886,20 @@ class DateDisplay { */ _daysOfTheWeek() { let innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .startOf(Unit.date); const row = []; - document.createElement('div'); + document.createElement("div"); if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - htmlDivElement.innerText = '#'; + htmlDivElement.innerText = "#"; row.push(htmlDivElement); } for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight); - htmlDivElement.innerText = innerDate.format({ weekday: 'short' }); + htmlDivElement.innerText = innerDate.format({ weekday: "short" }); innerDate.manipulate(1, Unit.date); row.push(htmlDivElement); } @@ -1981,16 +1936,21 @@ class MonthDisplay { */ _update(widget, paint) { const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.year), Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === 'months') { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName('div'); + switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); + this.optionsStore.options.display.components.year + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.year), Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year); container .querySelectorAll(`[data-action="${ActionTypes$1.selectMonth}"]`) @@ -2028,11 +1988,11 @@ class YearDisplay { * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.yearsContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectYear); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectYear); container.appendChild(div); } return container; @@ -2045,16 +2005,21 @@ class YearDisplay { this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year); this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year); const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ year: 'numeric' })}`); - this.validation.isValid(this._startYear, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === "years") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: "numeric" })}-${this._endYear.format({ year: "numeric" })}`); + this.optionsStore.options.display.components.decades + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this._startYear, Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endYear, Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone .startOf(Unit.year) .manipulate(-1, Unit.year); @@ -2073,7 +2038,7 @@ class YearDisplay { paint(Unit.year, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); + containerClone.setAttribute("data-value", `${innerDate.year}`); containerClone.innerText = innerDate.format({ year: "numeric" }); innerDate.manipulate(1, Unit.year); }); @@ -2094,11 +2059,11 @@ class DecadeDisplay { * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.decadesContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDecade); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectDecade); container.appendChild(div); } return container; @@ -2116,14 +2081,16 @@ class DecadeDisplay { const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0]; const [previous, switcher, next] = container.parentElement .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ year: 'numeric' })}-${this._endDecade.format({ year: 'numeric' })}`); - this.validation.isValid(this._startDecade, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + .getElementsByTagName("div"); + if (this.optionsStore.currentView === 'decades') { + switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ year: "numeric" })}-${this._endDecade.format({ year: "numeric" })}`); + this.validation.isValid(this._startDecade, Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endDecade, Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } const pickedYears = this.dates.picked.map((x) => x.year); container .querySelectorAll(`[data-action="${ActionTypes$1.selectDecade}"]`) @@ -2131,15 +2098,15 @@ class DecadeDisplay { if (index === 0) { containerClone.classList.add(Namespace.css.old); if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; + containerClone.textContent = " "; previous.classList.add(Namespace.css.disabled); containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ``); + containerClone.setAttribute("data-value", ``); return; } else { - containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: 'numeric' }); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); + containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: "numeric" }); + containerClone.setAttribute("data-value", `${this._startDecade.year}`); return; } } @@ -2152,11 +2119,11 @@ class DecadeDisplay { .length > 0) { classes.push(Namespace.css.active); } - paint('decade', this._startDecade, classes, containerClone); + paint("decade", this._startDecade, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - containerClone.innerText = `${this._startDecade.format({ year: 'numeric' })}`; + containerClone.setAttribute("data-value", `${this._startDecade.year}`); + containerClone.innerText = `${this._startDecade.format({ year: "numeric" })}`; this._startDecade.manipulate(10, Unit.year); }); } @@ -2449,7 +2416,7 @@ class MinuteDisplay { paint(Unit.minutes, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.minutesFormatted}`); + containerClone.setAttribute('data-value', `${innerDate.minutes}`); containerClone.innerText = innerDate.minutesFormatted; innerDate.manipulate(step, Unit.minutes); }); @@ -2550,6 +2517,8 @@ class Collapse { * @param target */ static hideImmediately(target) { + if (!target) + return; target.classList.remove(Namespace.css.collapsing, Namespace.css.show); target.classList.add(Namespace.css.collapse); } @@ -2754,6 +2723,7 @@ class Display { } } this._buildWidget(); + this._updateTheme(); // If modeView is only clock const onlyClock = this._hasTime && !this._hasDate; // reset the view to the clock if there's no date components @@ -2769,9 +2739,15 @@ class Display { this.optionsStore.currentCalendarViewMode = this.optionsStore.minimumCalendarViewMode; } - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { + if (!onlyClock && + this.optionsStore.options.display.viewMode !== 'clock') { if (this._hasTime) { - Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + if (!this.optionsStore.options.display.sideBySide) { + Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + } + else { + Collapse.show(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + } } Collapse.show(this.widget.querySelector(`div.${Namespace.css.dateContainer}`)); } @@ -2854,6 +2830,46 @@ class Display { this._updateCalendarHeader(); this._eventEmitters.viewUpdate.emit(); } + /** + * Changes the theme. E.g. light, dark or auto + * @param theme the theme name + * @private + */ + _updateTheme(theme) { + if (!this.widget) { + return; + } + if (theme) { + if (this.optionsStore.options.display.theme === theme) + return; + this.optionsStore.options.display.theme = theme; + } + this.widget.classList.remove('light', 'dark'); + this.widget.classList.add(this._getThemeClass()); + if (this.optionsStore.options.display.theme === 'auto') { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .addEventListener('change', () => this._updateTheme()); + } + else { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .removeEventListener('change', () => this._updateTheme()); + } + } + _getThemeClass() { + const currentTheme = this.optionsStore.options.display.theme || 'auto'; + const isDarkMode = window.matchMedia && + window.matchMedia(Namespace.css.isDarkPreferedQuery).matches; + switch (currentTheme) { + case 'light': + return Namespace.css.lightTheme; + case 'dark': + return Namespace.css.darkTheme; + case 'auto': + return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; + } + } _updateCalendarHeader() { const showing = [ ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*="display: grid"]`).classList, @@ -3263,7 +3279,7 @@ class Actions { currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate); currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML; if (this.display._hasTime) { - this.do(e, ActionTypes$1.showClock); + this.handleShowClockContainers(ActionTypes$1.showClock); this.display._update('clock'); } } @@ -3386,7 +3402,7 @@ class TempusDominus { return; const setViewDate = () => { if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; if (this.optionsStore.options.multipleDates) { @@ -3647,7 +3663,7 @@ class TempusDominus { * @private */ _initializeOptions(config, mergeTo, includeDataset = false) { - var _a; + var _a, _b; let newConfig = OptionConverter.deepCopy(config); newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); if (includeDataset) @@ -3679,6 +3695,9 @@ class TempusDominus { if ((_a = this.display) === null || _a === void 0 ? void 0 : _a.isVisible) { this.display._update('all'); } + if (newConfig.display.components.useTwentyfourHour === undefined) { + newConfig.display.components.useTwentyfourHour = !!!((_b = newConfig.viewDate.parts()) === null || _b === void 0 ? void 0 : _b.dayPeriod); + } this.optionsStore.options = newConfig; } /** @@ -3806,6 +3825,7 @@ const extend = function (plugin, option) { } return this; }; +const version = '6.0.0-beta9'; -export { DateTime, DefaultOptions, Namespace, TempusDominus, Unit, extend, loadLocale, locale }; +export { DateTime, DefaultOptions, Namespace, TempusDominus, Unit, extend, loadLocale, locale, version }; //# sourceMappingURL=tempus-dominus.esm.js.map diff --git a/dist/js/tempus-dominus.esm.js.map b/dist/js/tempus-dominus.esm.js.map index f1fa6409c..a8571c1a9 100644 --- a/dist/js/tempus-dominus.esm.js.map +++ b/dist/js/tempus-dominus.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * 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 if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n // /**\r\n // * The spread operator caused sub keys to be missing after merging.\r\n // * This is to fix that issue by using spread on the child objects first.\r\n // * Also handles complex options like disabledDates\r\n // * @param provided An option from new providedOptions\r\n // * @param 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], mergeOption[key], copyTo[key], path, locale);\r\n // }\r\n // path = path.substring(0, path.lastIndexOf(`.${key}`));\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 * @param path\r\n * @param locale\r\n */\r\n static spread(provided, copyTo, path = '', locale = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key)))\r\n {\r\n OptionConverter.spread(provided[key], copyTo[key], path, locale);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, 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 newConfig = OptionConverter.deepCopy(mergeTo);\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, newConfig, '', locale);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @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 * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport { 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 && this.optionsStore.options.display.viewMode !== 'clock') {\r\n if (this._hasTime) {\r\n Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n Collapse.show(this.widget.querySelector(`div.${Namespace.css.dateContainer}`));\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 //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\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;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,CAAA;AAQM,MAAM,eAAe,GAAG,CAAC,IAAU;IACxC,QAAQ,IAAI;QACV,KAAK,MAAM;YACT,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;QAChC,KAAK,OAAO;YACV,OAAO;gBACL,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;aAChB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9B;AACH,CAAC,CAAC;AAEF;;;;MAIa,QAAS,SAAQ,IAAI;IAAlC;;;;;QAIE,WAAM,GAAG,SAAS,C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AO;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 return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRage(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * 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-beta9',\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\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferedQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static 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 provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from \"./namespace\";\r\nimport {DateTime} from \"../datetime\";\r\nimport DefaultOptions from \"./default-options\";\r\nimport Options 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 if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param locale\r\n */\r\n static spread(provided, copyTo, path = '', locale = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== \"__proto__\" && key !== \"constructor\").forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key)))\r\n {\r\n OptionConverter.spread(provided[key], copyTo[key], path, locale);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, 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 case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto'],\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const 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, newConfig, '', locale);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @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\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport { 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(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * @fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n\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 /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferedQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferedQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferedQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * @fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin.$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\nconst version = '6.0.0-beta9';\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 version\r\n};\r\n"],"names":["version","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,CAAA;AAQM,MAAM,eAAe,GAAG,CAAC,IAAU;IACxC,QAAQ,IAAI;QACV,KAAK,MAAM;YACT,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;QAChC,KAAK,OAAO;YACV,OAAO;gBACL,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;aAChB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9B;AACH,CAAC,CAAC;AAEF;;;;MAIa,QAAS,SAAQ,IAAI;IAAlC;;;;;Q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.min.js index baea85cdc..67dbf6909 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-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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-beta8",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?t.split(".").reduce(((t,e)=>g.isValue(t)||g.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i=""){const o=g.objectPath(s,v),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=g.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,l=t[a];if(null==l)return e[a]=l,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||g.ignoreProperties.includes(a)?e[a]=g.processKey(a,l,r,d,s,i):g.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");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=g.deepCopy(e),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,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 w=b;class f{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",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=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",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=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",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 C{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",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 _{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=${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=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",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=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",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=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",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 showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{T.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse)}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{T.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}T.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{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(f),this.monthDisplay=c.locate(D),this.yearDisplay=c.locate(k),this.decadeDisplay=c.locate(C),this.timeDisplay=c.locate(_),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:w.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&T.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`)),T.show(this.widget.querySelector(`div.${d.css.dateContainer}`))),this._hasDate&&this._showMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{((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=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",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=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 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.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(T.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),T.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case 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}=h[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()},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:w.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}; +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(){return this.parts(void 0,i).hour}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-beta9",d.dataKey="td",d.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},d.css=new class{constructor(){this.widget=`${r}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferedQuery="(prefers-color-scheme: dark)"}},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)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const v={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0},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?t.split(".").reduce(((t,e)=>g.isValue(t)||g.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i=""){const o=g.objectPath(s,v),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=g.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));d.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,l=t[a];if(null==l)return e[a]=l,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||g.ignoreProperties.includes(a)?e[a]=g.processKey(a,l,r,d,s,i):g.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");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":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||d.errorMessages.unexpectedOptionValue(o.substring(1),e,r),e;case"meta":case"dayViewHeaderFormat":return e;case"container":return e&&!(e instanceof HTMLElement||e instanceof Element||(null==e?void 0:e.appendChild))&&d.errorMessages.typeMismatch(o.substring(1),typeof e,"HTMLElement"),e;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;d.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:d.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){var s;const i=g.deepCopy(e),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,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 w;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(w||(w={}));var b=w;class f{constructor(){this.optionsStore=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",b.selectDay),t.appendChild(s)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[t,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.month),e.month)?t.classList.remove(d.css.disabled):t.classList.add(d.css.disabled),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)}let o=this.optionsStore.viewDate.clone.startOf(e.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,e.hours);i.querySelectorAll(`[data-action="${b.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=`${o.week}`)}let i=[];i.push(d.css.day),o.isBefore(this.optionsStore.viewDate,e.month)&&i.push(d.css.old),o.isAfter(this.optionsStore.viewDate,e.month)&&i.push(d.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,e.date)&&i.push(d.css.active),this.validation.isValid(o,e.date)||i.push(d.css.disabled),o.isSame(new a,e.date)&&i.push(d.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(d.css.weekend),s(e.date,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),t.setAttribute("data-day",`${o.date}`),t.innerText=o.format({day:"numeric"}),o.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",b.selectMonth),t.appendChild(e)}return t}_update(t,s){const i=t.getElementsByClassName(d.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[t,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.year),e.year)?t.classList.remove(d.css.disabled):t.classList.add(d.css.disabled),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)}let o=this.optionsStore.viewDate.clone.startOf(e.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((t,i)=>{let a=[];a.push(d.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,e.month)&&a.push(d.css.active),this.validation.isValid(o,e.month)||a.push(d.css.disabled),s(e.month,o,a,t),t.classList.remove(...t.classList),t.classList.add(...a),t.setAttribute("data-value",`${i}`),t.innerText=`${o.format({month:"short"})}`,o.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",b.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];if("years"===this.optionsStore.currentView){const[t,s,o]=i.parentElement.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(d.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(d.css.disabled):s.classList.add(d.css.disabled),this.validation.isValid(this._startYear,e.year)?t.classList.remove(d.css.disabled):t.classList.add(d.css.disabled),this.validation.isValid(this._endYear,e.year)?o.classList.remove(d.css.disabled):o.classList.add(d.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(e.year).manipulate(-1,e.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((t=>{let i=[];i.push(d.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,e.year)&&i.push(d.css.active),this.validation.isValid(o,e.year)||i.push(d.css.disabled),s(e.year,o,i,t),t.classList.remove(...t.classList),t.classList.add(...i),t.setAttribute("data-value",`${o.year}`),t.innerText=o.format({year:"numeric"}),o.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",b.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");"decades"===this.optionsStore.currentView&&(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="${b.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=${b.incrementHours}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.hours),e.hours)||s.querySelector(`[data-action=${b.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=${b.incrementMinutes}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.minutes),e.minutes)||s.querySelector(`[data-action=${b.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=${b.incrementSeconds}]`).classList.add(d.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,e.seconds),e.seconds)||s.querySelector(`[data-action=${b.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=${b.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",b.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",b.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",b.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",b.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",b.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",b.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",b.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",b.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",b.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",b.toggleMeridiem),e.setAttribute("tabindex","-1"),d.css.toggleMeridiem.includes(",")?e.classList.add(...d.css.toggleMeridiem.split(",")):e.classList.add(d.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(d.css.noHighlight),t.appendChild(e),i.push(t),t=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",b.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="${b.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",b.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="${b.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.minutes}`),t.innerText=o.minutesFormatted,o.manipulate(a,e.minutes)}))}}class T{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",b.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="${b.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 L{static toggle(t){t.classList.contains(d.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(d.css.collapsing),t.classList.add(d.css.collapse,d.css.show),t.style.height=""}static show(t){if(t.classList.contains(d.css.collapsing)||t.classList.contains(d.css.show))return;t.style.height="0",t.classList.remove(d.css.collapse),t.classList.add(d.css.collapsing),setTimeout((()=>{L.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(d.css.collapsing,d.css.show),t.classList.add(d.css.collapse))}static hide(t){if(t.classList.contains(d.css.collapsing)||!t.classList.contains(d.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(d.css.collapse,d.css.show),t.classList.add(d.css.collapsing),t.style.height="",setTimeout((()=>{L.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}L.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(f),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(T),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(),this._updateTheme();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?L.show(this.widget.querySelector(`div.${d.css.timeContainer}`)):L.hideImmediately(this.widget.querySelector(`div.${d.css.timeContainer}`))),L.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:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(d.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(d.css.show),this.optionsStore.options.display.inline||(this._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()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(d.css.isDarkPreferedQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(d.css.isDarkPreferedQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(d.css.isDarkPreferedQuery).matches;switch(t){case"light":return d.css.lightTheme;case"dark":return d.css.darkTheme;case"auto":return e?d.css.darkTheme:d.css.lightTheme}}_updateCalendarHeader(){const t=[...this.widget.querySelector(`.${d.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(d.css.dateContainer))),[e,s,i]=this.widget.getElementsByClassName(d.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case d.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),i.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case d.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),i.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case d.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),i.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case d.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),i.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.innerText=this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(d.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:d.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?this.dates.lastPicked.clone:void 0}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(d.css.widget);const e=document.createElement("div");e.classList.add(d.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(d.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const i=document.createElement("div");if(i.classList.add(d.css.toolbar),i.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(d.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){t.classList.add(d.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");return o.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),o.appendChild(e),o.appendChild(s),t.appendChild(o),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),void(this._widget=t)}"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i),this._hasDate&&(this._hasTime&&(e.classList.add(d.css.collapse),"clock"!==this.optionsStore.options.display.viewMode&&e.classList.add(d.css.show)),t.appendChild(e)),this._hasTime&&(this._hasDate&&(s.classList.add(d.css.collapse),"clock"===this.optionsStore.options.display.viewMode&&s.classList.add(d.css.show)),t.appendChild(s)),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(i);const o=document.createElement("div");o.classList.add("arrow"),o.setAttribute("data-popper-arrow",""),t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(d.css.calendarHeader);const e=document.createElement("div");e.classList.add(d.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(d.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(d.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=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 b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const i=+n.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=i;break;case b.selectYear:case b.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 b.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 b.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 b.selectMinute:r.minutes=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case b.selectSecond:r.seconds=+n.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(t);break;case b.incrementHours:this.manipulateAndSet(r,e.hours);break;case b.incrementMinutes:this.manipulateAndSet(r,e.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(r,e.seconds);break;case b.decrementHours:this.manipulateAndSet(r,e.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(r,e.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(r,e.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(r,e.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.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.handleShowClockContainers(b.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${d.css.dateContainer}, .${d.css.timeContainer}`).forEach((t=>L.toggle(t))),this._eventEmitters.viewUpdate.emit();break;case b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(L.hideImmediately(this.display.widget.querySelector(`div.${d.css.dateContainer}`)),L.showImmediately(this.display.widget.querySelector(`div.${d.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new 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 b.showClock:s=d.css.clockContainer,this.display._update("clock");break;case b.showHours:s=d.css.hourContainer,this.display._update(e.hours);break;case b.showMinutes:s=d.css.minuteContainer,this.display._update(e.minutes);break;case b.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===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},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,o;let a=g.deepCopy(t);a=g._mergeOptions(a,e),s&&(a=g._dataToOptions(this.optionsStore.element,a)),g._validateConflicts(a),a.viewDate=a.viewDate.setLocale(a.localization.locale),this.optionsStore.viewDate.isSame(a.viewDate)||(this.optionsStore.viewDate=a.viewDate),a.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),a.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),a.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==a.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===a.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),void 0===a.display.components.useTwentyfourHour&&(a.display.components.useTwentyfourHour=!(null===(o=a.viewDate.parts())||void 0===o?void 0:o.dayPeriod)),this.optionsStore.options=a}_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:b.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const V={},H=t=>{V[t.name]||(V[t.name]=t.localization)},x=t=>{let e=V[t];e&&(v.localization=e)},P=function(t,e){return t.$i||(t.load(e,{TempusDominus:O,Dates:S,Display:A},this),t.$i=!0),this},I="6.0.0-beta9";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,I as version}; diff --git a/dist/js/tempus-dominus.js b/dist/js/tempus-dominus.js index ec1b5f3b6..b648f32af 100644 --- a/dist/js/tempus-dominus.js +++ b/dist/js/tempus-dominus.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -320,10 +320,7 @@ * Returns two digit hours */ get hoursFormatted() { - let formatted = this.parts(undefined, twoDigitTwentyFourTemplate).hour; - if (formatted === '24') - formatted = '00'; - return formatted; + return this.parts(undefined, twoDigitTwentyFourTemplate).hour; } /** * Returns two digit hours but in twelve hour mode e.g. 13 -> 1 @@ -571,7 +568,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-beta8', dataKey = 'td'; + const NAME = 'tempus-dominus', version$1 = '6.0.0-beta9', dataKey = 'td'; /** * Events */ @@ -780,13 +777,25 @@ * Applied to the widget when the option display.inline is enabled. */ this.inline = 'inline'; + /** + * Applied to the widget when the option display.theme is light. + */ + this.lightTheme = 'light'; + /** + * Applied to the widget when the option display.theme is dark. + */ + this.darkTheme = 'dark'; + /** + * Used for detecting if the system color preference is dark mode + */ + this.isDarkPreferedQuery = '(prefers-color-scheme: dark)'; } } class Namespace { } Namespace.NAME = NAME; // noinspection JSUnusedGlobalSymbols - Namespace.version = version; + Namespace.version = version$1; Namespace.dataKey = dataKey; Namespace.events = new Events(); Namespace.css = new Css(); @@ -869,7 +878,7 @@ } /** * 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. + * Granularity can be provided to check portions of the date instead of the whole. * @param targetDate * @param granularity */ @@ -991,7 +1000,7 @@ callback(value); }); } - destory() { + destroy() { this.subscribers = null; this.subscribers = []; } @@ -1003,11 +1012,11 @@ this.updateDisplay = new EventEmitter(); this.action = new EventEmitter(); } - destory() { - this.triggerEvent.destory(); - this.viewUpdate.destory(); - this.updateDisplay.destory(); - this.action.destory(); + destroy() { + this.triggerEvent.destroy(); + this.viewUpdate.destroy(); + this.updateDisplay.destroy(); + this.action.destroy(); } } @@ -1055,9 +1064,10 @@ hours: true, minutes: true, seconds: false, - useTwentyfourHour: false + useTwentyfourHour: undefined }, - inline: false + inline: false, + theme: 'auto' }, stepping: 1, useCurrent: true, @@ -1137,78 +1147,11 @@ 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], mergeOption[key], copyTo[key], path, locale); - // } - // path = path.substring(0, path.lastIndexOf(`.${key}`)); - // }); - // } /** * 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 @@ -1227,7 +1170,7 @@ }); Namespace.errorMessages.unexpectedOptions(errors); } - Object.keys(provided).forEach((key) => { + Object.keys(provided).filter(key => key !== "__proto__" && key !== "constructor").forEach((key) => { path += `.${key}`; if (path.charAt(0) === '.') path = path.slice(1); @@ -1355,10 +1298,12 @@ case 'toolbarPlacement': case 'type': case 'viewMode': + case 'theme': const optionValues = { toolbarPlacement: ['top', 'bottom', 'default'], type: ['icons', 'sprites'], viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + theme: ['light', 'dark', 'auto'], }; const keyOptions = optionValues[key]; if (!keyOptions.includes(value)) @@ -1375,6 +1320,11 @@ Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement'); } return value; + case 'useTwentyfourHour': + if (value === undefined || providedType === 'boolean') + return value; + Namespace.errorMessages.typeMismatch(path, providedType, defaultType); + break; default: switch (defaultType) { case 'boolean': @@ -1847,24 +1797,24 @@ * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.daysContainer); container.append(...this._daysOfTheWeek()); if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); container.appendChild(div); } for (let i = 0; i < 42; i++) { if (i !== 0 && i % 7 === 0) { if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); container.appendChild(div); } } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDay); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectDay); container.appendChild(div); } return container; @@ -1875,26 +1825,31 @@ */ _update(widget, paint) { const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.month), exports.Unit.month) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.month), exports.Unit.month) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === "calendar") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)); + this.optionsStore.options.display.components.month + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.month), exports.Unit.month) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.month), exports.Unit.month) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone .startOf(exports.Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .manipulate(12, exports.Unit.hours); container .querySelectorAll(`[data-action="${ActionTypes$1.selectDay}"], .${Namespace.css.calendarWeeks}`) .forEach((containerClone) => { if (this.optionsStore.options.display.calendarWeeks && containerClone.classList.contains(Namespace.css.calendarWeeks)) { - if (containerClone.innerText === '#') + if (containerClone.innerText === "#") return; containerClone.innerText = `${innerDate.week}`; return; @@ -1923,9 +1878,9 @@ paint(exports.Unit.date, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`); - containerClone.setAttribute('data-day', `${innerDate.date}`); - containerClone.innerText = innerDate.format({ day: 'numeric' }); + containerClone.setAttribute("data-value", `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`); + containerClone.setAttribute("data-day", `${innerDate.date}`); + containerClone.innerText = innerDate.format({ day: "numeric" }); innerDate.manipulate(1, exports.Unit.date); }); } @@ -1935,20 +1890,20 @@ */ _daysOfTheWeek() { let innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .startOf(exports.Unit.date); const row = []; - document.createElement('div'); + document.createElement("div"); if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); - htmlDivElement.innerText = '#'; + htmlDivElement.innerText = "#"; row.push(htmlDivElement); } for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight); - htmlDivElement.innerText = innerDate.format({ weekday: 'short' }); + htmlDivElement.innerText = innerDate.format({ weekday: "short" }); innerDate.manipulate(1, exports.Unit.date); row.push(htmlDivElement); } @@ -1985,16 +1940,21 @@ */ _update(widget, paint) { const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.year), exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.year), exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === 'months') { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName('div'); + switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' })); + this.optionsStore.options.display.components.year + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.year), exports.Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, exports.Unit.year), exports.Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone.startOf(exports.Unit.year); container .querySelectorAll(`[data-action="${ActionTypes$1.selectMonth}"]`) @@ -2032,11 +1992,11 @@ * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.yearsContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectYear); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectYear); container.appendChild(div); } return container; @@ -2049,16 +2009,21 @@ this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, exports.Unit.year); this._endYear = this.optionsStore.viewDate.clone.manipulate(10, exports.Unit.year); const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ year: 'numeric' })}`); - this.validation.isValid(this._startYear, exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + if (this.optionsStore.currentView === "years") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: "numeric" })}-${this._endYear.format({ year: "numeric" })}`); + this.optionsStore.options.display.components.decades + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + this.validation.isValid(this._startYear, exports.Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endYear, exports.Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone .startOf(exports.Unit.year) .manipulate(-1, exports.Unit.year); @@ -2077,7 +2042,7 @@ paint(exports.Unit.year, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); + containerClone.setAttribute("data-value", `${innerDate.year}`); containerClone.innerText = innerDate.format({ year: "numeric" }); innerDate.manipulate(1, exports.Unit.year); }); @@ -2098,11 +2063,11 @@ * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.decadesContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes$1.selectDecade); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes$1.selectDecade); container.appendChild(div); } return container; @@ -2120,14 +2085,16 @@ const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0]; const [previous, switcher, next] = container.parentElement .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ year: 'numeric' })}-${this._endDecade.format({ year: 'numeric' })}`); - this.validation.isValid(this._startDecade, exports.Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, exports.Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + .getElementsByTagName("div"); + if (this.optionsStore.currentView === 'decades') { + switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({ year: "numeric" })}-${this._endDecade.format({ year: "numeric" })}`); + this.validation.isValid(this._startDecade, exports.Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endDecade, exports.Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } const pickedYears = this.dates.picked.map((x) => x.year); container .querySelectorAll(`[data-action="${ActionTypes$1.selectDecade}"]`) @@ -2135,15 +2102,15 @@ if (index === 0) { containerClone.classList.add(Namespace.css.old); if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; + containerClone.textContent = " "; previous.classList.add(Namespace.css.disabled); containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ``); + containerClone.setAttribute("data-value", ``); return; } else { - containerClone.innerText = this._startDecade.clone.manipulate(-10, exports.Unit.year).format({ year: 'numeric' }); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); + containerClone.innerText = this._startDecade.clone.manipulate(-10, exports.Unit.year).format({ year: "numeric" }); + containerClone.setAttribute("data-value", `${this._startDecade.year}`); return; } } @@ -2156,11 +2123,11 @@ .length > 0) { classes.push(Namespace.css.active); } - paint('decade', this._startDecade, classes, containerClone); + paint("decade", this._startDecade, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${this._startDecade.year}`); - containerClone.innerText = `${this._startDecade.format({ year: 'numeric' })}`; + containerClone.setAttribute("data-value", `${this._startDecade.year}`); + containerClone.innerText = `${this._startDecade.format({ year: "numeric" })}`; this._startDecade.manipulate(10, exports.Unit.year); }); } @@ -2453,7 +2420,7 @@ paint(exports.Unit.minutes, innerDate, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.minutesFormatted}`); + containerClone.setAttribute('data-value', `${innerDate.minutes}`); containerClone.innerText = innerDate.minutesFormatted; innerDate.manipulate(step, exports.Unit.minutes); }); @@ -2554,6 +2521,8 @@ * @param target */ static hideImmediately(target) { + if (!target) + return; target.classList.remove(Namespace.css.collapsing, Namespace.css.show); target.classList.add(Namespace.css.collapse); } @@ -2758,6 +2727,7 @@ } } this._buildWidget(); + this._updateTheme(); // If modeView is only clock const onlyClock = this._hasTime && !this._hasDate; // reset the view to the clock if there's no date components @@ -2773,9 +2743,15 @@ this.optionsStore.currentCalendarViewMode = this.optionsStore.minimumCalendarViewMode; } - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { + if (!onlyClock && + this.optionsStore.options.display.viewMode !== 'clock') { if (this._hasTime) { - Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + if (!this.optionsStore.options.display.sideBySide) { + Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + } + else { + Collapse.show(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + } } Collapse.show(this.widget.querySelector(`div.${Namespace.css.dateContainer}`)); } @@ -2858,6 +2834,46 @@ this._updateCalendarHeader(); this._eventEmitters.viewUpdate.emit(); } + /** + * Changes the theme. E.g. light, dark or auto + * @param theme the theme name + * @private + */ + _updateTheme(theme) { + if (!this.widget) { + return; + } + if (theme) { + if (this.optionsStore.options.display.theme === theme) + return; + this.optionsStore.options.display.theme = theme; + } + this.widget.classList.remove('light', 'dark'); + this.widget.classList.add(this._getThemeClass()); + if (this.optionsStore.options.display.theme === 'auto') { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .addEventListener('change', () => this._updateTheme()); + } + else { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .removeEventListener('change', () => this._updateTheme()); + } + } + _getThemeClass() { + const currentTheme = this.optionsStore.options.display.theme || 'auto'; + const isDarkMode = window.matchMedia && + window.matchMedia(Namespace.css.isDarkPreferedQuery).matches; + switch (currentTheme) { + case 'light': + return Namespace.css.lightTheme; + case 'dark': + return Namespace.css.darkTheme; + case 'auto': + return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; + } + } _updateCalendarHeader() { const showing = [ ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*="display: grid"]`).classList, @@ -3267,7 +3283,7 @@ currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate); currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML; if (this.display._hasTime) { - this.do(e, ActionTypes$1.showClock); + this.handleShowClockContainers(ActionTypes$1.showClock); this.display._update('clock'); } } @@ -3390,7 +3406,7 @@ return; const setViewDate = () => { if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; if (this.optionsStore.options.multipleDates) { @@ -3651,7 +3667,7 @@ * @private */ _initializeOptions(config, mergeTo, includeDataset = false) { - var _a; + var _a, _b; let newConfig = OptionConverter.deepCopy(config); newConfig = OptionConverter._mergeOptions(newConfig, mergeTo); if (includeDataset) @@ -3683,6 +3699,9 @@ if ((_a = this.display) === null || _a === void 0 ? void 0 : _a.isVisible) { this.display._update('all'); } + if (newConfig.display.components.useTwentyfourHour === undefined) { + newConfig.display.components.useTwentyfourHour = !!!((_b = newConfig.viewDate.parts()) === null || _b === void 0 ? void 0 : _b.dayPeriod); + } this.optionsStore.options = newConfig; } /** @@ -3810,6 +3829,7 @@ } return this; }; + const version = '6.0.0-beta9'; exports.DateTime = DateTime; exports.DefaultOptions = DefaultOptions; @@ -3818,6 +3838,7 @@ exports.extend = extend; exports.loadLocale = loadLocale; exports.locale = locale; + exports.version = version; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/dist/js/tempus-dominus.js.map b/dist/js/tempus-dominus.js.map index dcd04c232..edcc7e61b 100644 --- a/dist/js/tempus-dominus.js.map +++ b/dist/js/tempus-dominus.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/datetime.ts","../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export enum Unit {\r\n seconds = 'seconds',\r\n minutes = 'minutes',\r\n hours = 'hours',\r\n date = 'date',\r\n month = 'month',\r\n year = 'year',\r\n}\r\n\r\nconst twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: true,\r\n}\r\n\r\nconst twoDigitTwentyFourTemplate = {\r\n hour: '2-digit',\r\n hour12: false\r\n}\r\n\r\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\r\n timeStyle?: 'short' | 'medium' | 'long';\r\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\r\n numberingSystem?: string;\r\n}\r\n\r\nexport const getFormatByUnit = (unit: Unit): object => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric'\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n};\r\n\r\n/**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\nexport class DateTime extends Date {\r\n /**\r\n * Used with Intl.DateTimeFormat\r\n */\r\n locale = 'default';\r\n\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n */\r\n setLocale(value: string): this {\r\n this.locale = value;\r\n return this;\r\n }\r\n\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale\r\n */\r\n static convert(date: Date, locale: string = 'default'): DateTime {\r\n if (!date) throw new Error(`A date is required`);\r\n return new DateTime(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ).setLocale(locale);\r\n }\r\n\r\n /**\r\n * 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 if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n // /**\r\n // * The spread operator caused sub keys to be missing after merging.\r\n // * This is to fix that issue by using spread on the child objects first.\r\n // * Also handles complex options like disabledDates\r\n // * @param provided An option from new providedOptions\r\n // * @param 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], mergeOption[key], copyTo[key], path, locale);\r\n // }\r\n // path = path.substring(0, path.lastIndexOf(`.${key}`));\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 * @param path\r\n * @param locale\r\n */\r\n static spread(provided, copyTo, path = '', locale = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key)))\r\n {\r\n OptionConverter.spread(provided[key], copyTo[key], path, locale);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, 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 newConfig = OptionConverter.deepCopy(mergeTo);\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, newConfig, '', locale);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @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 * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport { 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 && this.optionsStore.options.display.viewMode !== 'clock') {\r\n if (this._hasTime) {\r\n Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n Collapse.show(this.widget.querySelector(`div.${Namespace.css.dateContainer}`));\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 //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\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;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AAC,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 +{"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 return this.parts(undefined, twoDigitTwentyFourTemplate).hour;\r\n }\r\n\r\n /**\r\n * Returns two digit hours but in twelve hour mode e.g. 13 -> 1\r\n */\r\n get twelveHoursFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).hour;\r\n }\r\n\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale: string = this.locale): string {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true\r\n } as any)\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date(): number {\r\n return this.getDate();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value: number) {\r\n this.setDate(value);\r\n }\r\n\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay(): number {\r\n return this.getDay();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month(): number {\r\n return this.getMonth();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value: number) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted(): string {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year(): number {\r\n return this.getFullYear();\r\n }\r\n\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value: number) {\r\n this.setFullYear(value);\r\n }\r\n\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week(): number {\r\n const ordinal = this.computeOrdinal(),\r\n weekday = this.getUTCDay();\r\n\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear(this.year - 1);\r\n } else if (weekNumber > this.weeksInWeekYear(this.year)) {\r\n weekNumber = 1;\r\n }\r\n\r\n return weekNumber;\r\n }\r\n\r\n weeksInWeekYear(weekYear) {\r\n const p1 =\r\n (weekYear +\r\n Math.floor(weekYear / 4) -\r\n Math.floor(weekYear / 100) +\r\n Math.floor(weekYear / 400)) %\r\n 7,\r\n last = weekYear - 1,\r\n p2 =\r\n (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n\r\n get isLeapYear() {\r\n return this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0);\r\n }\r\n\r\n private computeOrdinal() {\r\n return this.date + (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month];\r\n }\r\n\r\n private nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\r\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n}\r\n","export class TdError extends Error {\r\n code: number;\r\n}\r\n\r\nexport class ErrorMessages {\r\n private base = 'TD:';\r\n\r\n //#region out to console\r\n\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName: string) {\r\n const error = new TdError(\r\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\r\n );\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName: string[]) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(\r\n optionName: string,\r\n badValue: string,\r\n validOptions: string[]\r\n ) {\r\n const error = new TdError(\r\n `${\r\n this.base\r\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\r\n ', '\r\n )}`\r\n );\r\n error.code = 2;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName: string, badType: string, expectedType: string) {\r\n const error = new TdError(\r\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\r\n );\r\n error.code = 3;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRage(optionName: string, lower: number, upper: number) {\r\n const error = new TdError(\r\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\r\n );\r\n error.code = 4;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n failedToParseDate(optionName: string, date: any, soft = false) {\r\n const error = new TdError(\r\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\r\n );\r\n error.code = 5;\r\n if (!soft) throw error;\r\n console.warn(error);\r\n }\r\n\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(\r\n `${this.base} The subscribed events does not match the number of callbacks`\r\n );\r\n error.code = 7;\r\n throw error;\r\n }\r\n\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message?: string) {\r\n const error = new TdError(\r\n `${this.base} A configuration value conflicts with another rule. ${message}`\r\n );\r\n error.code = 8;\r\n throw error;\r\n }\r\n\r\n /**\r\n * 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-beta9',\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\n * Applied to the widget when the option display.theme is light.\r\n */\r\n lightTheme = 'light';\r\n\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n darkTheme = 'dark';\r\n\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n isDarkPreferedQuery = '(prefers-color-scheme: dark)';\r\n}\r\n\r\nexport default class Namespace {\r\n static NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n static 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 provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\r\n if (\r\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\r\n targetDate.weekDay\r\n ) !== -1\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(\r\n this.optionsStore.options.restrictions.minDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(\r\n this.optionsStore.options.restrictions.maxDate,\r\n granularity\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n if (\r\n granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds\r\n ) {\r\n if (\r\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)\r\n ) {\r\n return false;\r\n }\r\n if (\r\n this.optionsStore.options.restrictions.disabledTimeIntervals.length > 0\r\n ) {\r\n for (let disabledTimeIntervals of this.optionsStore.options.restrictions.disabledTimeIntervals) {\r\n if (\r\n targetDate.isBetween(\r\n disabledTimeIntervals.from,\r\n disabledTimeIntervals.to\r\n )\r\n )\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.disabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledDates(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.format(getFormatByUnit(Unit.date));\r\n return this.optionsStore.options.restrictions.enabledDates\r\n .map((x) => x.format(getFormatByUnit(Unit.date)))\r\n .find((x) => x === formattedDate);\r\n }\r\n\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInDisabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0\r\n )\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n private _isInEnabledHours(testDate: DateTime) {\r\n if (\r\n !this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0\r\n )\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.find(\r\n (x) => x === formattedDate\r\n );\r\n }\r\n}\r\n","import { Unit } from '../datetime';\r\nimport ActionTypes from './action-types';\r\nimport { BaseEvent } from './event-types';\r\n\r\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\r\n\r\nexport class EventEmitter {\r\n private subscribers: ((value?: T) => void)[] = [];\r\n\r\n subscribe(callback: (value: T) => void) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n\r\n unsubscribe(index: number) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n\r\n emit(value?: T) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n}\r\n\r\nexport class EventEmitters {\r\n triggerEvent = new EventEmitter();\r\n viewUpdate = new EventEmitter();\r\n updateDisplay = new EventEmitter();\r\n action = new EventEmitter<{ e: any; action?: ActionTypes }>();\r\n\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n }\r\n}\r\n","import Options from './options';\r\nimport { DateTime } from '../datetime';\r\n\r\nconst DefaultOptions: Options = {\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: []\r\n },\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark'\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined\r\n },\r\n inline: false,\r\n theme: 'auto'\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n defaultDate: undefined,\r\n localization: {\r\n today: 'Go to today',\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n selectMonth: 'Select Month',\r\n previousMonth: 'Previous Month',\r\n nextMonth: 'Next Month',\r\n selectYear: 'Select Year',\r\n previousYear: 'Previous Year',\r\n nextYear: 'Next Year',\r\n selectDecade: 'Select Decade',\r\n previousDecade: 'Previous Decade',\r\n nextDecade: 'Next Decade',\r\n previousCentury: 'Previous Century',\r\n nextCentury: 'Next Century',\r\n pickHour: 'Pick Hour',\r\n incrementHour: 'Increment Hour',\r\n decrementHour: 'Decrement Hour',\r\n pickMinute: 'Pick Minute',\r\n incrementMinute: 'Increment Minute',\r\n decrementMinute: 'Decrement Minute',\r\n pickSecond: 'Pick Second',\r\n incrementSecond: 'Increment Second',\r\n decrementSecond: 'Decrement Second',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n selectTime: 'Select Time',\r\n selectDate: 'Select Date',\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n locale: 'default',\r\n startOfTheWeek: 0\r\n },\r\n keepInvalid: false,\r\n debug: false,\r\n allowInputToggle: false,\r\n viewDate: new DateTime(),\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n meta: {},\r\n container: undefined\r\n};\r\n\r\nexport default DefaultOptions;\r\n","import Namespace from \"./namespace\";\r\nimport {DateTime} from \"../datetime\";\r\nimport DefaultOptions from \"./default-options\";\r\nimport Options 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 if (!paths) return obj;\r\n return paths.split('.')\r\n .reduce((value, key) => (OptionConverter.isValue(value) || OptionConverter.isValue(value[key]) ?\r\n value[key] :\r\n undefined), obj);\r\n }\r\n\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param path\r\n * @param locale\r\n */\r\n static spread(provided, copyTo, path = '', locale = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n\r\n const unsupportedOptions = Object.keys(provided).filter(\r\n (x) => !Object.keys(defaultOptions).includes(x)\r\n );\r\n\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n let didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n\r\n Object.keys(provided).filter(key => key !== \"__proto__\" && key !== \"constructor\").forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.') path = path.slice(1);\r\n\r\n const defaultOptionValue = defaultOptions[key];\r\n let providedType = typeof provided[key];\r\n let defaultType = typeof defaultOptionValue;\r\n let value = provided[key];\r\n\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date || OptionConverter.ignoreProperties.includes(key)))\r\n {\r\n OptionConverter.spread(provided[key], copyTo[key], path, locale);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, locale);\r\n }\r\n\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n\r\n static processKey(key, value, providedType, defaultType, path, 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 case 'theme':\r\n const optionValues = {\r\n toolbarPlacement: ['top', 'bottom', 'default'],\r\n type: ['icons', 'sprites'],\r\n viewMode: ['clock', 'calendar', 'months', 'years', 'decades'],\r\n theme: ['light', 'dark', 'auto'],\r\n };\r\n const keyOptions = optionValues[key];\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(\r\n path.substring(1),\r\n value,\r\n keyOptions\r\n );\r\n\r\n return value;\r\n case 'meta':\r\n case 'dayViewHeaderFormat':\r\n return value;\r\n case 'container':\r\n if (\r\n value &&\r\n !(\r\n value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild\r\n )\r\n ) {\r\n Namespace.errorMessages.typeMismatch(\r\n path.substring(1),\r\n typeof value,\r\n 'HTMLElement'\r\n );\r\n }\r\n return value;\r\n case 'useTwentyfourHour':\r\n if (value === undefined || providedType === 'boolean') return value;\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n break;\r\n default:\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(\r\n path,\r\n providedType,\r\n defaultType\r\n );\r\n }\r\n }\r\n }\r\n\r\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const 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, newConfig, '', locale);\r\n\r\n return newConfig;\r\n }\r\n\r\n static _dataToOptions(element, options: Options): Options {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n\r\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\r\n\r\n if (\r\n !eData ||\r\n Object.keys(eData).length === 0 ||\r\n eData.constructor !== DOMStringMap\r\n )\r\n return options;\r\n let dataOptions = {} as Options;\r\n\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n\r\n return lowered;\r\n };\r\n\r\n const rabbitHole = (\r\n split: string[],\r\n index: number,\r\n optionSubgroup: {},\r\n value: any\r\n ) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n\r\n if (keyOption === undefined) return internalObject;\r\n\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption].constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = rabbitHole(\r\n split,\r\n index,\r\n optionSubgroup[keyOption],\r\n value\r\n );\r\n } else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n const optionsLower = objectToNormalized(options);\r\n\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (\r\n keyOption !== undefined &&\r\n options[keyOption].constructor === Object\r\n ) {\r\n dataOptions[keyOption] = rabbitHole(\r\n split,\r\n 1,\r\n options[keyOption],\r\n eData[`td${key}`]\r\n );\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @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\r\n if (this.optionsStore.currentView === \"calendar\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.daysContainer,\r\n this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n )\r\n );\r\n\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\r\n Unit.month\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\r\n Unit.month\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n\r\n container\r\n .querySelectorAll(\r\n `[data-action=\"${ActionTypes.selectDay}\"], .${Namespace.css.calendarWeeks}`\r\n )\r\n .forEach((containerClone: HTMLElement) => {\r\n if (\r\n this.optionsStore.options.display.calendarWeeks &&\r\n containerClone.classList.contains(Namespace.css.calendarWeeks)\r\n ) {\r\n if (containerClone.innerText === \"#\") return;\r\n containerClone.innerText = `${innerDate.week}`;\r\n return;\r\n }\r\n\r\n let classes: string[] = [];\r\n classes.push(Namespace.css.day);\r\n\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.date)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n\r\n paint(Unit.date, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}`\r\n );\r\n containerClone.setAttribute(\"data-day\", `${innerDate.date}`);\r\n containerClone.innerText = innerDate.format({ day: \"numeric\" });\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n\r\n /***\r\n * Generates an html row that contains the days of the week.\r\n * @private\r\n */\r\n private _daysOfTheWeek(): HTMLElement[] {\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(\"weekDay\", this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement(\"div\");\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.calendarWeeks,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = \"#\";\r\n row.push(htmlDivElement);\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement(\"div\");\r\n htmlDivElement.classList.add(\r\n Namespace.css.dayOfTheWeek,\r\n Namespace.css.noHighlight\r\n );\r\n htmlDivElement.innerText = innerDate.format({ weekday: \"short\" });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n\r\n return row;\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { Paint } from '../index';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `month`\r\n */\r\nexport default class MonthDisplay {\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMonth);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.monthsContainer\r\n )[0];\r\n\r\n if(this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switcher.setAttribute(\r\n Namespace.css.monthsContainer,\r\n this.optionsStore.viewDate.format({ year: 'numeric' })\r\n );\r\n\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\r\n Unit.year\r\n )\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\r\n Unit.year\r\n )\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n let classes = [];\r\n classes.push(Namespace.css.month);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n}\r\n","import { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Dates from \"../../dates\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `year`\r\n */\r\nexport default class YearDisplay {\r\n private _startYear: DateTime;\r\n private _endYear: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.yearsContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectYear);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.yearsContainer\r\n )[0];\r\n\r\n if (this.optionsStore.currentView === \"years\") {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n switcher.setAttribute(\r\n Namespace.css.yearsContainer,\r\n `${this._startYear.format({ year: \"numeric\" })}-${this._endYear.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n let innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.year);\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\"data-value\", `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: \"numeric\" });\r\n\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n}\r\n","import Dates from \"../../dates\";\r\nimport { DateTime, Unit } from \"../../datetime\";\r\nimport Namespace from \"../../utilities/namespace\";\r\nimport Validation from \"../../validation\";\r\nimport { Paint } from \"../index\";\r\nimport { serviceLocator } from \"../../utilities/service-locator\";\r\nimport ActionTypes from \"../../utilities/action-types\";\r\nimport { OptionsStore } from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class DecadeDisplay {\r\n private _startDecade: DateTime;\r\n private _endDecade: DateTime;\r\n private optionsStore: OptionsStore;\r\n private dates: Dates;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(Namespace.css.decadesContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement(\"div\");\r\n div.setAttribute(\"data-action\", ActionTypes.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint) {\r\n const [start, end] = Dates.getStartEndYear(\r\n 100,\r\n this.optionsStore.viewDate.year\r\n );\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.decadesContainer\r\n )[0];\r\n\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName(\"div\");\r\n\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(\r\n Namespace.css.decadesContainer,\r\n `${this._startDecade.format({ year: \"numeric\" })}-${this._endDecade.format({ year: \"numeric\" })}`\r\n );\r\n\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\r\n .forEach((containerClone: HTMLElement, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = \" \";\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute(\"data-value\", ``);\r\n return;\r\n } else {\r\n containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: \"numeric\" });\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n return;\r\n }\r\n }\r\n\r\n let classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n\r\n if (\r\n !this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0\r\n ) {\r\n classes.push(Namespace.css.active);\r\n }\r\n\r\n paint(\"decade\", this._startDecade, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n \"data-value\",\r\n `${this._startDecade.year}`\r\n );\r\n containerClone.innerText = `${this._startDecade.format({ year: \"numeric\" })}`;\r\n\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport Dates from '../../dates';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates the clock display\r\n */\r\nexport default class TimeDisplay {\r\n private _gridColumns = '';\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n\r\n container.append(...this._grid(iconTag));\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget: HTMLElement): void {\r\n const timesDiv = (\r\n widget.getElementsByClassName(\r\n Namespace.css.clockContainer\r\n )[0]\r\n );\r\n const lastPicked = (\r\n this.dates.lastPicked || this.optionsStore.viewDate\r\n ).clone;\r\n\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\r\n Unit.hours\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.hours}]`\r\n ).innerText = this.optionsStore.options.display.components.useTwentyfourHour\r\n ? lastPicked.hoursFormatted\r\n : lastPicked.twelveHoursFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\r\n Unit.minutes\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.minutes}]`\r\n ).innerText = lastPicked.minutesFormatted;\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n\r\n if (\r\n !this.validation.isValid(\r\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\r\n Unit.seconds\r\n )\r\n ) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(\r\n `[data-time-component=${Unit.seconds}]`\r\n ).innerText = lastPicked.secondsFormatted;\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n const toggle = timesDiv.querySelector(\r\n `[data-action=${ActionTypes.toggleMeridiem}]`\r\n );\r\n\r\n toggle.innerText = lastPicked.meridiem();\r\n\r\n if (\r\n !this.validation.isValid(\r\n lastPicked.clone.manipulate(\r\n lastPicked.hours >= 12 ? -12 : 12,\r\n Unit.hours\r\n )\r\n )\r\n ) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n } else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\r\n this._gridColumns = '';\r\n const top = [],\r\n middle = [],\r\n bottom = [],\r\n separator = document.createElement('div'),\r\n upIcon = iconTag(\r\n this.optionsStore.options.display.icons.up\r\n ),\r\n downIcon = iconTag(\r\n this.optionsStore.options.display.icons.down\r\n );\r\n\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n\r\n const getSeparator = (colon = false): HTMLElement => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementHour\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementMinute\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.incrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.pickSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n\r\n divElement = document.createElement('div');\r\n divElement.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.decrementSecond\r\n );\r\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n\r\n if (!this.optionsStore.options.display.components.useTwentyfourHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n\r\n let button = document.createElement('button');\r\n button.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.toggleMeridiem\r\n );\r\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) { //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else button.classList.add(Namespace.css.toggleMeridiem);\r\n\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n\r\n this._gridColumns = this._gridColumns.trim();\r\n\r\n return [...top, ...middle, ...bottom];\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `hours`\r\n */\r\nexport default class HourDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n\r\n for (\r\n let i = 0;\r\n i <\r\n (this.optionsStore.options.display.components.useTwentyfourHour ? 24 : 12);\r\n i++\r\n ) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectHour);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.hourContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.hour);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = this.optionsStore.options.display.components\r\n .useTwentyfourHour\r\n ? innerDate.hoursFormatted\r\n : innerDate.twelveHoursFormatted;\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `minutes`\r\n */\r\nexport default class MinuteDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectMinute);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.minuteContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n let step =\r\n this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.minute);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute(\r\n 'data-value',\r\n `${innerDate.minutes}`\r\n );\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n}\r\n","import { Unit } from '../../datetime';\r\nimport Namespace from '../../utilities/namespace';\r\nimport Validation from '../../validation';\r\nimport { serviceLocator } from '../../utilities/service-locator';\r\nimport { Paint } from '../index';\r\nimport ActionTypes from '../../utilities/action-types';\r\nimport {OptionsStore} from \"../../utilities/optionsStore\";\r\n\r\n/**\r\n * Creates and updates the grid for `seconds`\r\n */\r\nexport default class secondDisplay {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker(): HTMLElement {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.selectSecond);\r\n container.appendChild(div);\r\n }\r\n\r\n return container;\r\n }\r\n\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget: HTMLElement, paint: Paint): void {\r\n const container = widget.getElementsByClassName(\r\n Namespace.css.secondContainer\r\n )[0];\r\n let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\r\n .forEach((containerClone: HTMLElement) => {\r\n let classes = [];\r\n classes.push(Namespace.css.second);\r\n\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n}\r\n","import Namespace from '../utilities/namespace';\r\n\r\n/**\r\n * Provides a collapse functionality to the view changes\r\n */\r\nexport default class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target: HTMLElement) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n } else {\r\n this.show(target);\r\n }\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target: HTMLElement) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target: HTMLElement) {\r\n if (!target) return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target: HTMLElement) {\r\n if (\r\n target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show)\r\n )\r\n return;\r\n\r\n let timeOut = null;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n timeOut = null;\r\n };\r\n\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n\r\n const reflow = (element) => element.offsetHeight;\r\n\r\n reflow(target);\r\n\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n\r\n timeOut = setTimeout(\r\n complete,\r\n this.getTransitionDurationFromElement(target)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } =\r\n window.getComputedStyle(element);\r\n\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n\r\n return (\r\n (Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000\r\n );\r\n };\r\n}\r\n","import DateDisplay from './calendar/date-display';\r\nimport MonthDisplay from './calendar/month-display';\r\nimport YearDisplay from './calendar/year-display';\r\nimport DecadeDisplay from './calendar/decade-display';\r\nimport TimeDisplay from './time/time-display';\r\nimport HourDisplay from './time/hour-display';\r\nimport MinuteDisplay from './time/minute-display';\r\nimport SecondDisplay from './time/second-display';\r\nimport { DateTime, Unit } from '../datetime';\r\nimport { 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(\r\n _unit: Unit | 'decade',\r\n _date: DateTime,\r\n _classes: string[],\r\n _element: HTMLElement\r\n ) {\r\n // implemented in plugin\r\n }\r\n\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * @fires Events#show\r\n */\r\n show(): void {\r\n if (this.widget == undefined) {\r\n if (this.dates.picked.length == 0) {\r\n if (\r\n this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate\r\n ) {\r\n const date = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (\r\n this.optionsStore.options.restrictions.maxDate?.isBefore(date)\r\n ) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date)) {\r\n date.manipulate(direction, Unit.date);\r\n if (tries > 31) break;\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n\r\n this._buildWidget();\r\n this._updateTheme();\r\n\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes.showClock,\r\n });\r\n }\r\n\r\n // otherwise return to the calendar view\r\n if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n\r\n if (\r\n !onlyClock &&\r\n this.optionsStore.options.display.viewMode !== 'clock'\r\n ) {\r\n if (this._hasTime) {\r\n if(!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n } else {\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.timeContainer}`)\r\n );\r\n }\r\n }\r\n Collapse.show(\r\n this.widget.querySelector(`div.${Namespace.css.dateContainer}`)\r\n );\r\n }\r\n\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n container.appendChild(this.widget);\r\n\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 /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme) return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferedQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n } else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferedQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n\r\n _getThemeClass(): string {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n\r\n const isDarkMode =\r\n window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferedQuery).matches;\r\n\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n\r\n _updateCalendarHeader() {\r\n const showing = [\r\n ...this.widget.querySelector(\r\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\r\n ).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousCentury\r\n );\r\n switcher.setAttribute('title', '');\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextCentury\r\n );\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousDecade\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDecade\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextDecade\r\n );\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousYear\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectYear\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextYear\r\n );\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.previousMonth\r\n );\r\n switcher.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectMonth\r\n );\r\n next.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.nextMonth\r\n );\r\n switcher.innerText = this.optionsStore.viewDate.format(\r\n this.optionsStore.options.localization.dayViewHeaderFormat\r\n );\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * @fires Events#hide\r\n */\r\n hide(): void {\r\n if (!this.widget || !this._isVisible) return;\r\n\r\n this.widget.classList.remove(Namespace.css.show);\r\n\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset\r\n ? null\r\n : this.dates.lastPicked\r\n ? this.dates.lastPicked.clone\r\n : void 0,\r\n } as HideEvent);\r\n this._isVisible = false;\r\n }\r\n\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget) return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) =>\r\n element.removeEventListener('click', this._actionsClickEvent)\r\n );\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n private _buildWidget(): HTMLElement {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(\r\n this.getHeadTemplate(),\r\n this.decadeDisplay.getPicker(),\r\n this.yearDisplay.getPicker(),\r\n this.monthDisplay.getPicker(),\r\n this.dateDisplay.getPicker()\r\n );\r\n\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n\r\n if (\r\n this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n return;\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n if (this._hasDate) {\r\n if (this._hasTime) {\r\n dateView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode !== 'clock')\r\n dateView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(dateView);\r\n }\r\n\r\n if (this._hasTime) {\r\n if (this._hasDate) {\r\n timeView.classList.add(Namespace.css.collapse);\r\n if (this.optionsStore.options.display.viewMode === 'clock')\r\n timeView.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(timeView);\r\n }\r\n\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n\r\n this._widget = template;\r\n }\r\n\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds)\r\n );\r\n }\r\n\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate(): boolean {\r\n return (\r\n this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date)\r\n );\r\n }\r\n\r\n /**\r\n * Get the toolbar html based on options like buttons.today\r\n * @private\r\n */\r\n getToolbarElements(): HTMLElement[] {\r\n const toolbar = [];\r\n\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.today)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (\r\n !this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime\r\n ) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n } else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.togglePicker);\r\n div.setAttribute('title', title);\r\n\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.clear)\r\n );\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n\r\n div.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.close)\r\n );\r\n toolbar.push(div);\r\n }\r\n\r\n return toolbar;\r\n }\r\n\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate(): HTMLElement {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes.previous);\r\n previous.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.previous)\r\n );\r\n\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\r\n\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes.next);\r\n next.appendChild(\r\n this._iconTag(this.optionsStore.options.display.icons.next)\r\n );\r\n\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons.type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass: string): HTMLElement | SVGElement {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n const icon = document.createElementNS(\r\n 'http://www.w3.org/2000/svg',\r\n 'use'\r\n );\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n private _documentClickEvent = (e: MouseEvent) => {\r\n if (this.optionsStore.options.debug || (window as any).debug) return;\r\n\r\n if (\r\n this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n private _actionsClickEvent = (e: MouseEvent) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n if (wasVisible) this.hide();\r\n this._dispose();\r\n if (wasVisible) {\r\n this.show();\r\n }\r\n }\r\n}\r\n\r\nexport type Paint = (\r\n unit: Unit | 'decade',\r\n innerDate: DateTime,\r\n classes: string[],\r\n element: HTMLElement\r\n) => void;\r\n","import { DateTime, Unit } from \"./datetime\";\r\nimport Collapse from \"./display/collapse\";\r\nimport Namespace from \"./utilities/namespace\";\r\nimport Dates from \"./dates\";\r\nimport Validation from \"./validation\";\r\nimport Display from \"./display\";\r\nimport { EventEmitters } from \"./utilities/event-emitter\";\r\nimport { serviceLocator } from \"./utilities/service-locator.js\";\r\nimport ActionTypes from \"./utilities/action-types\";\r\nimport CalendarModes from \"./utilities/calendar-modes\";\r\nimport { OptionsStore } from \"./utilities/optionsStore\";\r\n\r\n/**\r\n *\r\n */\r\nexport default class Actions {\r\n private optionsStore: OptionsStore;\r\n private validation: Validation;\r\n private dates: Dates;\r\n private display: Display;\r\n private _eventEmitters: EventEmitters;\r\n\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n do(e: any, action?: ActionTypes) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return false;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n\r\n switch (action) {\r\n case ActionTypes.next:\r\n case ActionTypes.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.selectMonth:\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes.selectYear:\r\n case ActionTypes.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n\r\n if (\r\n this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode\r\n ) {\r\n this.dates.setValue(\r\n this.optionsStore.viewDate,\r\n this.dates.lastPickedIndex\r\n );\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n } else {\r\n this.display._showMode(-1);\r\n }\r\n break;\r\n case ActionTypes.selectDay:\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n\r\n day.date = +currentTarget.dataset.day;\r\n let index = 0;\r\n if (this.optionsStore.options.multipleDates) {\r\n index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex + 1);\r\n }\r\n } else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n\r\n if (\r\n !this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates\r\n ) {\r\n this.display.hide();\r\n }\r\n break;\r\n case ActionTypes.selectHour:\r\n let hour = +currentTarget.dataset.value;\r\n if (\r\n lastPicked.hours >= 12 &&\r\n !this.optionsStore.options.display.components.useTwentyfourHour\r\n )\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectMinute:\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.selectSecond:\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n case ActionTypes.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes.incrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping\r\n );\r\n break;\r\n case ActionTypes.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes.decrementMinutes:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.minutes,\r\n this.optionsStore.options.stepping * -1\r\n );\r\n break;\r\n case ActionTypes.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes.toggleMeridiem:\r\n this.manipulateAndSet(\r\n lastPicked,\r\n Unit.hours,\r\n this.dates.lastPicked.hours >= 12 ? -12 : 12\r\n );\r\n break;\r\n case ActionTypes.togglePicker:\r\n if (\r\n currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate\r\n ) {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectTime\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.time\r\n ).outerHTML;\r\n\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n } else {\r\n currentTarget.setAttribute(\r\n 'title',\r\n this.optionsStore.options.localization.selectDate\r\n );\r\n currentTarget.innerHTML = this.display._iconTag(\r\n this.optionsStore.options.display.icons.date\r\n ).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n\r\n this.display.widget\r\n .querySelectorAll(\r\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\r\n )\r\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n break;\r\n case ActionTypes.showClock:\r\n case ActionTypes.showHours:\r\n case ActionTypes.showMinutes:\r\n case ActionTypes.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide && this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.widget.querySelector(`div.${Namespace.css.dateContainer}`));\r\n //show clock\r\n Collapse.showImmediately(this.display.widget.querySelector(`div.${Namespace.css.timeContainer}`));\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes.today:\r\n const today = new DateTime().setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.viewDate = today;\r\n if (this.validation.isValid(today, Unit.date))\r\n this.dates.setValue(today, this.dates.lastPickedIndex);\r\n break;\r\n }\r\n }\r\n\r\n private handleShowClockContainers(action: ActionTypes) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n return;\r\n }\r\n\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach(\r\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\r\n );\r\n\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n\r\n ((\r\n this.display.widget.getElementsByClassName(classToUse)[0]\r\n )).style.display = 'grid';\r\n }\r\n\r\n private handleNextPrevious(action: ActionTypes) {\r\n const {unit, step} =\r\n CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n\r\n this.display._showMode();\r\n }\r\n\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n private hideOrClock(e) {\r\n if (\r\n this.optionsStore.options.display.components.useTwentyfourHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline\r\n ) {\r\n this.display.hide();\r\n } else {\r\n this.do(e, ActionTypes.showClock);\r\n }\r\n }\r\n\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n}\r\n","import Display from './display/index';\r\nimport Dates from './dates';\r\nimport Actions from './actions';\r\nimport { DateTime, DateTimeFormatOptions, Unit } from './datetime';\r\nimport Namespace from './utilities/namespace';\r\nimport Options from './utilities/options';\r\nimport {\r\n BaseEvent,\r\n ChangeEvent,\r\n ViewUpdateEvent,\r\n} from './utilities/event-types';\r\nimport { EventEmitters } from './utilities/event-emitter';\r\nimport {\r\n serviceLocator,\r\n setupServiceLocator,\r\n} from './utilities/service-locator';\r\nimport CalendarModes from './utilities/calendar-modes';\r\nimport DefaultOptions from './utilities/default-options';\r\nimport ActionTypes from './utilities/action-types';\r\nimport {OptionsStore} from \"./utilities/optionsStore\";\r\nimport {OptionConverter} from \"./utilities/optionConverter\";\r\n\r\n/**\r\n * A robust and powerful date/time picker component.\r\n */\r\nclass TempusDominus {\r\n _subscribers: { [key: string]: ((event: any) => {})[] } = {};\r\n private _isDisabled = false;\r\n private _toggle: HTMLElement;\r\n private _currentPromptTimeTimeout: any;\r\n private actions: Actions;\r\n private optionsStore: OptionsStore;\r\n private _eventEmitters: EventEmitters;\r\n display: Display;\r\n dates: Dates;\r\n\r\n constructor(element: HTMLElement, options: Options = {} as Options) {\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocale(\r\n this.optionsStore.options.localization.locale\r\n );\r\n this.optionsStore.unset = true;\r\n\r\n this._initializeInput();\r\n this._initializeToggle();\r\n\r\n if (this.optionsStore.options.display.inline) this.display.show();\r\n\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n }\r\n\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false): void {\r\n if (reset) this._initializeOptions(options, DefaultOptions);\r\n else this._initializeOptions(options, this.optionsStore.options);\r\n this.display._rebuild();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle(): void {\r\n if (this._isDisabled) return;\r\n this.display.toggle();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show(): void {\r\n if (this._isDisabled) return;\r\n this.display.show();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide(): void {\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable(): void {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable(): void {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear(): void {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(\r\n eventTypes: string | string[],\r\n callbacks: (event: any) => void | ((event: any) => void)[]\r\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray: any[];\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n } else {\r\n callBackArray = callbacks;\r\n }\r\n\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n\r\n const returnArray = [];\r\n\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(\r\n this,\r\n eventType,\r\n this._subscribers[eventType].length - 1\r\n ),\r\n });\r\n\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n\r\n return returnArray;\r\n }\r\n\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this.optionsStore.input?.removeEventListener(\r\n 'change',\r\n this._inputChangeEvent\r\n );\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener(\r\n 'click',\r\n this._toggleClickEvent\r\n );\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language: string) {\r\n let asked = loadedLocales[language];\r\n if (!asked) return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n private _triggerEvent(event: BaseEvent) {\r\n event.viewMode = this.optionsStore.currentView;\r\n\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event as ChangeEvent;\r\n if (\r\n (date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)\r\n ) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event as ChangeEvent);\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n this.optionsStore.input?.dispatchEvent(\r\n new CustomEvent('change', { detail: event as any })\r\n );\r\n }\r\n\r\n this.optionsStore.element.dispatchEvent(\r\n new CustomEvent(event.type, { detail: event as any })\r\n );\r\n\r\n if ((window as any).jQuery) {\r\n const $ = (window as any).jQuery;\r\n\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n } else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n\r\n this._publish(event);\r\n }\r\n\r\n private _publish(event: BaseEvent) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n private _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n } as ViewUpdateEvent);\r\n }\r\n\r\n private _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n private _initializeOptions(\r\n config: Options,\r\n mergeTo: Options,\r\n includeDataset = false\r\n ): void {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(\r\n this.optionsStore.element,\r\n newConfig\r\n );\r\n\r\n OptionConverter._validateConflicts(newConfig);\r\n\r\n newConfig.viewDate = newConfig.viewDate.setLocale(newConfig.localization.locale);\r\n\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n this.optionsStore.minimumCalendarViewMode,\r\n this.optionsStore.currentCalendarViewMode\r\n );\r\n\r\n // Update view mode if needed\r\n if (\r\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode\r\n ) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(\r\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\r\n this.optionsStore.minimumCalendarViewMode\r\n );\r\n }\r\n\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n\r\n if (newConfig.display.components.useTwentyfourHour === undefined) {\r\n newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod;\r\n }\r\n\r\n\r\n this.optionsStore.options = newConfig;\r\n }\r\n\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n private _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\r\n } else {\r\n let query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n } else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n\r\n if (!this.optionsStore.input) return;\r\n\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n private _initializeToggle() {\r\n if (this.optionsStore.options.display.inline) return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n private _handleAfterChangeEvent(e: ChangeEvent) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer)\r\n )\r\n return;\r\n\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if (\r\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))\r\n ) {\r\n return;\r\n }\r\n\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector(\r\n `.${Namespace.css.switch} div`\r\n ),\r\n },\r\n action: ActionTypes.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _inputChangeEvent = (event?: any) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered) return;\r\n\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates) {\r\n try {\r\n const valueSplit = value.split(\r\n this.optionsStore.options.multipleDatesSeparator\r\n );\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n } catch {\r\n console.warn(\r\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\r\n );\r\n }\r\n } else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n private _toggleClickEvent = () => {\r\n if ((this.optionsStore.element as any)?.disabled || this.optionsStore.input?.disabled) return\r\n this.toggle();\r\n };\r\n}\r\n\r\n/**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\nconst loadedLocales = {};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\nconst loadLocale = (l) => {\r\n if (loadedLocales[l.name]) return;\r\n loadedLocales[l.name] = l.localization;\r\n};\r\n\r\n/**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\nconst locale = (l: string) => {\r\n let asked = loadedLocales[l];\r\n if (!asked) return;\r\n DefaultOptions.localization = asked;\r\n};\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n/**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\nconst extend = function (plugin, option) {\r\n if (!plugin.$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\nconst version = '6.0.0-beta9';\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 version\r\n};\r\n"],"names":["Unit","version","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,C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CAAC,MAAM,CAAC,IAAI,CAAC;wBAC9B,CAAC,EAAE;4BACD,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAC9C,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,MAAM,CAC/B;yBACF;wBACD,MAAM,EAAEA,aAAW,CAAC,YAAY;qBACjC,CAAC,CAAC;iBACJ;aACF,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;SACrE;KA8CF;IAED;;;;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,EAAE;UAEI,OAAO,GAAG;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.min.js b/dist/js/tempus-dominus.min.js index ef1298743..aeb2439b9 100644 --- a/dist/js/tempus-dominus.min.js +++ b/dist/js/tempus-dominus.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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},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-beta8",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?t.split(".").reduce(((t,e)=>S.isValue(t)||S.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i=""){const o=S.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=S.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));l.errorMessages.unexpectedOptions(e)}Object.keys(t).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,l=t[a];if(null==l)return e[a]=l,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||S.ignoreProperties.includes(a)?e[a]=S.processKey(a,l,r,d,s,i):S.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");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=S.deepCopy(e),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,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 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.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 _{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 showImmediately(t){t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse,l.css.show),t.style.height=""}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((()=>{U.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t.classList.remove(l.css.collapsing,l.css.show),t.classList.add(l.css.collapse)}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((()=>{U.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}U.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{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(C),this.decadeDisplay=h.locate(_),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||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&U.hideImmediately(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.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(U.hideImmediately(this.display.widget.querySelector(`div.${l.css.dateContainer}`)),U.showImmediately(this.display.widget.querySelector(`div.${l.css.timeContainer}`))),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})})); +!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(){return this.parts(void 0,o).hour}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-beta9",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",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferedQuery="(prefers-color-scheme: dark)"}},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)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class v{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy()}}const g={restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto"},stepping:1,useCurrent:!0,defaultDate:void 0,localization:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",previousMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",previousYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",previousDecade:"Previous Decade",nextDecade:"Next Decade",previousCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",toggleMeridiem:"Toggle Meridiem",selectTime:"Select Time",selectDate:"Select Date",dayViewHeaderFormat:{month:"long",year:"2-digit"},locale:"default",startOfTheWeek:0},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?t.split(".").reduce(((t,e)=>S.isValue(t)||S.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s="",i=""){const o=S.objectPath(s,g),a=Object.keys(t).filter((t=>!Object.keys(o).includes(t)));if(a.length>0){const t=S.getFlattenDefaultOptions(),e=a.map((e=>{let i=`"${s}.${e}" in not a known option.`,o=t.find((t=>t.includes(e)));return o&&(i+=` Did you mean "${o}"?`),i}));l.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((a=>{"."===(s+=`.${a}`).charAt(0)&&(s=s.slice(1));const n=o[a];let r=typeof t[a],d=typeof n,l=t[a];if(null==l)return e[a]=l,void(s=s.substring(0,s.lastIndexOf(`.${a}`)));"object"!=typeof n||Array.isArray(t[a])||n instanceof Date||S.ignoreProperties.includes(a)?e[a]=S.processKey(a,l,r,d,s,i):S.spread(t[a],e[a],s,i),s=s.substring(0,s.lastIndexOf(`.${a}`))}))}static processKey(t,e,s,i,o,a){switch(t){case"defaultDate":{const t=this.dateConversion(e,"defaultDate");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":case"theme":const r={toolbarPlacement:["top","bottom","default"],type:["icons","sprites"],viewMode:["clock","calendar","months","years","decades"],theme:["light","dark","auto"]}[t];return r.includes(e)||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;case"useTwentyfourHour":if(void 0===e||"boolean"===s)return e;l.errorMessages.typeMismatch(o,s,i);break;default:switch(i){case"boolean":return"true"===e||!0===e;case"number":return+e;case"string":return e.toString();case"object":return{};case"function":return e;default:l.errorMessages.typeMismatch(o,s,i)}}}static _mergeOptions(t,e){var s;const i=S.deepCopy(e),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,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 w{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 b=f;class D{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(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",b.selectDay),t.appendChild(s)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.daysContainer)[0];if("calendar"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(l.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?s.classList.remove(l.css.disabled):s.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?e.classList.remove(l.css.disabled):e.classList.add(l.css.disabled),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)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);i.querySelectorAll(`[data-action="${b.selectDay}"], .${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=`${o.week}`)}let i=[];i.push(l.css.day),o.isBefore(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.old),o.isAfter(this.optionsStore.viewDate,t.Unit.month)&&i.push(l.css.new),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.date)&&i.push(l.css.active),this.validation.isValid(o,t.Unit.date)||i.push(l.css.disabled),o.isSame(new n,t.Unit.date)&&i.push(l.css.today),0!==o.weekDay&&6!==o.weekDay||i.push(l.css.weekend),s(t.Unit.date,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}-${o.monthFormatted}-${o.dateFormatted}`),e.setAttribute("data-day",`${o.date}`),e.innerText=o.format({day:"numeric"}),o.manipulate(1,t.Unit.date)}))}_daysOfTheWeek(){let e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date);const s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(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(w),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",b.selectMonth),t.appendChild(e)}return t}_update(e,s){const i=e.getElementsByClassName(l.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(l.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(l.css.disabled):s.classList.add(l.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(l.css.disabled):e.classList.add(l.css.disabled),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)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year);i.querySelectorAll(`[data-action="${b.selectMonth}"]`).forEach(((e,i)=>{let a=[];a.push(l.css.month),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.month)&&a.push(l.css.active),this.validation.isValid(o,t.Unit.month)||a.push(l.css.disabled),s(t.Unit.month,o,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${i}`),e.innerText=`${o.format({month:"short"})}`,o.manipulate(1,t.Unit.month)}))}}class _{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const i=e.getElementsByClassName(l.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,o]=i.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(l.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(l.css.disabled):s.classList.add(l.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(l.css.disabled):e.classList.add(l.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?o.classList.remove(l.css.disabled):o.classList.add(l.css.disabled)}let o=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);i.querySelectorAll(`[data-action="${b.selectYear}"]`).forEach((e=>{let i=[];i.push(l.css.year),!this.optionsStore.unset&&this.dates.isPicked(o,t.Unit.year)&&i.push(l.css.active),this.validation.isValid(o,t.Unit.year)||i.push(l.css.disabled),s(t.Unit.year,o,i,e),e.classList.remove(...e.classList),e.classList.add(...i),e.setAttribute("data-value",`${o.year}`),e.innerText=o.format({year:"numeric"}),o.manipulate(1,t.Unit.year)}))}}class C{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(l.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",b.selectDecade),t.appendChild(e)}return t}_update(e,s){const[i,o]=w.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=i,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=o;const a=e.getElementsByClassName(l.css.decadesContainer)[0],[n,r,d]=a.parentElement.getElementsByClassName(l.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(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="${b.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(w),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=${b.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=${b.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=${b.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=${b.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=${b.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=${b.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=${b.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",b.incrementHours),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",b.showHours),e.setAttribute("data-time-component",t.Unit.hours),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",b.decrementHours),e.appendChild(r.cloneNode(!0)),o.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(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",b.incrementMinutes),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",b.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",b.decrementMinutes),e.appendChild(r.cloneNode(!0)),o.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(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",b.incrementSeconds),e.appendChild(n.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",b.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),i.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",b.decrementSeconds),e.appendChild(r.cloneNode(!0)),o.push(e)}if(!this.optionsStore.options.display.components.useTwentyfourHour){this._gridColumns+=" a";let t=c();s.push(t);let e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",b.toggleMeridiem),e.setAttribute("tabindex","-1"),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",b.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="${b.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 T{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",b.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="${b.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.minutes}`),e.innerText=o.minutesFormatted,o.manipulate(a,t.Unit.minutes)}))}}class L{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",b.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="${b.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 showImmediately(t){t.classList.remove(l.css.collapsing),t.classList.add(l.css.collapse,l.css.show),t.style.height=""}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((()=>{U.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(l.css.collapsing,l.css.show),t.classList.add(l.css.collapse))}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((()=>{U.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}U.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class A{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{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(w),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(T),this.secondDisplay=h.locate(L),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(),this._updateTheme();const o=this._hasTime&&!this._hasDate;if(o&&(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:b.showClock})),this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),o||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?U.show(this.widget.querySelector(`div.${l.css.timeContainer}`)):U.hideImmediately(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:b.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(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()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(l.css.isDarkPreferedQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(l.css.isDarkPreferedQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(l.css.isDarkPreferedQuery).matches;switch(t){case"light":return l.css.lightTheme;case"dark":return l.css.darkTheme;case"auto":return e?l.css.darkTheme:l.css.lightTheme}}_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",b.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",b.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",b.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",b.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(l.css.calendarHeader);const e=document.createElement("div");e.classList.add(l.css.previous),e.setAttribute("data-action",b.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(l.css.switch),s.setAttribute("data-action",b.changeCalendarView);const i=document.createElement("div");return i.classList.add(l.css.next),i.setAttribute("data-action",b.next),i.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,i),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;t&&this.hide(),this._dispose(),t&&this.show()}}class ${constructor(){this.optionsStore=h.locate(u),this.dates=h.locate(w),this.validation=h.locate(m),this.display=h.locate(A),this._eventEmitters=h.locate(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 b.next:case b.previous:this.handleNextPrevious(s);break;case b.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case b.selectMonth:case b.selectYear:case b.selectDecade:const i=+a.dataset.value;switch(s){case b.selectMonth:this.optionsStore.viewDate.month=i;break;case b.selectYear:case b.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 b.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 b.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 b.selectMinute:r.minutes=+a.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.selectSecond:r.seconds=+a.dataset.value,this.dates.setValue(r,this.dates.lastPickedIndex),this.hideOrClock(e);break;case b.incrementHours:this.manipulateAndSet(r,t.Unit.hours);break;case b.incrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,this.optionsStore.options.stepping);break;case b.incrementSeconds:this.manipulateAndSet(r,t.Unit.seconds);break;case b.decrementHours:this.manipulateAndSet(r,t.Unit.hours,-1);break;case b.decrementMinutes:this.manipulateAndSet(r,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case b.decrementSeconds:this.manipulateAndSet(r,t.Unit.seconds,-1);break;case b.toggleMeridiem:this.manipulateAndSet(r,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case b.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.handleShowClockContainers(b.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 b.showClock:case b.showHours:case b.showMinutes:case b.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(U.hideImmediately(this.display.widget.querySelector(`div.${l.css.dateContainer}`)),U.showImmediately(this.display.widget.querySelector(`div.${l.css.timeContainer}`))),this.handleShowClockContainers(s);break;case b.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case b.close:this.display.hide();break;case b.today:const h=(new 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 b.showClock:s=l.css.clockContainer,this.display._update("clock");break;case b.showHours:s=l.css.hourContainer,this.display._update(t.Unit.hours);break;case b.showMinutes:s=l.css.minuteContainer,this.display._update(t.Unit.minutes);break;case b.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===b.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){!this.optionsStore.options.display.components.useTwentyfourHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,b.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}}class O{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{if(null==t?void 0:t.detail)return;const e=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},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(w),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,o;let a=S.deepCopy(t);a=S._mergeOptions(a,e),s&&(a=S._dataToOptions(this.optionsStore.element,a)),S._validateConflicts(a),a.viewDate=a.viewDate.setLocale(a.localization.locale),this.optionsStore.viewDate.isSame(a.viewDate)||(this.optionsStore.viewDate=a.viewDate),a.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),a.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),a.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==a.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===a.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),(null===(i=this.display)||void 0===i?void 0:i.isVisible)&&this.display._update("all"),void 0===a.display.components.useTwentyfourHour&&(a.display.components.useTwentyfourHour=!(null===(o=a.viewDate.parts())||void 0===o?void 0:o.dayPeriod)),this.optionsStore.options=a}_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:b.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:w,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)},t.version="6.0.0-beta9",Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/locales/ar-SA.js b/dist/locales/ar-SA.js new file mode 100644 index 000000000..ebc409ad9 --- /dev/null +++ b/dist/locales/ar-SA.js @@ -0,0 +1,37 @@ +/*! + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) + * Copyright 2013-2022 Jonathan Peterson + * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) + */ +(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ar_SA={})));})(this,(function(exports){'use strict';const name = "ar-SA"; +const localization = { + today: "اليوم", + clear: "مسح", + close: "إغلاق", + selectMonth: "اختر الشهر", + previousMonth: "الشهر السابق", + nextMonth: "الشهر التالي", + selectYear: "اختر السنة", + previousYear: "العام السابق", + nextYear: "العام التالي", + selectDecade: "اختر العقد", + previousDecade: "العقد السابق", + nextDecade: "العقد التالي", + previousCentury: "القرن السابق", + nextCentury: "القرن التالي", + pickHour: "اختر الساعة", + incrementHour: "أضف ساعة", + decrementHour: "أنقص ساعة", + pickMinute: "اختر الدقيقة", + incrementMinute: "أضف دقيقة", + decrementMinute: "أنقص دقيقة", + pickSecond: "اختر الثانية", + incrementSecond: "أضف ثانية", + decrementSecond: "أنقص ثانية", + toggleMeridiem: "تبديل الفترة", + selectTime: "اخر الوقت", + selectDate: "اختر التاريخ", + dayViewHeaderFormat: { month: "long", year: "2-digit" }, + locale: "ar-SA", + startOfTheWeek: 1, +};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/dist/locales/ar.js b/dist/locales/ar.js new file mode 100644 index 000000000..11b307342 --- /dev/null +++ b/dist/locales/ar.js @@ -0,0 +1,37 @@ +/*! + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) + * Copyright 2013-2022 Jonathan Peterson + * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) + */ +(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.ar={})));})(this,(function(exports){'use strict';const name = "ar"; +const localization = { + today: "اليوم", + clear: "مسح", + close: "إغلاق", + selectMonth: "اختر الشهر", + previousMonth: "الشهر السابق", + nextMonth: "الشهر التالي", + selectYear: "اختر السنة", + previousYear: "العام السابق", + nextYear: "العام التالي", + selectDecade: "اختر العقد", + previousDecade: "العقد السابق", + nextDecade: "العقد التالي", + previousCentury: "القرن السابق", + nextCentury: "القرن التالي", + pickHour: "اختر الساعة", + incrementHour: "أضف ساعة", + decrementHour: "أنقص ساعة", + pickMinute: "اختر الدقيقة", + incrementMinute: "أضف دقيقة", + decrementMinute: "أنقص دقيقة", + pickSecond: "اختر الثانية", + incrementSecond: "أضف ثانية", + decrementSecond: "أنقص ثانية", + toggleMeridiem: "تبديل الفترة", + selectTime: "اخر الوقت", + selectDate: "اختر التاريخ", + dayViewHeaderFormat: { month: "long", year: "2-digit" }, + locale: "ar", + startOfTheWeek: 1, +};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/dist/locales/de.js b/dist/locales/de.js index c0ef59268..c0ba6b379 100644 --- a/dist/locales/de.js +++ b/dist/locales/de.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 aa4f29d44..2e5dee36e 100644 --- a/dist/locales/es.js +++ b/dist/locales/es.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fi.js b/dist/locales/fi.js index 5ee34cabb..fc0cfd35a 100644 --- a/dist/locales/fi.js +++ b/dist/locales/fi.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) * Copyright 2013-2022 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/dist/locales/fr.js b/dist/locales/fr.js new file mode 100644 index 000000000..1305d4a6f --- /dev/null +++ b/dist/locales/fr.js @@ -0,0 +1,37 @@ +/*! + * Tempus Dominus v6.0.0-beta9 (https://getdatepicker.com/) + * Copyright 2013-2022 Jonathan Peterson + * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) + */ +(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f((g.tempusDominus=g.tempusDominus||{},g.tempusDominus.locales=g.tempusDominus.locales||{},g.tempusDominus.locales.fr={})));})(this,(function(exports){'use strict';const name = "ar"; +const localization = { + today: 'Aujourd\'hui', + clear: 'Effacer la sélection', + close: 'Fermer', + selectMonth: 'Sélectionner le mois', + previousMonth: 'Mois précédent', + nextMonth: 'Mois suivant', + selectYear: 'Sélectionner l\'année', + previousYear: 'Année précédente', + nextYear: 'Année suivante', + selectDecade: 'Sélectionner la décennie', + previousDecade: 'Décennie précédente', + nextDecade: 'Décennie suivante', + previousCentury: 'Siècle précédente', + nextCentury: 'Siècle suivante', + pickHour: "Sélectionner l\'heure", + incrementHour: "Incrementer l\'heure", + decrementHour: "Diminuer l\'heure", + pickMinute: 'Sélectionner les minutes', + incrementMinute: 'Incrementer les minutes', + decrementMinute: 'Diminuer les minutes', + pickSecond: 'Sélectionner les secondes', + incrementSecond: 'Incrementer les secondes', + decrementSecond: 'Diminuer les secondes', + toggleMeridiem: 'Basculer AM-PM', + selectTime: "Sélectionner l\'heure", + selectDate: 'Sélectionner une date', + dayViewHeaderFormat: { month: 'long', year: '2-digit' }, + locale: 'fr', + startOfTheWeek: 1 +};exports.localization=localization;exports.name=name;Object.defineProperty(exports,'__esModule',{value:true});})); \ No newline at end of file diff --git a/dist/locales/it.js b/dist/locales/it.js index 43fe9ce3d..995931e90 100644 --- a/dist/locales/it.js +++ b/dist/locales/it.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 5767e6200..8f880ff6a 100644 --- a/dist/locales/nl.js +++ b/dist/locales/nl.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 74a8a8c20..d85aba525 100644 --- a/dist/locales/ro.js +++ b/dist/locales/ro.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 e71940532..96b312737 100644 --- a/dist/locales/ru.js +++ b/dist/locales/ru.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 aa840ffbf..8604c82f2 100644 --- a/dist/plugins/examples/sample.js +++ b/dist/plugins/examples/sample.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta7 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 c76f12282..849159f60 100644 --- a/dist/plugins/fa-five.js +++ b/dist/plugins/fa-five.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 0dcd5f828..a6756000b 100644 --- a/dist/plugins/moment-parse.js +++ b/dist/plugins/moment-parse.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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 6238f0b03..6f75932bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta8", + "version": "6.0.0-beta9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta8", + "version": "6.0.0-beta9", "license": "MIT", "devDependencies": { "@popperjs/core": "^2.11.2", diff --git a/package.json b/package.json index 7c31cc6a3..be2e4c784 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "Jonathan Peterson" }, "name": "@eonasdan/tempus-dominus", - "version": "6.0.0-beta8", + "version": "6.0.0-beta9", "style": "dist/css/tempus-dominus.css", "sass": "scss/tempus-dominus.scss", "main": "dist/js/tempus-dominus.js", @@ -12,7 +12,7 @@ "files": [ "dist/**/*", "src/js/**/*.ts", - "src/sass/**/*.scss", + "src/scss/**/*.scss", "types/**/*" ], "scripts": { @@ -21,7 +21,7 @@ "build": "node ./build/copyToDist.js && npm run rollup", "build:plugins": "node ./build/plugins.js", "build:declarations": "tsc --declaration --emitDeclarationOnly --outDir types", - "sass": "sass ./src/sass/tempus-dominus.scss ./dist/css/tempus-dominus.css", + "sass": "sass src/scss/tempus-dominus.scss ./dist/css/tempus-dominus.css", "rollup": "rollup -c ./build/rollup.config.js", "rollup-watch": "rollup -c ./build/rollup.config.js -w", "prettier": "prettier --write .", diff --git a/src/docs/partials/change-log.html b/src/docs/partials/change-log.html index d66e95808..81fa668a1 100644 --- a/src/docs/partials/change-log.html +++ b/src/docs/partials/change-log.html @@ -1,6 +1,37 @@

Version 6

+

Beta9

+

Bug Fixes

+
    +
  • Fixed jQuery provider. #2547
  • +
  • Adds options for theme to fix #2522. Big thanks to @matholum.
  • +
  • Fixed date view next/back button disabling when it shouldn't. #2595
  • +
  • Fixed component disabling issue #2502
  • +
  • Changed default useTwentyfourHour to undefined. Now using DateTime.parts() to check if the view date has a "dayPeriod" property #2510
  • +
  • Fixed 24-hour 24/0 formatting + #2563 | #2563 +
  • +
  • Fixed none latin number selection in the minute picker + #2576 +
  • +
  • Fixed input value to view date object reference + #2568 +
  • +
+

New

+
    +
  • Add fr locale via #2581
  • +
  • Updated and published NuGet package.
  • +
+

Breaking changes

+
    +
  • Renamed /src/sass to /src/scss to more accurately reflect code.
  • +

Beta8

Bug Fixes

    diff --git a/src/docs/partials/examples/index.html b/src/docs/partials/examples/index.html index 132a58f32..7157532fc 100644 --- a/src/docs/partials/examples/index.html +++ b/src/docs/partials/examples/index.html @@ -205,6 +205,125 @@

    Simple Setup

+
+

Side-by-Side + + + +

+ +

+ This demonstrates the side-by-side option. +

+ +
+ +
+
+
+           
+ <div
+     class='input-group'
+     id='pickerSideBySide'
+     data-td-target-input='nearest'
+     data-td-target-toggle='nearest'
+ >
+   <input
+     id='pickerSideBySideInput'
+     type='text'
+     class='form-control'
+     data-td-target='#pickerSideBySide'
+   />
+   <span
+     class='input-group-text'
+     data-td-target='#pickerSideBySide'
+     data-td-toggle='datetimepicker'
+   >
+     <span class='fa-solid fa-calendar'></span>
+   </span>
+ </div>
+           
+         
+
+
+
+           
+ new tempusDominus.TempusDominus(document.getElementById('pickerSideBySide', {
+    display: {
+        sideBySide: true
+    }
+ }));
+           
+         
+
+
+
+ Events will display as you manipulate the picker. +
+
+
+
+ +
+
+
+ +
+ + + + +
+
+
+
+ +
+

Using Locales Inline Theme

+ +

+ You can also specify the theme for the picker. +

+ +
+ +
+
+
+           
+ <div
+    class='input-group'
+    id='themePicker'
+    data-td-target-input='nearest'
+    data-td-target-toggle='nearest'
+>
+<input
+    id='themePickerInput'
+    type='text'
+    class='form-control'
+    data-td-target='#themePicker'
+/>
+<span
+    class='input-group-text'
+    data-td-target='#themePicker'
+    data-td-toggle='datetimepicker'
+>
+    <span class='fa-solid fa-calendar'></span>
+</span>
+</div>
+           
+         
+
+
+
+           
+ new tempusDominus.TempusDominus(document.getElementById('themePicker'), {
+   display: {
+     theme: 'dark'
+   }
+ });
+           
+         
+
+
+
+ Events will display as you manipulate the picker. +
+
+
+
+ +
+
+
+ +
+ + + + +
+
+
+
+
+ + + +
+
+
+ +
+

Multiple Dates inline lightTheme

+

+ Applied to the widget when the option display.theme is light. +

+ +

darkTheme

+

+ Applied to the widget when the option display.theme is dark. +

+ +

isDarkPreferedQuery

+

+ Used for detecting if the system color preference is dark mode. +

diff --git a/src/docs/partials/options.html b/src/docs/partials/options.html index cccd4ba63..a1a3e9545 100644 --- a/src/docs/partials/options.html +++ b/src/docs/partials/options.html @@ -1,9 +1,12 @@

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

+

+ The current options can be retrieved e.g. datetimepicker1.optionsStore.options. +

Options can be updated through the updateOptions function. @@ -486,6 +489,12 @@

keepOpentheme

+

+ Accepts: 'light' | 'dark' | 'auto' Defaults: 'auto'
+ Specifies which theme to use, light mode or dark mode. When set to auto, it will auto detect based on settings of the user's system. +

diff --git a/src/docs/templates/index.html b/src/docs/templates/index.html index 7efa0b072..9f8b91b39 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-beta8 + Currently v6.0.0-beta9 · v5 docs

diff --git a/src/js/actions.ts b/src/js/actions.ts index c22de09c9..9edf582fd 100644 --- a/src/js/actions.ts +++ b/src/js/actions.ts @@ -1,14 +1,14 @@ -import {DateTime, Unit} from './datetime'; -import Collapse from './display/collapse'; -import Namespace from './utilities/namespace'; -import Dates from './dates'; -import Validation from './validation'; -import Display from './display'; -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"; +import { DateTime, Unit } from "./datetime"; +import Collapse from "./display/collapse"; +import Namespace from "./utilities/namespace"; +import Dates from "./dates"; +import Validation from "./validation"; +import Display from "./display"; +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"; /** * @@ -192,15 +192,16 @@ export default class Actions { this.optionsStore.options.display.icons.date ).outerHTML; if (this.display._hasTime) { - this.do(e, ActionTypes.showClock); + this.handleShowClockContainers(ActionTypes.showClock); this.display._update('clock'); } } + this.display.widget - .querySelectorAll( - `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}` - ) - .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement)); + .querySelectorAll( + `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}` + ) + .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement)); this._eventEmitters.viewUpdate.emit(); break; case ActionTypes.showClock: diff --git a/src/js/datetime.ts b/src/js/datetime.ts index 2c316bfa6..5cede759e 100644 --- a/src/js/datetime.ts +++ b/src/js/datetime.ts @@ -354,9 +354,7 @@ export class DateTime extends Date { * Returns two digit hours */ get hoursFormatted(): string { - let formatted =this.parts(undefined, twoDigitTwentyFourTemplate).hour; - if (formatted === '24') formatted = '00'; - return formatted; + return this.parts(undefined, twoDigitTwentyFourTemplate).hour; } /** diff --git a/src/js/display/calendar/date-display.ts b/src/js/display/calendar/date-display.ts index dae81be79..45f6739f5 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 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"; +import { DateTime, Unit } from "../../datetime"; +import Namespace from "../../utilities/namespace"; +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` @@ -26,13 +26,13 @@ export default class DateDisplay { * @private */ getPicker(): HTMLElement { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.daysContainer); container.append(...this._daysOfTheWeek()); if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight); container.appendChild(div); } @@ -40,7 +40,7 @@ export default class DateDisplay { for (let i = 0; i < 42; i++) { if (i !== 0 && i % 7 === 0) { if (this.optionsStore.options.display.calendarWeeks) { - const div = document.createElement('div'); + const div = document.createElement("div"); div.classList.add( Namespace.css.calendarWeeks, Namespace.css.noHighlight @@ -49,8 +49,8 @@ export default class DateDisplay { } } - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectDay); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes.selectDay); container.appendChild(div); } @@ -65,34 +65,42 @@ export default class DateDisplay { const container = widget.getElementsByClassName( Namespace.css.daysContainer )[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - switcher.setAttribute( - Namespace.css.daysContainer, - this.optionsStore.viewDate.format( - this.optionsStore.options.localization.dayViewHeaderFormat + + if (this.optionsStore.currentView === "calendar") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + + switcher.setAttribute( + Namespace.css.daysContainer, + this.optionsStore.viewDate.format( + this.optionsStore.options.localization.dayViewHeaderFormat + ) + ); + + this.optionsStore.options.display.components.month + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + + this.validation.isValid( + this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), + Unit.month ) - ); - - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), - Unit.month - ) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.month), - Unit.month - ) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + + this.validation.isValid( + this.optionsStore.viewDate.clone.manipulate(1, Unit.month), + Unit.month + ) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + + } let innerDate = this.optionsStore.viewDate.clone .startOf(Unit.month) - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .manipulate(12, Unit.hours); container @@ -104,7 +112,7 @@ export default class DateDisplay { this.optionsStore.options.display.calendarWeeks && containerClone.classList.contains(Namespace.css.calendarWeeks) ) { - if (containerClone.innerText === '#') return; + if (containerClone.innerText === "#") return; containerClone.innerText = `${innerDate.week}`; return; } @@ -140,11 +148,11 @@ export default class DateDisplay { containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); containerClone.setAttribute( - 'data-value', + "data-value", `${innerDate.year}-${innerDate.monthFormatted}-${innerDate.dateFormatted}` ); - containerClone.setAttribute('data-day', `${innerDate.date}`); - containerClone.innerText = innerDate.format({ day: 'numeric' }); + containerClone.setAttribute("data-day", `${innerDate.date}`); + containerClone.innerText = innerDate.format({ day: "numeric" }); innerDate.manipulate(1, Unit.date); }); } @@ -155,28 +163,28 @@ export default class DateDisplay { */ private _daysOfTheWeek(): HTMLElement[] { let innerDate = this.optionsStore.viewDate.clone - .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek) + .startOf("weekDay", this.optionsStore.options.localization.startOfTheWeek) .startOf(Unit.date); const row = []; - document.createElement('div'); + document.createElement("div"); if (this.optionsStore.options.display.calendarWeeks) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add( Namespace.css.calendarWeeks, Namespace.css.noHighlight ); - htmlDivElement.innerText = '#'; + htmlDivElement.innerText = "#"; row.push(htmlDivElement); } for (let i = 0; i < 7; i++) { - const htmlDivElement = document.createElement('div'); + const htmlDivElement = document.createElement("div"); htmlDivElement.classList.add( Namespace.css.dayOfTheWeek, Namespace.css.noHighlight ); - htmlDivElement.innerText = innerDate.format({ weekday: 'short' }); + htmlDivElement.innerText = innerDate.format({ weekday: "short" }); innerDate.manipulate(1, Unit.date); row.push(htmlDivElement); } diff --git a/src/js/display/calendar/decade-display.ts b/src/js/display/calendar/decade-display.ts index 956a90810..4dcda0b96 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 Validation from '../../validation'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import {OptionsStore} from "../../utilities/optionsStore"; +import Dates from "../../dates"; +import { DateTime, Unit } from "../../datetime"; +import Namespace from "../../utilities/namespace"; +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` @@ -28,12 +28,12 @@ export default class DecadeDisplay { * @private */ getPicker() { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.decadesContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectDecade); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes.selectDecade); container.appendChild(div); } return container; @@ -56,21 +56,24 @@ export default class DecadeDisplay { const container = widget.getElementsByClassName( Namespace.css.decadesContainer )[0]; + const [previous, switcher, next] = container.parentElement .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); + .getElementsByTagName("div"); - switcher.setAttribute( - Namespace.css.decadesContainer, - `${this._startDecade.format({ year: 'numeric' })}-${this._endDecade.format({ year: 'numeric' })}` - ); + if (this.optionsStore.currentView === 'decades') { + switcher.setAttribute( + Namespace.css.decadesContainer, + `${this._startDecade.format({ year: "numeric" })}-${this._endDecade.format({ year: "numeric" })}` + ); - this.validation.isValid(this._startDecade, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endDecade, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + this.validation.isValid(this._startDecade, Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endDecade, Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } const pickedYears = this.dates.picked.map((x) => x.year); @@ -80,15 +83,15 @@ export default class DecadeDisplay { if (index === 0) { containerClone.classList.add(Namespace.css.old); if (this._startDecade.year - 10 < 0) { - containerClone.textContent = ' '; + containerClone.textContent = " "; previous.classList.add(Namespace.css.disabled); containerClone.classList.add(Namespace.css.disabled); - containerClone.setAttribute('data-value', ``); + containerClone.setAttribute("data-value", ``); return; } else { - containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: 'numeric' }); + containerClone.innerText = this._startDecade.clone.manipulate(-10, Unit.year).format({ year: "numeric" }); containerClone.setAttribute( - 'data-value', + "data-value", `${this._startDecade.year}` ); return; @@ -108,15 +111,15 @@ export default class DecadeDisplay { classes.push(Namespace.css.active); } - paint('decade', this._startDecade, classes, containerClone); + paint("decade", this._startDecade, classes, containerClone); containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); containerClone.setAttribute( - 'data-value', + "data-value", `${this._startDecade.year}` ); - containerClone.innerText = `${this._startDecade.format({ year: 'numeric' })}`; + containerClone.innerText = `${this._startDecade.format({ year: "numeric" })}`; this._startDecade.manipulate(10, Unit.year); }); diff --git a/src/js/display/calendar/month-display.ts b/src/js/display/calendar/month-display.ts index b596751cb..d75df2249 100644 --- a/src/js/display/calendar/month-display.ts +++ b/src/js/display/calendar/month-display.ts @@ -45,28 +45,35 @@ export default class MonthDisplay { const container = widget.getElementsByClassName( Namespace.css.monthsContainer )[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - switcher.setAttribute( - Namespace.css.monthsContainer, - this.optionsStore.viewDate.format({ year: 'numeric' }) - ); + if(this.optionsStore.currentView === 'months') { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName('div'); - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), - Unit.year - ) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); + switcher.setAttribute( + Namespace.css.monthsContainer, + this.optionsStore.viewDate.format({ year: 'numeric' }) + ); - this.validation.isValid( - this.optionsStore.viewDate.clone.manipulate(1, Unit.year), - Unit.year - ) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + this.optionsStore.options.display.components.year + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + + this.validation.isValid( + this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), + Unit.year + ) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + + this.validation.isValid( + this.optionsStore.viewDate.clone.manipulate(1, Unit.year), + Unit.year + ) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year); diff --git a/src/js/display/calendar/year-display.ts b/src/js/display/calendar/year-display.ts index ab166ded0..8e2cf8c6a 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 Validation from '../../validation'; -import { Paint } from '../index'; -import { serviceLocator } from '../../utilities/service-locator'; -import ActionTypes from '../../utilities/action-types'; -import {OptionsStore} from "../../utilities/optionsStore"; +import { DateTime, Unit } from "../../datetime"; +import Namespace from "../../utilities/namespace"; +import Dates from "../../dates"; +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` @@ -22,17 +22,18 @@ export default class YearDisplay { this.dates = serviceLocator.locate(Dates); this.validation = serviceLocator.locate(Validation); } + /** * Build the container html for the display * @private */ getPicker(): HTMLElement { - const container = document.createElement('div'); + const container = document.createElement("div"); container.classList.add(Namespace.css.yearsContainer); for (let i = 0; i < 12; i++) { - const div = document.createElement('div'); - div.setAttribute('data-action', ActionTypes.selectYear); + const div = document.createElement("div"); + div.setAttribute("data-action", ActionTypes.selectYear); container.appendChild(div); } @@ -50,26 +51,34 @@ export default class YearDisplay { const container = widget.getElementsByClassName( Namespace.css.yearsContainer )[0]; - const [previous, switcher, next] = container.parentElement - .getElementsByClassName(Namespace.css.calendarHeader)[0] - .getElementsByTagName('div'); - - switcher.setAttribute( - Namespace.css.yearsContainer, - `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({ year: 'numeric' })}` - ); - - this.validation.isValid(this._startYear, Unit.year) - ? previous.classList.remove(Namespace.css.disabled) - : previous.classList.add(Namespace.css.disabled); - this.validation.isValid(this._endYear, Unit.year) - ? next.classList.remove(Namespace.css.disabled) - : next.classList.add(Namespace.css.disabled); + + if (this.optionsStore.currentView === "years") { + const [previous, switcher, next] = container.parentElement + .getElementsByClassName(Namespace.css.calendarHeader)[0] + .getElementsByTagName("div"); + + switcher.setAttribute( + Namespace.css.yearsContainer, + `${this._startYear.format({ year: "numeric" })}-${this._endYear.format({ year: "numeric" })}` + ); + + this.optionsStore.options.display.components.decades + ? switcher.classList.remove(Namespace.css.disabled) + : switcher.classList.add(Namespace.css.disabled); + + this.validation.isValid(this._startYear, Unit.year) + ? previous.classList.remove(Namespace.css.disabled) + : previous.classList.add(Namespace.css.disabled); + this.validation.isValid(this._endYear, Unit.year) + ? next.classList.remove(Namespace.css.disabled) + : next.classList.add(Namespace.css.disabled); + } let innerDate = this.optionsStore.viewDate.clone .startOf(Unit.year) .manipulate(-1, Unit.year); + container .querySelectorAll(`[data-action="${ActionTypes.selectYear}"]`) .forEach((containerClone: HTMLElement) => { @@ -90,7 +99,7 @@ export default class YearDisplay { containerClone.classList.remove(...containerClone.classList); containerClone.classList.add(...classes); - containerClone.setAttribute('data-value', `${innerDate.year}`); + containerClone.setAttribute("data-value", `${innerDate.year}`); containerClone.innerText = innerDate.format({ year: "numeric" }); innerDate.manipulate(1, Unit.year); diff --git a/src/js/display/collapse.ts b/src/js/display/collapse.ts index e1ddcb069..30eecde29 100644 --- a/src/js/display/collapse.ts +++ b/src/js/display/collapse.ts @@ -59,6 +59,7 @@ export default class Collapse { * @param target */ static hideImmediately(target: HTMLElement) { + if (!target) return; target.classList.remove(Namespace.css.collapsing, Namespace.css.show); target.classList.add(Namespace.css.collapse); } diff --git a/src/js/display/index.ts b/src/js/display/index.ts index 0c109de14..9061de3f4 100644 --- a/src/js/display/index.ts +++ b/src/js/display/index.ts @@ -17,7 +17,7 @@ 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"; +import { OptionsStore } from '../utilities/optionsStore'; /** * Main class for all things display related. @@ -136,7 +136,12 @@ export default class Display { * @param _classes * @param _element */ - paint(_unit: Unit | 'decade', _date: DateTime, _classes: string[], _element: HTMLElement) { + paint( + _unit: Unit | 'decade', + _date: DateTime, + _classes: string[], + _element: HTMLElement + ) { // implemented in plugin } @@ -147,35 +152,38 @@ export default class Display { */ show(): void { if (this.widget == undefined) { - if (this.dates.picked.length == 0) { - if ( - this.optionsStore.options.useCurrent && - !this.optionsStore.options.defaultDate - ) { - const date = new DateTime().setLocale( - this.optionsStore.options.localization.locale - ); - if (!this.optionsStore.options.keepInvalid) { - let tries = 0; - let direction = 1; - if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) { - direction = -1; - } - while (!this.validation.isValid(date)) { - date.manipulate(direction, Unit.date); - if (tries > 31) break; - tries++; - } + if (this.dates.picked.length == 0) { + if ( + this.optionsStore.options.useCurrent && + !this.optionsStore.options.defaultDate + ) { + const date = new DateTime().setLocale( + this.optionsStore.options.localization.locale + ); + if (!this.optionsStore.options.keepInvalid) { + let tries = 0; + let direction = 1; + if ( + this.optionsStore.options.restrictions.maxDate?.isBefore(date) + ) { + direction = -1; + } + while (!this.validation.isValid(date)) { + date.manipulate(direction, Unit.date); + if (tries > 31) break; + tries++; } - this.dates.setValue(date); - } - - if (this.optionsStore.options.defaultDate) { - this.dates.setValue(this.optionsStore.options.defaultDate); } + this.dates.setValue(date); + } + + if (this.optionsStore.options.defaultDate) { + this.dates.setValue(this.optionsStore.options.defaultDate); + } } this._buildWidget(); + this._updateTheme(); // If modeView is only clock const onlyClock = this._hasTime && !this._hasDate; @@ -195,11 +203,24 @@ export default class Display { this.optionsStore.minimumCalendarViewMode; } - if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') { + if ( + !onlyClock && + this.optionsStore.options.display.viewMode !== 'clock' + ) { if (this._hasTime) { - Collapse.hideImmediately(this.widget.querySelector(`div.${Namespace.css.timeContainer}`)); + if(!this.optionsStore.options.display.sideBySide) { + Collapse.hideImmediately( + this.widget.querySelector(`div.${Namespace.css.timeContainer}`) + ); + } else { + Collapse.show( + this.widget.querySelector(`div.${Namespace.css.timeContainer}`) + ); + } } - Collapse.show(this.widget.querySelector(`div.${Namespace.css.dateContainer}`)); + Collapse.show( + this.widget.querySelector(`div.${Namespace.css.dateContainer}`) + ); } if (this._hasDate) { @@ -310,6 +331,51 @@ export default class Display { this._eventEmitters.viewUpdate.emit(); } + /** + * Changes the theme. E.g. light, dark or auto + * @param theme the theme name + * @private + */ + _updateTheme(theme?: 'light' | 'dark' | 'auto'): void { + if (!this.widget) { + return; + } + if (theme) { + if (this.optionsStore.options.display.theme === theme) return; + this.optionsStore.options.display.theme = theme; + } + + this.widget.classList.remove('light', 'dark'); + this.widget.classList.add(this._getThemeClass()); + + if (this.optionsStore.options.display.theme === 'auto') { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .addEventListener('change', () => this._updateTheme()); + } else { + window + .matchMedia(Namespace.css.isDarkPreferedQuery) + .removeEventListener('change', () => this._updateTheme()); + } + } + + _getThemeClass(): string { + const currentTheme = this.optionsStore.options.display.theme || 'auto'; + + const isDarkMode = + window.matchMedia && + window.matchMedia(Namespace.css.isDarkPreferedQuery).matches; + + switch (currentTheme) { + case 'light': + return Namespace.css.lightTheme; + case 'dark': + return Namespace.css.darkTheme; + case 'auto': + return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme; + } + } + _updateCalendarHeader() { const showing = [ ...this.widget.querySelector( @@ -647,15 +713,18 @@ export default class Display { * @param iconClass * @private */ - _iconTag(iconClass: string): HTMLElement|SVGElement { + _iconTag(iconClass: string): HTMLElement | SVGElement { if (this.optionsStore.options.display.icons.type === 'sprites') { const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - const icon = document.createElementNS('http://www.w3.org/2000/svg', 'use'); + const icon = document.createElementNS( + 'http://www.w3.org/2000/svg', + 'use' + ); icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility icon.setAttribute('href', iconClass); svg.appendChild(icon); - + return svg; } const icon = document.createElement('i'); diff --git a/src/js/display/time/minute-display.ts b/src/js/display/time/minute-display.ts index 6cb3941fd..57c164aef 100644 --- a/src/js/display/time/minute-display.ts +++ b/src/js/display/time/minute-display.ts @@ -68,7 +68,7 @@ export default class MinuteDisplay { containerClone.classList.add(...classes); containerClone.setAttribute( 'data-value', - `${innerDate.minutesFormatted}` + `${innerDate.minutes}` ); containerClone.innerText = innerDate.minutesFormatted; innerDate.manipulate(step, Unit.minutes); diff --git a/src/js/jQuery-provider.js b/src/js/jQuery-provider.js index fbca55673..f7ca1333a 100644 --- a/src/js/jQuery-provider.js +++ b/src/js/jQuery-provider.js @@ -2,66 +2,66 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.0.0-beta8 (https://getdatepicker.com/) + * Tempus Dominus v6.0.0-beta9 (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) { - if (this.length === 1) { - return tempusDominus.jQueryHandleThis(this, option, argument); - } - // "this" is jquery here - return this.each(function () { - tempusDominus.jQueryHandleThis(this, option, argument); - }); + if (this.length === 1) { + return tempusDominus.jQueryHandleThis(this, option, argument); + } + // "this" is jquery here + return this.each(function () { + tempusDominus.jQueryHandleThis(this, option, argument); + }); }; tempusDominus.jQueryHandleThis = function (me, option, argument) { - let data = $(me).data(tempusDominus.Namespace.dataKey); - if (typeof option === 'object') { - $.extend({}, tempusDominus.DefaultOptions, option); - } - - if (!data) { - data = new tempusDominus.TempusDominus($(me)[0], option); - $(me).data(tempusDominus.Namespace.dataKey, data); - } + let data = $(me).data(tempusDominus.Namespace.dataKey); + if (typeof option === 'object') { + option = $.extend({}, tempusDominus.DefaultOptions, option); + } - if (typeof option === 'string') { - if (data[option] === undefined) { - throw new Error(`No method named "${option}"`); + if (!data) { + data = new tempusDominus.TempusDominus($(me)[0], option); + $(me).data(tempusDominus.Namespace.dataKey, data); } - if (argument === undefined) { - return data[option](); - } else { - if (option === 'date') { - data.isDateUpdateThroughDateOptionFromClientCode = true; - } - const ret = data[option](argument); - data.isDateUpdateThroughDateOptionFromClientCode = false; - return ret; + + if (typeof option === 'string') { + if (data[option] === undefined) { + throw new Error(`No method named "${option}"`); + } + if (argument === undefined) { + return data[option](); + } else { + if (option === 'date') { + data.isDateUpdateThroughDateOptionFromClientCode = true; + } + const ret = data[option](argument); + data.isDateUpdateThroughDateOptionFromClientCode = false; + return ret; + } } - } }; tempusDominus.getSelectorFromElement = function ($element) { - let selector = $element.data('target'), - $selector; + let selector = $element.data('target'), + $selector; - if (!selector) { - selector = $element.attr('href') || ''; - selector = /^#[a-z]/i.test(selector) ? selector : null; - } - $selector = $(selector); - if ($selector.length === 0) { - return $element; - } + if (!selector) { + selector = $element.attr('href') || ''; + selector = /^#[a-z]/i.test(selector) ? selector : null; + } + $selector = $(selector); + if ($selector.length === 0) { + return $element; + } - if (!$selector.data(tempusDominus.Namespace.dataKey)) { - $.extend({}, $selector.data(), $(this).data()); - } + if (!$selector.data(tempusDominus.Namespace.dataKey)) { + $.extend({}, $selector.data(), $(this).data()); + } - return $selector; + return $selector; }; /** @@ -70,85 +70,85 @@ tempusDominus.getSelectorFromElement = function ($element) { * ------------------------------------------------------------------------ */ $(document) - .on( - `click${tempusDominus.Namespace.events.key}.data-api`, - `[data-toggle="${tempusDominus.Namespace.dataKey}"]`, - function () { - const $originalTarget = $(this), - $target = tempusDominus.getSelectorFromElement($originalTarget), - config = $target.data(tempusDominus.Namespace.dataKey); - if ($target.length === 0) { - return; - } - if ( - config._options.allowInputToggle && - $originalTarget.is('input[data-toggle="datetimepicker"]') - ) { - return; - } - tempusDominus.jQueryInterface.call($target, 'toggle'); - } - ) - .on( - tempusDominus.Namespace.events.change, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { + .on( + `click${tempusDominus.Namespace.events.key}.data-api`, + `[data-toggle="${tempusDominus.Namespace.dataKey}"]`, + function () { + const $originalTarget = $(this), + $target = tempusDominus.getSelectorFromElement($originalTarget), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if ( + config._options.allowInputToggle && + $originalTarget.is('input[data-toggle="datetimepicker"]') + ) { + return; + } + tempusDominus.jQueryInterface.call($target, 'toggle'); + } + ) + .on( + tempusDominus.Namespace.events.change, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)); + if ($target.length === 0 || event.isInit) { + return; + } + tempusDominus.jQueryInterface.call($target, '_change', event); + } + ) + .on( + tempusDominus.Namespace.events.blur, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if (config._options.debug || window.debug) { + return; + } + tempusDominus.jQueryInterface.call($target, 'hide', event); + } + ) + /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) { const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0 || event.isInit) { - return; - } - tempusDominus.jQueryInterface.call($target, '_change', event); - } - ) - .on( - tempusDominus.Namespace.events.blur, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); if ($target.length === 0) { return; } - if (config._options.debug || window.debug) { - return; - } - tempusDominus.jQueryInterface.call($target, 'hide', event); - } - ) - /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keydown', event); - }) - .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)); - if ($target.length === 0) { - return; - } - tempusDominus.jQueryInterface.call($target, '_keyup', event); - })*/ - .on( - tempusDominus.Namespace.events.focus, - `.${tempusDominus.Namespace.NAME}-input`, - function (event) { - const $target = tempusDominus.getSelectorFromElement($(this)), - config = $target.data(tempusDominus.Namespace.dataKey); + tempusDominus.jQueryInterface.call($target, '_keydown', event); + }) + .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)); if ($target.length === 0) { return; } - if (!config._options.allowInputToggle) { - return; - } - tempusDominus.jQueryInterface.call($target, 'show', event); - } - ); + tempusDominus.jQueryInterface.call($target, '_keyup', event); + })*/ + .on( + tempusDominus.Namespace.events.focus, + `.${tempusDominus.Namespace.NAME}-input`, + function (event) { + const $target = tempusDominus.getSelectorFromElement($(this)), + config = $target.data(tempusDominus.Namespace.dataKey); + if ($target.length === 0) { + return; + } + if (!config._options.allowInputToggle) { + return; + } + tempusDominus.jQueryInterface.call($target, 'show', event); + } + ); const name = 'tempusDominus'; const JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = tempusDominus.jQueryInterface; $.fn[name].Constructor = tempusDominus.TempusDominus; $.fn[name].noConflict = function () { - $.fn[name] = JQUERY_NO_CONFLICT; - return tempusDominus.jQueryInterface; + $.fn[name] = JQUERY_NO_CONFLICT; + return tempusDominus.jQueryInterface; }; diff --git a/src/js/tempus-dominus.ts b/src/js/tempus-dominus.ts index 1a7ea128d..df1c814fe 100644 --- a/src/js/tempus-dominus.ts +++ b/src/js/tempus-dominus.ts @@ -367,6 +367,11 @@ class TempusDominus { this.display._update('all'); } + if (newConfig.display.components.useTwentyfourHour === undefined) { + newConfig.display.components.useTwentyfourHour = !!!newConfig.viewDate.parts()?.dayPeriod; + } + + this.optionsStore.options = newConfig; } @@ -474,7 +479,7 @@ class TempusDominus { const setViewDate = () => { if (this.dates.lastPicked) - this.optionsStore.viewDate = this.dates.lastPicked; + this.optionsStore.viewDate = this.dates.lastPicked.clone; }; const value = this.optionsStore.input.value; @@ -551,6 +556,8 @@ const extend = function (plugin, option) { return this; }; +const version = '6.0.0-beta9'; + export { TempusDominus, extend, @@ -562,4 +569,5 @@ export { Options, Unit, DateTimeFormatOptions, + version }; diff --git a/src/js/utilities/default-options.ts b/src/js/utilities/default-options.ts index d68407c82..8c079a741 100644 --- a/src/js/utilities/default-options.ts +++ b/src/js/utilities/default-options.ts @@ -45,9 +45,10 @@ const DefaultOptions: Options = { hours: true, minutes: true, seconds: false, - useTwentyfourHour: false + useTwentyfourHour: undefined }, - inline: false + inline: false, + theme: 'auto' }, stepping: 1, useCurrent: true, @@ -95,4 +96,4 @@ const DefaultOptions: Options = { container: undefined }; -export default DefaultOptions; \ No newline at end of file +export default DefaultOptions; diff --git a/src/js/utilities/event-emitter.ts b/src/js/utilities/event-emitter.ts index a9be0fa78..37cb231ba 100644 --- a/src/js/utilities/event-emitter.ts +++ b/src/js/utilities/event-emitter.ts @@ -22,7 +22,7 @@ export class EventEmitter { }); } - destory() { + destroy() { this.subscribers = null; this.subscribers = []; } @@ -34,10 +34,10 @@ export class EventEmitters { updateDisplay = new EventEmitter(); action = new EventEmitter<{ e: any; action?: ActionTypes }>(); - destory() { - this.triggerEvent.destory(); - this.viewUpdate.destory(); - this.updateDisplay.destory(); - this.action.destory(); + destroy() { + this.triggerEvent.destroy(); + this.viewUpdate.destroy(); + this.updateDisplay.destroy(); + this.action.destroy(); } } diff --git a/src/js/utilities/namespace.ts b/src/js/utilities/namespace.ts index f9acfee82..375d6aff1 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-beta8', + version = '6.0.0-beta9', dataKey = 'td'; /** @@ -261,6 +261,21 @@ class Css { * Applied to the widget when the option display.inline is enabled. */ inline = 'inline'; + + /** + * Applied to the widget when the option display.theme is light. + */ + lightTheme = 'light'; + + /** + * Applied to the widget when the option display.theme is dark. + */ + darkTheme = 'dark'; + + /** + * Used for detecting if the system color preference is dark mode + */ + isDarkPreferedQuery = '(prefers-color-scheme: dark)'; } export default class Namespace { diff --git a/src/js/utilities/optionConverter.ts b/src/js/utilities/optionConverter.ts index a35a500c3..4c727e29d 100644 --- a/src/js/utilities/optionConverter.ts +++ b/src/js/utilities/optionConverter.ts @@ -42,79 +42,11 @@ export class OptionConverter { 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], mergeOption[key], copyTo[key], path, locale); - // } - // path = path.substring(0, path.lastIndexOf(`.${key}`)); - // }); - // } - /** * 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 @@ -138,7 +70,7 @@ export class OptionConverter { Namespace.errorMessages.unexpectedOptions(errors); } - Object.keys(provided).forEach((key) => { + Object.keys(provided).filter(key => key !== "__proto__" && key !== "constructor").forEach((key) => { path += `.${key}`; if (path.charAt(0) === '.') path = path.slice(1); @@ -329,10 +261,12 @@ export class OptionConverter { case 'toolbarPlacement': case 'type': case 'viewMode': + case 'theme': const optionValues = { toolbarPlacement: ['top', 'bottom', 'default'], type: ['icons', 'sprites'], viewMode: ['clock', 'calendar', 'months', 'years', 'decades'], + theme: ['light', 'dark', 'auto'], }; const keyOptions = optionValues[key]; if (!keyOptions.includes(value)) @@ -362,6 +296,14 @@ export class OptionConverter { ); } return value; + case 'useTwentyfourHour': + if (value === undefined || providedType === 'boolean') return value; + Namespace.errorMessages.typeMismatch( + path, + providedType, + defaultType + ); + break; default: switch (defaultType) { case 'boolean': diff --git a/src/js/utilities/options.ts b/src/js/utilities/options.ts index 6a3ef266e..1dd0ba86a 100644 --- a/src/js/utilities/options.ts +++ b/src/js/utilities/options.ts @@ -44,6 +44,7 @@ export default interface Options { sideBySide?: boolean; inline?: boolean; keepOpen?: boolean; + theme?: 'light' | 'dark' | 'auto'; }; stepping?: number; useCurrent?: boolean; diff --git a/src/js/validation.ts b/src/js/validation.ts index 5d8686585..af7359043 100644 --- a/src/js/validation.ts +++ b/src/js/validation.ts @@ -14,7 +14,7 @@ export default class Validation { /** * 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. + * Granularity can be provided to check portions of the date instead of the whole. * @param targetDate * @param granularity */ diff --git a/src/locales/ar-SA.ts b/src/locales/ar-SA.ts new file mode 100644 index 000000000..bfe9b45c1 --- /dev/null +++ b/src/locales/ar-SA.ts @@ -0,0 +1,35 @@ +const name = "ar-SA"; + +const localization = { + today: "اليوم", + clear: "مسح", + close: "إغلاق", + selectMonth: "اختر الشهر", + previousMonth: "الشهر السابق", + nextMonth: "الشهر التالي", + selectYear: "اختر السنة", + previousYear: "العام السابق", + nextYear: "العام التالي", + selectDecade: "اختر العقد", + previousDecade: "العقد السابق", + nextDecade: "العقد التالي", + previousCentury: "القرن السابق", + nextCentury: "القرن التالي", + pickHour: "اختر الساعة", + incrementHour: "أضف ساعة", + decrementHour: "أنقص ساعة", + pickMinute: "اختر الدقيقة", + incrementMinute: "أضف دقيقة", + decrementMinute: "أنقص دقيقة", + pickSecond: "اختر الثانية", + incrementSecond: "أضف ثانية", + decrementSecond: "أنقص ثانية", + toggleMeridiem: "تبديل الفترة", + selectTime: "اخر الوقت", + selectDate: "اختر التاريخ", + dayViewHeaderFormat: { month: "long", year: "2-digit" }, + locale: "ar-SA", + startOfTheWeek: 1, +}; + +export { localization, name }; \ No newline at end of file diff --git a/src/locales/ar.ts b/src/locales/ar.ts new file mode 100644 index 000000000..757b84304 --- /dev/null +++ b/src/locales/ar.ts @@ -0,0 +1,35 @@ +const name = "ar"; + +const localization = { + today: "اليوم", + clear: "مسح", + close: "إغلاق", + selectMonth: "اختر الشهر", + previousMonth: "الشهر السابق", + nextMonth: "الشهر التالي", + selectYear: "اختر السنة", + previousYear: "العام السابق", + nextYear: "العام التالي", + selectDecade: "اختر العقد", + previousDecade: "العقد السابق", + nextDecade: "العقد التالي", + previousCentury: "القرن السابق", + nextCentury: "القرن التالي", + pickHour: "اختر الساعة", + incrementHour: "أضف ساعة", + decrementHour: "أنقص ساعة", + pickMinute: "اختر الدقيقة", + incrementMinute: "أضف دقيقة", + decrementMinute: "أنقص دقيقة", + pickSecond: "اختر الثانية", + incrementSecond: "أضف ثانية", + decrementSecond: "أنقص ثانية", + toggleMeridiem: "تبديل الفترة", + selectTime: "اخر الوقت", + selectDate: "اختر التاريخ", + dayViewHeaderFormat: { month: "long", year: "2-digit" }, + locale: "ar", + startOfTheWeek: 1, +}; + +export { localization, name }; \ No newline at end of file diff --git a/src/locales/fr.ts b/src/locales/fr.ts new file mode 100644 index 000000000..d35443826 --- /dev/null +++ b/src/locales/fr.ts @@ -0,0 +1,35 @@ +const name = "ar"; + +const localization = { + today: 'Aujourd\'hui', + clear: 'Effacer la sélection', + close: 'Fermer', + selectMonth: 'Sélectionner le mois', + previousMonth: 'Mois précédent', + nextMonth: 'Mois suivant', + selectYear: 'Sélectionner l\'année', + previousYear: 'Année précédente', + nextYear: 'Année suivante', + selectDecade: 'Sélectionner la décennie', + previousDecade: 'Décennie précédente', + nextDecade: 'Décennie suivante', + previousCentury: 'Siècle précédente', + nextCentury: 'Siècle suivante', + pickHour: "Sélectionner l\'heure", + incrementHour: "Incrementer l\'heure", + decrementHour: "Diminuer l\'heure", + pickMinute: 'Sélectionner les minutes', + incrementMinute: 'Incrementer les minutes', + decrementMinute: 'Diminuer les minutes', + pickSecond: 'Sélectionner les secondes', + incrementSecond: 'Incrementer les secondes', + decrementSecond: 'Diminuer les secondes', + toggleMeridiem: 'Basculer AM-PM', + selectTime: "Sélectionner l\'heure", + selectDate: 'Sélectionner une date', + dayViewHeaderFormat: { month: 'long', year: '2-digit' }, + locale: 'fr', + startOfTheWeek: 1 +}; + +export { localization, name }; diff --git a/src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec b/src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec deleted file mode 100644 index b4ebf7510..000000000 --- a/src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec +++ /dev/null @@ -1,31 +0,0 @@ - - - - Bootstrap.v3.Datetimepicker.CSS - 4.17.47 - Bootstrap 3 Datetimepicker CSS - Eonasdan - Eonasdan - https://github.com/Eonasdan/bootstrap-datetimepicker - false - A date/time picker component designed to work with Bootstrap 3 and Momentjs. - -For usage, installation and demos see Project Site on GitHub - -For LESS version install Bootstrap.v3.Datetimepicker - - Updated bootstrap dependency to fix xss - - bootstrap date time picker datetimepicker datepicker jquery - - - - - - - - - - - - \ No newline at end of file diff --git a/src/nuget/Bootstrap.v3.Datetimepicker.nuspec b/src/nuget/Bootstrap.v3.Datetimepicker.nuspec deleted file mode 100644 index 854b7e76a..000000000 --- a/src/nuget/Bootstrap.v3.Datetimepicker.nuspec +++ /dev/null @@ -1,31 +0,0 @@ - - - - Bootstrap.v3.Datetimepicker - 4.17.47 - Bootstrap 3 Datetimepicker - Eonasdan - Eonasdan - https://github.com/Eonasdan/bootstrap-datetimepicker - false - A date/time picker component designed to work with Bootstrap 3 and Momentjs. - -For usage, installation and demos see Project Site on GitHub - -For CSS version install Bootstrap.v3.Datetimepicker.CSS - - Updated bootstrap dependency to fix xss - - bootstrap date time picker datetimepicker datepicker jquery - - - - - - - - - - - - \ No newline at end of file diff --git a/src/nuget/NuGet.exe b/src/nuget/NuGet.exe deleted file mode 100644 index c41a0d0de..000000000 Binary files a/src/nuget/NuGet.exe and /dev/null differ diff --git a/src/nuget/TempusDominus.nuspec b/src/nuget/TempusDominus.nuspec new file mode 100644 index 000000000..59db7b025 --- /dev/null +++ b/src/nuget/TempusDominus.nuspec @@ -0,0 +1,33 @@ + + + + TempusDominus + 6.0.0-beta9 + Tempus Dominus + Eonasdan + Eonasdan + Tempus Dominus css and javascript + https://github.com/Eonasdan/tempus-dominus + false + Powerful and robust date and time picker + ..\..\readme.md + https://getdatepicker.com/6/change-log.html + date time picker datetimepicker datepicker + td.png + MIT + Copyright 2013-2022 + + + + + + + + + + + + + + + diff --git a/src/nuget/TempusDominus.scss.nuspec b/src/nuget/TempusDominus.scss.nuspec new file mode 100644 index 000000000..aefeb2083 --- /dev/null +++ b/src/nuget/TempusDominus.scss.nuspec @@ -0,0 +1,33 @@ + + + + TempusDominus.scss + 6.0.0-beta9 + Tempus Dominus + Eonasdan + Eonasdan + Tempus Dominus sass and javascript + https://github.com/Eonasdan/tempus-dominus + false + Powerful and robust date and time picker + ..\..\readme.md + https://getdatepicker.com/6/change-log.html + date time picker datetimepicker datepicker + td.png + MIT + Copyright 2013-2022 + + + + + + + + + + + + + + + diff --git a/src/nuget/td.png b/src/nuget/td.png new file mode 100644 index 000000000..49403269b Binary files /dev/null and b/src/nuget/td.png differ diff --git a/src/sass/_variables.scss b/src/scss/_variables.scss similarity index 97% rename from src/sass/_variables.scss rename to src/scss/_variables.scss index bf20989bd..db1830620 100644 --- a/src/sass/_variables.scss +++ b/src/scss/_variables.scss @@ -1,5 +1,6 @@ $td-light: #fff !default; $td-widget-background: $td-light !default; +$td-font-color: #000 !default; $td-timepicker-font-size: 1.2em !default; $td-active-bg: #0d6efd !default; $td-active-color: $td-light !default; diff --git a/src/sass/tempus-dominus.scss b/src/scss/tempus-dominus.scss similarity index 73% rename from src/sass/tempus-dominus.scss rename to src/scss/tempus-dominus.scss index 9e3d6de27..46da4f7f0 100644 --- a/src/sass/tempus-dominus.scss +++ b/src/scss/tempus-dominus.scss @@ -18,16 +18,16 @@ width: 19rem; border-radius: 4px; display: none; - background-color: $td-widget-background; z-index: 9999; - box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12); + box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), + 0 1px 10px 0 rgba(0, 0, 0, 0.12); &.calendarWeeks { width: 21rem; & .date-container-days { grid-auto-columns: 12.5%; - grid-template-areas: "a a a a a a a a"; + grid-template-areas: 'a a a a a a a a'; } } @@ -42,7 +42,6 @@ &.disabled, &.disabled:hover { background: none; - color: $td-disabled-color; cursor: not-allowed; } } @@ -117,7 +116,7 @@ .calendar-header { display: grid; - grid-template-areas: "a a a"; + grid-template-areas: 'a a a'; margin-bottom: 10px; font-weight: bold; @@ -147,21 +146,16 @@ justify-content: center; box-sizing: border-box; display: flex; - - &:hover { - background: $td-btn-hover-bg; - } } } .date-container-days { display: grid; - grid-template-areas: "a a a a a a a"; + grid-template-areas: 'a a a a a a a'; grid-auto-rows: 40px; grid-auto-columns: calc(100% / 7); & .dow { - color: $td-dow-color; align-items: center; justify-content: center; text-align: center; @@ -175,20 +169,23 @@ display: flex; font-size: 0.8em; line-height: 20px; - color: $td-alternate-color; cursor: default; } } - .date-container-decades, .date-container-years, .date-container-months { + .date-container-decades, + .date-container-years, + .date-container-months { display: grid; - grid-template-areas: "a a a"; + grid-template-areas: 'a a a'; grid-auto-rows: calc(calc(19rem - 2 * 4px) / 7); } - .time-container-hour, .time-container-minute, .time-container-second { + .time-container-hour, + .time-container-minute, + .time-container-second { display: grid; - grid-template-areas: "a a a a"; + grid-template-areas: 'a a a a'; grid-auto-rows: calc(calc(19rem - 2 * 4px) / 7); } @@ -205,8 +202,14 @@ } } - .date-container-decades, .date-container-years, .date-container-months, .date-container-days, - .time-container-clock, .time-container-hour, .time-container-minute, .time-container-second { + .date-container-decades, + .date-container-years, + .date-container-months, + .date-container-days, + .time-container-clock, + .time-container-hour, + .time-container-minute, + .time-container-second { div:not(.no-highlight) { width: 90%; height: 90%; @@ -216,34 +219,9 @@ box-sizing: border-box; display: flex; - &:hover { - background: $td-btn-hover-bg; - } - - &.active { - background-color: $td-active-bg; - color: $td-active-color; - text-shadow: $td-text-shadow; - - &.old, - &.new { - color: $td-active-color; - } - } - - &.active.today:before { - border-bottom-color: $td-active-border-color; - } - - &.old, - &.new { - color: $td-alternate-color; - } - &.disabled, &.disabled:hover { background: none; - color: $td-disabled-color; cursor: not-allowed; } @@ -255,8 +233,6 @@ display: inline-block; border: solid transparent; border-width: 0 0 7px 7px; - border-bottom-color: $td-active-bg; - border-top-color: $td-secondary-border-color-rgba; position: absolute; bottom: 6px; right: 6px; @@ -270,9 +246,6 @@ } button { - color: $td-active-color; - background-color: $td-active-bg; - border-color: $td-active-bg; display: inline-block; font-weight: 400; line-height: 1.5; @@ -287,7 +260,7 @@ font-size: 1rem; border-radius: 0.25rem; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, - border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } &.tempus-dominus-widget-readonly { @@ -313,14 +286,94 @@ } } } -} + &.light { + color: $td-font-color; + background-color: $td-widget-background; -@media (prefers-color-scheme: dark) { - .tempus-dominus-widget { + [data-action] { + &.disabled, + &.disabled:hover { + color: $td-disabled-color; + } + } + + .toolbar { + & div { + &:hover { + background: $td-btn-hover-bg; + } + } + } + + .date-container-days { + & .dow { + color: $td-dow-color; + } + + & .cw { + color: $td-alternate-color; + } + } + + .date-container-decades, + .date-container-years, + .date-container-months, + .date-container-days, + .time-container-clock, + .time-container-hour, + .time-container-minute, + .time-container-second { + div:not(.no-highlight) { + &:hover { + background: $td-btn-hover-bg; + } + + &.active { + background-color: $td-active-bg; + color: $td-active-color; + text-shadow: $td-text-shadow; + + &.old, + &.new { + color: $td-active-color; + } + } + + &.active.today:before { + border-bottom-color: $td-active-border-color; + } + + &.old, + &.new { + color: $td-alternate-color; + } + + &.disabled, + &.disabled:hover { + color: $td-disabled-color; + } + + &.today { + &:before { + border-bottom-color: $td-active-bg; + border-top-color: $td-secondary-border-color-rgba; + } + } + } + } + + button { + color: $td-active-color; + background-color: $td-active-bg; + border-color: $td-active-bg; + } + } + + &.dark { color: $td-dark-font-color; background-color: $td-dark-widget-background; - + [data-action] { &.disabled, &.disabled:hover { @@ -340,16 +393,22 @@ & .dow { color: $td-dark-dow-color; } - + & .cw { color: $td-dark-alternate-color; } } - .date-container-decades, .date-container-years, .date-container-months, .date-container-days, - .time-container-clock, .time-container-hour, .time-container-minute, .time-container-second { + .date-container-decades, + .date-container-years, + .date-container-months, + .date-container-days, + .time-container-clock, + .time-container-hour, + .time-container-minute, + .time-container-second { div:not(.no-highlight) { - &:hover { + &:hover { background: $td-dark-btn-hover-bg; } @@ -393,4 +452,4 @@ border-color: $td-dark-active-bg; } } -} \ No newline at end of file +} diff --git a/types/actions.d.ts b/types/actions.d.ts index f3dea4d8d..2771a1c99 100644 --- a/types/actions.d.ts +++ b/types/actions.d.ts @@ -1,4 +1,4 @@ -import ActionTypes from './utilities/action-types'; +import ActionTypes from "./utilities/action-types"; /** * */ diff --git a/types/display/calendar/date-display.d.ts b/types/display/calendar/date-display.d.ts index 560771180..7645aa947 100644 --- a/types/display/calendar/date-display.d.ts +++ b/types/display/calendar/date-display.d.ts @@ -1,4 +1,4 @@ -import { Paint } from '../index'; +import { Paint } from "../index"; /** * Creates and updates the grid for `date` */ diff --git a/types/display/calendar/decade-display.d.ts b/types/display/calendar/decade-display.d.ts index 11587f8d4..2b50f0e42 100644 --- a/types/display/calendar/decade-display.d.ts +++ b/types/display/calendar/decade-display.d.ts @@ -1,4 +1,4 @@ -import { Paint } from '../index'; +import { Paint } from "../index"; /** * Creates and updates the grid for `seconds` */ diff --git a/types/display/calendar/year-display.d.ts b/types/display/calendar/year-display.d.ts index 35e646342..d04c39292 100644 --- a/types/display/calendar/year-display.d.ts +++ b/types/display/calendar/year-display.d.ts @@ -1,4 +1,4 @@ -import { Paint } from '../index'; +import { Paint } from "../index"; /** * Creates and updates the grid for `year` */ diff --git a/types/display/index.d.ts b/types/display/index.d.ts index aa2351ac8..80792ff36 100644 --- a/types/display/index.d.ts +++ b/types/display/index.d.ts @@ -64,6 +64,13 @@ export default class Display { * @private */ _showMode(direction?: number): void; + /** + * Changes the theme. E.g. light, dark or auto + * @param theme the theme name + * @private + */ + _updateTheme(theme?: 'light' | 'dark' | 'auto'): void; + _getThemeClass(): string; _updateCalendarHeader(): void; /** * Hides the picker if needed. diff --git a/types/tempus-dominus.d.ts b/types/tempus-dominus.d.ts index 938441f9d..260cc5500 100644 --- a/types/tempus-dominus.d.ts +++ b/types/tempus-dominus.d.ts @@ -148,4 +148,5 @@ declare const locale: (l: string) => void; * @param option */ declare const extend: (plugin: any, option: any) => any; -export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Options, Unit, DateTimeFormatOptions, }; +declare const version = "6.0.0-beta9"; +export { TempusDominus, extend, loadLocale, locale, Namespace, DefaultOptions, DateTime, Options, Unit, DateTimeFormatOptions, version }; diff --git a/types/utilities/event-emitter.d.ts b/types/utilities/event-emitter.d.ts index daf5921ee..ba3f6b448 100644 --- a/types/utilities/event-emitter.d.ts +++ b/types/utilities/event-emitter.d.ts @@ -7,7 +7,7 @@ export declare class EventEmitter { subscribe(callback: (value: T) => void): any; unsubscribe(index: number): void; emit(value?: T): void; - destory(): void; + destroy(): void; } export declare class EventEmitters { triggerEvent: EventEmitter; @@ -17,5 +17,5 @@ export declare class EventEmitters { e: any; action?: ActionTypes; }>; - destory(): void; + destroy(): void; } diff --git a/types/utilities/namespace.d.ts b/types/utilities/namespace.d.ts index 8bab9a4ca..4b2e23ba1 100644 --- a/types/utilities/namespace.d.ts +++ b/types/utilities/namespace.d.ts @@ -196,6 +196,18 @@ declare class Css { * Applied to the widget when the option display.inline is enabled. */ inline: string; + /** + * Applied to the widget when the option display.theme is light. + */ + lightTheme: string; + /** + * Applied to the widget when the option display.theme is dark. + */ + darkTheme: string; + /** + * Used for detecting if the system color preference is dark mode + */ + isDarkPreferedQuery: string; } export default class Namespace { static NAME: string; diff --git a/types/utilities/optionConverter.d.ts b/types/utilities/optionConverter.d.ts index 50e287015..e05c9f306 100644 --- a/types/utilities/optionConverter.d.ts +++ b/types/utilities/optionConverter.d.ts @@ -15,7 +15,6 @@ export declare class OptionConverter { * 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 diff --git a/types/utilities/options.d.ts b/types/utilities/options.d.ts index 9bcfa2444..52cc24b6d 100644 --- a/types/utilities/options.d.ts +++ b/types/utilities/options.d.ts @@ -50,6 +50,7 @@ export default interface Options { sideBySide?: boolean; inline?: boolean; keepOpen?: boolean; + theme?: 'light' | 'dark' | 'auto'; }; stepping?: number; useCurrent?: boolean; diff --git a/types/validation.d.ts b/types/validation.d.ts index 8b43aeaff..a258c8162 100644 --- a/types/validation.d.ts +++ b/types/validation.d.ts @@ -7,7 +7,7 @@ export default class Validation { constructor(); /** * 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. + * Granularity can be provided to check portions of the date instead of the whole. * @param targetDate * @param granularity */