@duetds/date-picker
Advanced tools
Comparing version 1.0.0-alpha.15 to 1.0.0-alpha.16
@@ -363,3 +363,3 @@ import { h, createEvent, Host, proxyCustomElement } from '@stencil/core/internal/client'; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
@@ -366,0 +366,0 @@ function range(from, to) { |
@@ -366,3 +366,3 @@ 'use strict'; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
@@ -369,0 +369,0 @@ function range(from, to) { |
@@ -1,1 +0,1 @@ | ||
import{h as e,r as t,c as a,H as i,g as o}from"./index-2ab9c052.js";const n=({onClick:t,placeholder:a,buttonLabel:i,selectedLabel:o,name:n,value:d,identifier:s,disabled:r,role:l,buttonRef:u,inputRef:c,onInput:h,onBlur:p,onFocus:b})=>e("div",{class:"duet-date__input-wrapper"},e("input",{class:"duet-date__input",name:n,value:d,placeholder:a,id:s,disabled:r,role:l,"aria-autocomplete":"none",onInput:h,onFocus:b,onBlur:p,autoComplete:"off",ref:c}),e("button",{class:"duet-date__toggle",onClick:t,disabled:r,ref:u,type:"button"},e("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},e("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},e("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{fill:"currentColor"},e("circle",{cx:"8.5",cy:"8.5",r:"1"}),e("circle",{cx:"4.5",cy:"8.5",r:"1"}),e("circle",{cx:"12.5",cy:"8.5",r:"1"}),e("circle",{cx:"8.5",cy:"12.5",r:"1"}),e("circle",{cx:"4.5",cy:"12.5",r:"1"}),e("circle",{cx:"12.5",cy:"12.5",r:"1"})))),e("span",{class:"duet-date__vhidden"},i,d&&e("span",null,", ",o," ",d)))),d=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/,s=/^(\d{4})-(\d{2})-(\d{2})$/;function r(e,t,a){var i=parseInt(a,10),o=parseInt(t,10),n=parseInt(e,10);if(Number.isInteger(n)&&Number.isInteger(o)&&Number.isInteger(i)&&o>0&&o<=12&&i>0&&i<=31&&n>0)return new Date(n,o-1,i)}function l(e){if(!e)return;const t=e.match(s);return t?r(t[1],t[2],t[3]):void 0}function u(e,t){if(!e)return"";var a=e.getDate().toString(10),i=(e.getMonth()+1).toString(10),o=e.getFullYear().toString(10);return e.getDate()<10&&(a="0"+a),e.getMonth()<9&&(i="0"+i),t.replace(/MM/i,i).replace(/YYYY/i,o).replace(/DD/i,a)}function c(e,t){return null!=e&&null!=t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function h(e,t){var a=new Date(e);return a.setDate(a.getDate()+t),a}function p(e,t=1){var a=new Date(e),i=a.getDay(),o=(i<t?7:0)+i-t;return a.setDate(a.getDate()-o),a}function b(e,t=1){var a=new Date(e),i=a.getDay(),o=6+(i<t?-7:0)-(i-t);return a.setDate(a.getDate()+o),a}function m(e){return new Date(e.getFullYear(),e.getMonth(),1)}function v(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function _(e,t){const a=new Date(e);return a.setMonth(t),a}function g(e,t){const a=new Date(e);return a.setFullYear(t),a}function f(e,t,a){return y(e,t,a)===e}function y(e,t,a){const i=e.getTime();return t&&t instanceof Date&&i<t.getTime()?t:a&&a instanceof Date&&i>a.getTime()?a:e}function x(){return Math.random().toString(16).slice(-4)}function w(e){return e+"-"+x()+x()+"-"+x()+"-"+x()+"-"+x()+"-"+x()+x()+x()}const k={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}},D=({selectedDay:t,focusedDay:a,today:i,day:o,language:n,onDaySelect:d,onKeyboardNavigation:s,focusedDayRef:r,inRange:l})=>{const u=c(o,i),h=c(o,a),p=c(o,t),b=o.getMonth()!==a.getMonth(),m=!l,{locale:v}=k[n];return e("button",{class:{"duet-date__day":!0,"is-outside":m,"is-disabled":b,"is-today":u},tabIndex:h?0:-1,onClick:function(e){d(e,o)},onKeyDown:s,"aria-selected":p?"true":void 0,"data-label":o.toLocaleDateString(v),disabled:m||b,type:"button",ref:e=>{h&&e&&r&&r(e)}},e("span",{"aria-hidden":"true"},o.getDate()),e("span",{class:"duet-date__vhidden"},o.toLocaleDateString(v)))},L=({selectedDate:t,focusedDate:a,labelledById:i,language:o,min:n,max:d,onDateSelect:s,onKeyboardNavigation:r,focusedDayRef:l,onMouseDown:u,onFocusIn:_})=>{const{dayLabels:g}=k[o],y=new Date,x=function(e,t=1){return function(e,t){const a=[];let i=e;for(;!c(i,t);)a.push(i),i=h(i,1);return a.push(i),a}(p(m(e),t),b(v(e),t))}(a);return e("table",{class:"duet-date__table",role:"grid","aria-labelledby":i,onFocusin:_,onMouseDown:u},e("thead",null,e("tr",null,g.map(t=>e("th",{class:"duet-date__table-header",scope:"col"},e("span",{"aria-hidden":"true"},t.substr(0,2)),e("span",{class:"duet-date__vhidden"},t))))),e("tbody",null,function(e){const t=[];for(let a=0;a<e.length;a+=7)t.push(e.slice(a,a+7));return t}(x).map(i=>e("tr",{class:"duet-date__row"},i.map(i=>e("td",{class:"duet-date__cell"},e(D,{day:i,today:y,language:o,selectedDay:t,focusedDay:a,inRange:f(i,n,d),onDaySelect:s,onKeyboardNavigation:r,focusedDayRef:l})))))))},M=/[^0-9\.]+/g,S=class{constructor(e){t(this,e),this.duetChange=a(this,"duetChange",7),this.duetBlur=a(this,"duetBlur",7),this.duetFocus=a(this,"duetFocus",7),this.monthSelectId=w("DuetDateMonth"),this.yearSelectId=w("DuetDateYear"),this.dialogLabelId=w("DuetDateLabel"),this.initialTouchX=null,this.initialTouchY=null,this.activeFocus=!1,this.focusedDay=new Date,this.open=!1,this.name="",this.identifier="",this.language="en",this.disabled=!1,this.value="",this.min="",this.max="",this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1},this.toggleOpen=e=>{e.preventDefault(),this.open?this.hide(!1):this.show()},this.handleEscKey=e=>{27===e.keyCode&&this.hide()},this.handleBlur=e=>{e.stopPropagation(),this.duetBlur.emit({component:"duet-date-picker"})},this.handleFocus=e=>{e.stopPropagation(),this.duetFocus.emit({component:"duet-date-picker"})},this.handleTouchStart=e=>{const t=e.changedTouches[0];this.initialTouchX=t.pageX,this.initialTouchY=t.pageY},this.handleTouchMove=e=>{e.preventDefault()},this.handleTouchEnd=e=>{const t=e.changedTouches[0],a=t.pageX-this.initialTouchX,i=t.pageY-this.initialTouchY,o=Math.abs(a)>=70&&Math.abs(i)<=70,n=Math.abs(i)>=70&&Math.abs(a)<=70&&i>0;o?this.addMonths(a<0?1:-1):n&&(this.hide(!1),e.preventDefault()),this.initialTouchY=null,this.initialTouchX=null},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.handleFirstFocusableKeydown=e=>{9===e.keyCode&&e.shiftKey&&(this.focusedDayNode.focus(),e.preventDefault())},this.handleKeyboardNavigation=e=>{if(9===e.keyCode&&!e.shiftKey)return e.preventDefault(),void this.firstFocusableElement.focus();var t=!0;switch(e.keyCode){case 39:this.addDays(1);break;case 37:this.addDays(-1);break;case 40:this.addDays(7);break;case 38:this.addDays(-7);break;case 33:e.shiftKey?this.addYears(-1):this.addMonths(-1);break;case 34:e.shiftKey?this.addYears(1):this.addMonths(1);break;case 36:this.startOfWeek();break;case 35:this.endOfWeek();break;default:t=!1}t&&(e.preventDefault(),this.enableActiveFocus())},this.handleDaySelect=(e,t)=>{f(t,l(this.min),l(this.max))&&(t.getMonth()===this.focusedDay.getMonth()?(this.setValue(t),this.hide()):this.setFocusedDay(t))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleInputChange=e=>{const t=e.target;t.value=t.value.replace(M,"");const a=function(e){if(!e)return;const t=e.match(d);return t?r(t[3],t[2],t[1]):void 0}(t.value);(a||""===t.value)&&this.setValue(a)},this.processFocusedDayNode=e=>{this.focusedDayNode=e,this.activeFocus&&this.open&&setTimeout(()=>e.focus(),0)}}handleDocumentClick(e){if(!this.open)return;const t=e.target;this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)||this.hide(!1)}async setFocus(){return this.datePickerInput.focus()}async show(){this.open=!0,this.setFocusedDay(l(this.value)||new Date),clearTimeout(this.focusTimeoutId),this.focusTimeoutId=setTimeout(()=>this.monthSelectNode.focus(),400)}async hide(e=!0){this.open=!1,clearTimeout(this.focusTimeoutId),e&&setTimeout(()=>this.datePickerButton.focus(),600)}addDays(e){this.setFocusedDay(h(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(p(this.focusedDay))}endOfWeek(){this.setFocusedDay(b(this.focusedDay))}setMonth(e){const t=_(m(this.focusedDay),e),a=v(t),i=_(this.focusedDay,e);this.setFocusedDay(y(i,t,a))}setYear(e){const t=g(m(this.focusedDay),e),a=v(t),i=g(this.focusedDay,e);this.setFocusedDay(y(i,t,a))}setFocusedDay(e){this.focusedDay=y(e,l(this.min),l(this.max))}setValue(e){this.value=function(e){return u(e,"YYYY-MM-DD")}(e),this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})}render(){const t=l(this.value),a=u(t,"dd.mm.yyyy"),o=(t||this.focusedDay).getFullYear(),d=this.focusedDay.getMonth(),s=this.focusedDay.getFullYear(),r=k[this.language],c=l(this.min),h=l(this.max),p=null!=c&&c.getMonth()===d&&c.getFullYear()===s,b=null!=h&&h.getMonth()===d&&h.getFullYear()===s;return e(i,null,e("div",{class:"duet-date"},e(n,{value:a,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:r.placeholder,buttonLabel:r.buttonLabel,selectedLabel:r.selected,identifier:this.identifier,buttonRef:e=>this.datePickerButton=e,inputRef:e=>this.datePickerInput=e}),e("div",{class:{"duet-date__dialog":!0,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},e("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:e=>this.dialogWrapperNode=e},e("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},e("label",{class:"duet-date__mobile-heading"},r.calendarHeading),e("button",{class:"duet-date__close",ref:e=>this.firstFocusableElement=e,onKeyDown:this.handleFirstFocusableKeydown,onClick:()=>this.hide(),"data-label":r.closeLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),e("span",{class:"duet-date__vhidden"},r.closeLabel))),e("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},e("div",null,e("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},r.monthLabels[d]," ",this.focusedDay.getFullYear()),e("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},r.monthSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:e=>this.monthSelectNode=e,onChange:this.handleMonthSelect},r.monthLabels.map((t,a)=>e("option",{value:a,selected:a===d},t))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,r.monthLabelsShort[d]),e("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),e("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},r.yearSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},function(e,t){for(var a=[],i=0;i<=t-e;i++)a.push(e+i);return a}(o-10,o+10).map(t=>e("option",{selected:t===s},t))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,this.focusedDay.getFullYear()),e("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),e("div",{class:"duet-date__nav"},e("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:p,"data-label":r.prevMonthLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},e("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),e("span",{class:"duet-date__vhidden"},r.prevMonthLabel)),e("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:b,"data-label":r.nextMonthLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},e("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),e("span",{class:"duet-date__vhidden"},r.nextMonthLabel)))),e(L,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:c,max:h}),e("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},r.keyboardInstruction)))))}get element(){return o(this)}};S.style='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';export{S as duet_date_picker} | ||
import{h as e,r as t,c as a,H as i,g as o}from"./index-2ab9c052.js";const n=({onClick:t,placeholder:a,buttonLabel:i,selectedLabel:o,name:n,value:d,identifier:r,disabled:s,role:l,buttonRef:u,inputRef:c,onInput:h,onBlur:p,onFocus:b})=>e("div",{class:"duet-date__input-wrapper"},e("input",{class:"duet-date__input",name:n,value:d,placeholder:a,id:r,disabled:s,role:l,"aria-autocomplete":"none",onInput:h,onFocus:b,onBlur:p,autoComplete:"off",ref:c}),e("button",{class:"duet-date__toggle",onClick:t,disabled:s,ref:u,type:"button"},e("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},e("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},e("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{fill:"currentColor"},e("circle",{cx:"8.5",cy:"8.5",r:"1"}),e("circle",{cx:"4.5",cy:"8.5",r:"1"}),e("circle",{cx:"12.5",cy:"8.5",r:"1"}),e("circle",{cx:"8.5",cy:"12.5",r:"1"}),e("circle",{cx:"4.5",cy:"12.5",r:"1"}),e("circle",{cx:"12.5",cy:"12.5",r:"1"})))),e("span",{class:"duet-date__vhidden"},i,d&&e("span",null,", ",o," ",d)))),d=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/,r=/^(\d{4})-(\d{2})-(\d{2})$/;function s(e,t,a){var i=parseInt(a,10),o=parseInt(t,10),n=parseInt(e,10);if(Number.isInteger(n)&&Number.isInteger(o)&&Number.isInteger(i)&&o>0&&o<=12&&i>0&&i<=31&&n>0)return new Date(n,o-1,i)}function l(e){if(!e)return;const t=e.match(r);return t?s(t[1],t[2],t[3]):void 0}function u(e,t){if(!e)return"";var a=e.getDate().toString(10),i=(e.getMonth()+1).toString(10),o=e.getFullYear().toString(10);return e.getDate()<10&&(a="0"+a),e.getMonth()<9&&(i="0"+i),t.replace(/MM/i,i).replace(/YYYY/i,o).replace(/DD/i,a)}function c(e,t){return null!=e&&null!=t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function h(e,t){var a=new Date(e);return a.setDate(a.getDate()+t),a}function p(e,t=1){var a=new Date(e),i=a.getDay(),o=(i<t?7:0)+i-t;return a.setDate(a.getDate()-o),a}function b(e,t=1){var a=new Date(e),i=a.getDay(),o=6+(i<t?-7:0)-(i-t);return a.setDate(a.getDate()+o),a}function v(e){return new Date(e.getFullYear(),e.getMonth(),1)}function m(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function _(e,t){const a=new Date(e);return a.setMonth(t),a}function g(e,t){const a=new Date(e);return a.setFullYear(t),a}function f(e,t,a){return x(e,t,a)===e}function x(e,t,a){const i=e.getTime();return t&&t instanceof Date&&i<t.getTime()?t:a&&a instanceof Date&&i>a.getTime()?a:e}function y(){return Math.random().toString(16).slice(-4)}function w(e){return e+"-"+y()+y()+"-"+y()+"-"+y()+"-"+y()+"-"+y()+y()+y()}const k={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}},D=({selectedDay:t,focusedDay:a,today:i,day:o,language:n,onDaySelect:d,onKeyboardNavigation:r,focusedDayRef:s,inRange:l})=>{const u=c(o,i),h=c(o,a),p=c(o,t),b=o.getMonth()!==a.getMonth(),v=!l,{locale:m}=k[n];return e("button",{class:{"duet-date__day":!0,"is-outside":v,"is-disabled":b,"is-today":u},tabIndex:h?0:-1,onClick:function(e){d(e,o)},onKeyDown:r,"aria-selected":p?"true":void 0,"data-label":o.toLocaleDateString(m),disabled:v||b,type:"button",ref:e=>{h&&e&&s&&s(e)}},e("span",{"aria-hidden":"true"},o.getDate()),e("span",{class:"duet-date__vhidden"},o.toLocaleDateString(m)))},L=({selectedDate:t,focusedDate:a,labelledById:i,language:o,min:n,max:d,onDateSelect:r,onKeyboardNavigation:s,focusedDayRef:l,onMouseDown:u,onFocusIn:_})=>{const{dayLabels:g}=k[o],x=new Date,y=function(e,t=1){return function(e,t){const a=[];let i=e;for(;!c(i,t);)a.push(i),i=h(i,1);return a.push(i),a}(p(v(e),t),b(m(e),t))}(a);return e("table",{class:"duet-date__table",role:"grid","aria-labelledby":i,onFocusin:_,onMouseDown:u},e("thead",null,e("tr",null,g.map(t=>e("th",{class:"duet-date__table-header",scope:"col"},e("span",{"aria-hidden":"true"},t.substr(0,2)),e("span",{class:"duet-date__vhidden"},t))))),e("tbody",null,function(e){const t=[];for(let a=0;a<e.length;a+=7)t.push(e.slice(a,a+7));return t}(y).map(i=>e("tr",{class:"duet-date__row"},i.map(i=>e("td",{class:"duet-date__cell"},e(D,{day:i,today:x,language:o,selectedDay:t,focusedDay:a,inRange:f(i,n,d),onDaySelect:r,onKeyboardNavigation:s,focusedDayRef:l})))))))},M=/[^0-9\.]+/g,z=class{constructor(e){t(this,e),this.duetChange=a(this,"duetChange",7),this.duetBlur=a(this,"duetBlur",7),this.duetFocus=a(this,"duetFocus",7),this.monthSelectId=w("DuetDateMonth"),this.yearSelectId=w("DuetDateYear"),this.dialogLabelId=w("DuetDateLabel"),this.initialTouchX=null,this.initialTouchY=null,this.activeFocus=!1,this.focusedDay=new Date,this.open=!1,this.name="",this.identifier="",this.language="en",this.disabled=!1,this.value="",this.min="",this.max="",this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1},this.toggleOpen=e=>{e.preventDefault(),this.open?this.hide(!1):this.show()},this.handleEscKey=e=>{27===e.keyCode&&this.hide()},this.handleBlur=e=>{e.stopPropagation(),this.duetBlur.emit({component:"duet-date-picker"})},this.handleFocus=e=>{e.stopPropagation(),this.duetFocus.emit({component:"duet-date-picker"})},this.handleTouchStart=e=>{const t=e.changedTouches[0];this.initialTouchX=t.pageX,this.initialTouchY=t.pageY},this.handleTouchMove=e=>{e.preventDefault()},this.handleTouchEnd=e=>{const t=e.changedTouches[0],a=t.pageX-this.initialTouchX,i=t.pageY-this.initialTouchY,o=Math.abs(a)>=70&&Math.abs(i)<=70,n=Math.abs(i)>=70&&Math.abs(a)<=70&&i>0;o?this.addMonths(a<0?1:-1):n&&(this.hide(!1),e.preventDefault()),this.initialTouchY=null,this.initialTouchX=null},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.handleFirstFocusableKeydown=e=>{9===e.keyCode&&e.shiftKey&&(this.focusedDayNode.focus(),e.preventDefault())},this.handleKeyboardNavigation=e=>{if(9===e.keyCode&&!e.shiftKey)return e.preventDefault(),void this.firstFocusableElement.focus();var t=!0;switch(e.keyCode){case 39:this.addDays(1);break;case 37:this.addDays(-1);break;case 40:this.addDays(7);break;case 38:this.addDays(-7);break;case 33:e.shiftKey?this.addYears(-1):this.addMonths(-1);break;case 34:e.shiftKey?this.addYears(1):this.addMonths(1);break;case 36:this.startOfWeek();break;case 35:this.endOfWeek();break;default:t=!1}t&&(e.preventDefault(),this.enableActiveFocus())},this.handleDaySelect=(e,t)=>{f(t,l(this.min),l(this.max))&&(t.getMonth()===this.focusedDay.getMonth()?(this.setValue(t),this.hide()):this.setFocusedDay(t))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleInputChange=e=>{const t=e.target;t.value=t.value.replace(M,"");const a=function(e){if(!e)return;const t=e.match(d);return t?s(t[3],t[2],t[1]):void 0}(t.value);(a||""===t.value)&&this.setValue(a)},this.processFocusedDayNode=e=>{this.focusedDayNode=e,this.activeFocus&&this.open&&setTimeout(()=>e.focus(),0)}}handleDocumentClick(e){if(!this.open)return;const t=e.target;this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)||this.hide(!1)}async setFocus(){return this.datePickerInput.focus()}async show(){this.open=!0,this.setFocusedDay(l(this.value)||new Date),clearTimeout(this.focusTimeoutId),this.focusTimeoutId=setTimeout(()=>this.monthSelectNode.focus(),400)}async hide(e=!0){this.open=!1,clearTimeout(this.focusTimeoutId),e&&setTimeout(()=>this.datePickerButton.focus(),600)}addDays(e){this.setFocusedDay(h(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(p(this.focusedDay))}endOfWeek(){this.setFocusedDay(b(this.focusedDay))}setMonth(e){const t=_(v(this.focusedDay),e),a=m(t),i=_(this.focusedDay,e);this.setFocusedDay(x(i,t,a))}setYear(e){const t=g(v(this.focusedDay),e),a=m(t),i=g(this.focusedDay,e);this.setFocusedDay(x(i,t,a))}setFocusedDay(e){this.focusedDay=x(e,l(this.min),l(this.max))}setValue(e){this.value=function(e){return u(e,"YYYY-MM-DD")}(e),this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})}render(){const t=l(this.value),a=u(t,"dd.mm.yyyy"),o=(t||this.focusedDay).getFullYear(),d=this.focusedDay.getMonth(),r=this.focusedDay.getFullYear(),s=k[this.language],c=l(this.min),h=l(this.max),p=null!=c&&c.getMonth()===d&&c.getFullYear()===r,b=null!=h&&h.getMonth()===d&&h.getFullYear()===r;return e(i,null,e("div",{class:"duet-date"},e(n,{value:a,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:s.placeholder,buttonLabel:s.buttonLabel,selectedLabel:s.selected,identifier:this.identifier,buttonRef:e=>this.datePickerButton=e,inputRef:e=>this.datePickerInput=e}),e("div",{class:{"duet-date__dialog":!0,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},e("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:e=>this.dialogWrapperNode=e},e("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},e("label",{class:"duet-date__mobile-heading"},s.calendarHeading),e("button",{class:"duet-date__close",ref:e=>this.firstFocusableElement=e,onKeyDown:this.handleFirstFocusableKeydown,onClick:()=>this.hide(),"data-label":s.closeLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M0 0h24v24H0V0z",fill:"none"}),e("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),e("span",{class:"duet-date__vhidden"},s.closeLabel))),e("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},e("div",null,e("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},s.monthLabels[d]," ",this.focusedDay.getFullYear()),e("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},s.monthSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:e=>this.monthSelectNode=e,onChange:this.handleMonthSelect},s.monthLabels.map((t,a)=>e("option",{value:a,selected:a===d},t))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,s.monthLabelsShort[d]),e("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),e("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},s.yearSelectLabel),e("div",{class:"duet-date__select"},e("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},function(e,t){for(var a=[],i=0;i<=t-e;i++)a.push(e+i);return a}(o-10,o+10).map(t=>e("option",{selected:t===r},t))),e("div",{class:"duet-date__select-label","aria-hidden":"true"},e("span",null,this.focusedDay.getFullYear()),e("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},e("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),e("div",{class:"duet-date__nav"},e("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:p,"data-label":s.prevMonthLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},e("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),e("span",{class:"duet-date__vhidden"},s.prevMonthLabel)),e("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:b,"data-label":s.nextMonthLabel,type:"button"},e("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},e("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),e("span",{class:"duet-date__vhidden"},s.nextMonthLabel)))),e(L,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:c,max:h}),e("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},s.keyboardInstruction)))))}get element(){return o(this)}};z.style='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';export{z as duet_date_picker} |
@@ -1,1 +0,1 @@ | ||
var __awaiter=this&&this.__awaiter||function(e,t,a,n){function i(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function r(e){try{s(n.next(e))}catch(e){o(e)}}function d(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?a(e.value):i(e.value).then(r,d)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,r;return r={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function d(e){return function(t){return s([e,t])}}function s(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,i&&(o=r[0]&2?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;if(i=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;i=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(r[0]===6&&a.label<o[1]){a.label=o[1];o=r;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(r);break}if(o[2])a.ops.pop();a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e];i=0}finally{n=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./index-b4a2d0d3.system.js"],(function(e){"use strict";var t,a,n,i,o;return{setters:[function(e){t=e.h;a=e.r;n=e.c;i=e.H;o=e.g}],execute:function(){var r=function(e){var a=e.onClick,n=e.placeholder,i=e.buttonLabel,o=e.selectedLabel,r=e.name,d=e.value,s=e.identifier,l=e.disabled,u=e.role,c=e.buttonRef,h=e.inputRef,p=e.onInput,f=e.onBlur,v=e.onFocus;return t("div",{class:"duet-date__input-wrapper"},t("input",{class:"duet-date__input",name:r,value:d,placeholder:n,id:s,disabled:l,role:u,"aria-autocomplete":"none",onInput:p,onFocus:v,onBlur:f,autoComplete:"off",ref:h}),t("button",{class:"duet-date__toggle",onClick:a,disabled:l,ref:c,type:"button"},t("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},t("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},t("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),t("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),t("g",{fill:"currentColor"},t("circle",{cx:"8.5",cy:"8.5",r:"1"}),t("circle",{cx:"4.5",cy:"8.5",r:"1"}),t("circle",{cx:"12.5",cy:"8.5",r:"1"}),t("circle",{cx:"8.5",cy:"12.5",r:"1"}),t("circle",{cx:"4.5",cy:"12.5",r:"1"}),t("circle",{cx:"12.5",cy:"12.5",r:"1"})))),t("span",{class:"duet-date__vhidden"},i,d&&t("span",null,", ",o," ",d))))};var d=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;var s=/^(\d{4})-(\d{2})-(\d{2})$/;var l="dd.mm.yyyy";var u="YYYY-MM-DD";function c(e,t,a){var n=parseInt(a,10);var i=parseInt(t,10);var o=parseInt(e,10);var r=Number.isInteger(o)&&Number.isInteger(i)&&Number.isInteger(n)&&i>0&&i<=12&&n>0&&n<=31&&o>0;if(r){return new Date(o,i-1,n)}}function h(e){if(!e){return}var t=e.match(d);if(t){return c(t[3],t[2],t[1])}}function p(e){if(!e){return}var t=e.match(s);if(t){return c(t[1],t[2],t[3])}}function f(e,t){if(!e){return""}var a=e.getDate().toString(10);var n=(e.getMonth()+1).toString(10);var i=e.getFullYear().toString(10);if(e.getDate()<10){a="0"+a}if(e.getMonth()<9){n="0"+n}return t.replace(/MM/i,n).replace(/YYYY/i,i).replace(/DD/i,a)}function v(e){return f(e,l)}function b(e){return f(e,u)}function g(e,t){if(e==null||t==null){return false}return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function y(e,t){var a=new Date(e);a.setDate(a.getDate()+t);return a}function m(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var i=(n<t?7:0)+n-t;a.setDate(a.getDate()-i);return a}function _(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var i=(n<t?-7:0)+6-(n-t);a.setDate(a.getDate()+i);return a}function x(e){return new Date(e.getFullYear(),e.getMonth(),1)}function w(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function D(e,t){var a=new Date(e);a.setMonth(t);return a}function k(e,t){var a=new Date(e);a.setFullYear(t);return a}function M(e,t,a){return L(e,t,a)===e}function L(e,t,a){var n=e.getTime();if(t&&t instanceof Date&&n<t.getTime()){return t}if(a&&a instanceof Date&&n>a.getTime()){return a}return e}function F(e,t){var a=[];var n=e;while(!g(n,t)){a.push(n);n=y(n,1)}a.push(n);return a}function S(e,t){if(t===void 0){t=1}var a=m(x(e),t);var n=_(w(e),t);return F(a,n)}function T(){return Math.random().toString(16).slice(-4)}function Y(e){return e+"-"+T()+T()+"-"+T()+"-"+T()+"-"+T()+"-"+T()+T()+T()}var I={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}};var C=function(e){var a=e.selectedDay,n=e.focusedDay,i=e.today,o=e.day,r=e.language,d=e.onDaySelect,s=e.onKeyboardNavigation,l=e.focusedDayRef,u=e.inRange;var c=g(o,i);var h=g(o,n);var p=g(o,a);var f=o.getMonth()!==n.getMonth();var v=!u;var b=I[r].locale;function y(e){d(e,o)}return t("button",{class:{"duet-date__day":true,"is-outside":v,"is-disabled":f,"is-today":c},tabIndex:h?0:-1,onClick:y,onKeyDown:s,"aria-selected":p?"true":undefined,"data-label":o.toLocaleDateString(b),disabled:v||f,type:"button",ref:function(e){if(h&&e&&l){l(e)}}},t("span",{"aria-hidden":"true"},o.getDate()),t("span",{class:"duet-date__vhidden"},o.toLocaleDateString(b)))};function N(e,t){var a=[];for(var n=0;n<e.length;n+=t){a.push(e.slice(n,n+t))}return a}var z=function(e){var a=e.selectedDate,n=e.focusedDate,i=e.labelledById,o=e.language,r=e.min,d=e.max,s=e.onDateSelect,l=e.onKeyboardNavigation,u=e.focusedDayRef,c=e.onMouseDown,h=e.onFocusIn;var p=I[o].dayLabels;var f=new Date;var v=S(n);return t("table",{class:"duet-date__table",role:"grid","aria-labelledby":i,onFocusin:h,onMouseDown:c},t("thead",null,t("tr",null,p.map((function(e){return t("th",{class:"duet-date__table-header",scope:"col"},t("span",{"aria-hidden":"true"},e.substr(0,2)),t("span",{class:"duet-date__vhidden"},e))})))),t("tbody",null,N(v,7).map((function(e){return t("tr",{class:"duet-date__row"},e.map((function(e){return t("td",{class:"duet-date__cell"},t(C,{day:e,today:f,language:o,selectedDay:a,focusedDay:n,inRange:M(e,r,d),onDaySelect:s,onKeyboardNavigation:l,focusedDayRef:u}))})))}))))};var E='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';function A(e,t){var a=[];for(var n=0;n<=t-e;n++){a.push(e+n)}return a}var B={TAB:9,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var P=/[^0-9\.]+/g;var K=400;var O=e("duet_date_picker",function(){function e(e){var t=this;a(this,e);this.duetChange=n(this,"duetChange",7);this.duetBlur=n(this,"duetBlur",7);this.duetFocus=n(this,"duetFocus",7);this.monthSelectId=Y("DuetDateMonth");this.yearSelectId=Y("DuetDateYear");this.dialogLabelId=Y("DuetDateLabel");this.initialTouchX=null;this.initialTouchY=null;this.activeFocus=false;this.focusedDay=new Date;this.open=false;this.name="";this.identifier="";this.language="en";this.disabled=false;this.value="";this.min="";this.max="";this.enableActiveFocus=function(){t.activeFocus=true};this.disableActiveFocus=function(){t.activeFocus=false};this.toggleOpen=function(e){e.preventDefault();t.open?t.hide(false):t.show()};this.handleEscKey=function(e){if(e.keyCode===B.ESC){t.hide()}};this.handleBlur=function(e){e.stopPropagation();t.duetBlur.emit({component:"duet-date-picker"})};this.handleFocus=function(e){e.stopPropagation();t.duetFocus.emit({component:"duet-date-picker"})};this.handleTouchStart=function(e){var a=e.changedTouches[0];t.initialTouchX=a.pageX;t.initialTouchY=a.pageY};this.handleTouchMove=function(e){e.preventDefault()};this.handleTouchEnd=function(e){var a=e.changedTouches[0];var n=a.pageX-t.initialTouchX;var i=a.pageY-t.initialTouchY;var o=70;var r=Math.abs(n)>=o&&Math.abs(i)<=o;var d=Math.abs(i)>=o&&Math.abs(n)<=o&&i>0;if(r){t.addMonths(n<0?1:-1)}else if(d){t.hide(false);e.preventDefault()}t.initialTouchY=null;t.initialTouchX=null};this.handleNextMonthClick=function(e){e.preventDefault();t.addMonths(1)};this.handlePreviousMonthClick=function(e){e.preventDefault();t.addMonths(-1)};this.handleFirstFocusableKeydown=function(e){if(e.keyCode===B.TAB&&e.shiftKey){t.focusedDayNode.focus();e.preventDefault()}};this.handleKeyboardNavigation=function(e){if(e.keyCode===B.TAB&&!e.shiftKey){e.preventDefault();t.firstFocusableElement.focus();return}var a=true;switch(e.keyCode){case B.RIGHT:t.addDays(1);break;case B.LEFT:t.addDays(-1);break;case B.DOWN:t.addDays(7);break;case B.UP:t.addDays(-7);break;case B.PAGE_UP:if(e.shiftKey){t.addYears(-1)}else{t.addMonths(-1)}break;case B.PAGE_DOWN:if(e.shiftKey){t.addYears(1)}else{t.addMonths(1)}break;case B.HOME:t.startOfWeek();break;case B.END:t.endOfWeek();break;default:a=false}if(a){e.preventDefault();t.enableActiveFocus()}};this.handleDaySelect=function(e,a){if(!M(a,p(t.min),p(t.max))){return}if(a.getMonth()===t.focusedDay.getMonth()){t.setValue(a);t.hide()}else{t.setFocusedDay(a)}};this.handleMonthSelect=function(e){t.setMonth(parseInt(e.target.value,10))};this.handleYearSelect=function(e){t.setYear(parseInt(e.target.value,10))};this.handleInputChange=function(e){var a=e.target;a.value=a.value.replace(P,"");var n=h(a.value);if(n||a.value===""){t.setValue(n)}};this.processFocusedDayNode=function(e){t.focusedDayNode=e;if(t.activeFocus&&t.open){setTimeout((function(){return e.focus()}),0)}}}e.prototype.handleDocumentClick=function(e){if(!this.open){return}var t=e.target;if(this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)){return}this.hide(false)};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.datePickerInput.focus()]}))}))};e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.open=true;this.setFocusedDay(p(this.value)||new Date);clearTimeout(this.focusTimeoutId);this.focusTimeoutId=setTimeout((function(){return e.monthSelectNode.focus()}),K);return[2]}))}))};e.prototype.hide=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(a){this.open=false;clearTimeout(this.focusTimeoutId);if(e){setTimeout((function(){return t.datePickerButton.focus()}),K+200)}return[2]}))}))};e.prototype.addDays=function(e){this.setFocusedDay(y(this.focusedDay,e))};e.prototype.addMonths=function(e){this.setMonth(this.focusedDay.getMonth()+e)};e.prototype.addYears=function(e){this.setYear(this.focusedDay.getFullYear()+e)};e.prototype.startOfWeek=function(){this.setFocusedDay(m(this.focusedDay))};e.prototype.endOfWeek=function(){this.setFocusedDay(_(this.focusedDay))};e.prototype.setMonth=function(e){var t=D(x(this.focusedDay),e);var a=w(t);var n=D(this.focusedDay,e);this.setFocusedDay(L(n,t,a))};e.prototype.setYear=function(e){var t=k(x(this.focusedDay),e);var a=w(t);var n=k(this.focusedDay,e);this.setFocusedDay(L(n,t,a))};e.prototype.setFocusedDay=function(e){this.focusedDay=L(e,p(this.min),p(this.max))};e.prototype.setValue=function(e){this.value=b(e);this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})};e.prototype.render=function(){var e=this;var a=p(this.value);var n=v(a);var o=(a||this.focusedDay).getFullYear();var d=this.focusedDay.getMonth();var s=this.focusedDay.getFullYear();var l=I[this.language];var u=p(this.min);var c=p(this.max);var h=u!=null&&u.getMonth()===d&&u.getFullYear()===s;var f=c!=null&&c.getMonth()===d&&c.getFullYear()===s;return t(i,null,t("div",{class:"duet-date"},t(r,{value:n,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:l.placeholder,buttonLabel:l.buttonLabel,selectedLabel:l.selected,identifier:this.identifier,buttonRef:function(t){return e.datePickerButton=t},inputRef:function(t){return e.datePickerInput=t}}),t("div",{class:{"duet-date__dialog":true,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},t("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:function(t){return e.dialogWrapperNode=t}},t("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},t("label",{class:"duet-date__mobile-heading"},l.calendarHeading),t("button",{class:"duet-date__close",ref:function(t){return e.firstFocusableElement=t},onKeyDown:this.handleFirstFocusableKeydown,onClick:function(){return e.hide()},"data-label":l.closeLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),t("span",{class:"duet-date__vhidden"},l.closeLabel))),t("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},t("div",null,t("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},l.monthLabels[d]," ",this.focusedDay.getFullYear()),t("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},l.monthSelectLabel),t("div",{class:"duet-date__select"},t("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:function(t){return e.monthSelectNode=t},onChange:this.handleMonthSelect},l.monthLabels.map((function(e,a){return t("option",{value:a,selected:a===d},e)}))),t("div",{class:"duet-date__select-label","aria-hidden":"true"},t("span",null,l.monthLabelsShort[d]),t("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),t("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},l.yearSelectLabel),t("div",{class:"duet-date__select"},t("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},A(o-10,o+10).map((function(e){return t("option",{selected:e===s},e)}))),t("div",{class:"duet-date__select-label","aria-hidden":"true"},t("span",null,this.focusedDay.getFullYear()),t("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),t("div",{class:"duet-date__nav"},t("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:h,"data-label":l.prevMonthLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},t("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),t("span",{class:"duet-date__vhidden"},l.prevMonthLabel)),t("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:f,"data-label":l.nextMonthLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},t("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),t("span",{class:"duet-date__vhidden"},l.nextMonthLabel)))),t(z,{selectedDate:a,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:u,max:c}),t("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},l.keyboardInstruction)))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());O.style=E}}})); | ||
var __awaiter=this&&this.__awaiter||function(e,t,a,n){function o(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,i){function r(e){try{s(n.next(e))}catch(e){i(e)}}function d(e){try{s(n["throw"](e))}catch(e){i(e)}}function s(e){e.done?a(e.value):o(e.value).then(r,d)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,r;return r={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function d(e){return function(t){return s([e,t])}}function s(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,o&&(i=r[0]&2?o["return"]:r[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;if(o=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;o=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(r[0]===6&&a.label<i[1]){a.label=i[1];i=r;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(r);break}if(i[2])a.ops.pop();a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e];o=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./index-b4a2d0d3.system.js"],(function(e){"use strict";var t,a,n,o,i;return{setters:[function(e){t=e.h;a=e.r;n=e.c;o=e.H;i=e.g}],execute:function(){var r=function(e){var a=e.onClick,n=e.placeholder,o=e.buttonLabel,i=e.selectedLabel,r=e.name,d=e.value,s=e.identifier,l=e.disabled,u=e.role,c=e.buttonRef,h=e.inputRef,p=e.onInput,f=e.onBlur,v=e.onFocus;return t("div",{class:"duet-date__input-wrapper"},t("input",{class:"duet-date__input",name:r,value:d,placeholder:n,id:s,disabled:l,role:u,"aria-autocomplete":"none",onInput:p,onFocus:v,onBlur:f,autoComplete:"off",ref:h}),t("button",{class:"duet-date__toggle",onClick:a,disabled:l,ref:c,type:"button"},t("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},t("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},t("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),t("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),t("g",{fill:"currentColor"},t("circle",{cx:"8.5",cy:"8.5",r:"1"}),t("circle",{cx:"4.5",cy:"8.5",r:"1"}),t("circle",{cx:"12.5",cy:"8.5",r:"1"}),t("circle",{cx:"8.5",cy:"12.5",r:"1"}),t("circle",{cx:"4.5",cy:"12.5",r:"1"}),t("circle",{cx:"12.5",cy:"12.5",r:"1"})))),t("span",{class:"duet-date__vhidden"},o,d&&t("span",null,", ",i," ",d))))};var d=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;var s=/^(\d{4})-(\d{2})-(\d{2})$/;var l="dd.mm.yyyy";var u="YYYY-MM-DD";function c(e,t,a){var n=parseInt(a,10);var o=parseInt(t,10);var i=parseInt(e,10);var r=Number.isInteger(i)&&Number.isInteger(o)&&Number.isInteger(n)&&o>0&&o<=12&&n>0&&n<=31&&i>0;if(r){return new Date(i,o-1,n)}}function h(e){if(!e){return}var t=e.match(d);if(t){return c(t[3],t[2],t[1])}}function p(e){if(!e){return}var t=e.match(s);if(t){return c(t[1],t[2],t[3])}}function f(e,t){if(!e){return""}var a=e.getDate().toString(10);var n=(e.getMonth()+1).toString(10);var o=e.getFullYear().toString(10);if(e.getDate()<10){a="0"+a}if(e.getMonth()<9){n="0"+n}return t.replace(/MM/i,n).replace(/YYYY/i,o).replace(/DD/i,a)}function v(e){return f(e,l)}function b(e){return f(e,u)}function g(e,t){if(e==null||t==null){return false}return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function y(e,t){var a=new Date(e);a.setDate(a.getDate()+t);return a}function m(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var o=(n<t?7:0)+n-t;a.setDate(a.getDate()-o);return a}function _(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var o=(n<t?-7:0)+6-(n-t);a.setDate(a.getDate()+o);return a}function x(e){return new Date(e.getFullYear(),e.getMonth(),1)}function w(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function D(e,t){var a=new Date(e);a.setMonth(t);return a}function k(e,t){var a=new Date(e);a.setFullYear(t);return a}function M(e,t,a){return L(e,t,a)===e}function L(e,t,a){var n=e.getTime();if(t&&t instanceof Date&&n<t.getTime()){return t}if(a&&a instanceof Date&&n>a.getTime()){return a}return e}function F(e,t){var a=[];var n=e;while(!g(n,t)){a.push(n);n=y(n,1)}a.push(n);return a}function S(e,t){if(t===void 0){t=1}var a=m(x(e),t);var n=_(w(e),t);return F(a,n)}function T(){return Math.random().toString(16).slice(-4)}function Y(e){return e+"-"+T()+T()+"-"+T()+"-"+T()+"-"+T()+"-"+T()+T()+T()}var I={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}};var C=function(e){var a=e.selectedDay,n=e.focusedDay,o=e.today,i=e.day,r=e.language,d=e.onDaySelect,s=e.onKeyboardNavigation,l=e.focusedDayRef,u=e.inRange;var c=g(i,o);var h=g(i,n);var p=g(i,a);var f=i.getMonth()!==n.getMonth();var v=!u;var b=I[r].locale;function y(e){d(e,i)}return t("button",{class:{"duet-date__day":true,"is-outside":v,"is-disabled":f,"is-today":c},tabIndex:h?0:-1,onClick:y,onKeyDown:s,"aria-selected":p?"true":undefined,"data-label":i.toLocaleDateString(b),disabled:v||f,type:"button",ref:function(e){if(h&&e&&l){l(e)}}},t("span",{"aria-hidden":"true"},i.getDate()),t("span",{class:"duet-date__vhidden"},i.toLocaleDateString(b)))};function N(e,t){var a=[];for(var n=0;n<e.length;n+=t){a.push(e.slice(n,n+t))}return a}var z=function(e){var a=e.selectedDate,n=e.focusedDate,o=e.labelledById,i=e.language,r=e.min,d=e.max,s=e.onDateSelect,l=e.onKeyboardNavigation,u=e.focusedDayRef,c=e.onMouseDown,h=e.onFocusIn;var p=I[i].dayLabels;var f=new Date;var v=S(n);return t("table",{class:"duet-date__table",role:"grid","aria-labelledby":o,onFocusin:h,onMouseDown:c},t("thead",null,t("tr",null,p.map((function(e){return t("th",{class:"duet-date__table-header",scope:"col"},t("span",{"aria-hidden":"true"},e.substr(0,2)),t("span",{class:"duet-date__vhidden"},e))})))),t("tbody",null,N(v,7).map((function(e){return t("tr",{class:"duet-date__row"},e.map((function(e){return t("td",{class:"duet-date__cell"},t(C,{day:e,today:f,language:i,selectedDay:a,focusedDay:n,inRange:M(e,r,d),onDaySelect:s,onKeyboardNavigation:l,focusedDayRef:u}))})))}))))};var E='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';function A(e,t){var a=[];for(var n=0;n<=t-e;n++){a.push(e+n)}return a}var B={TAB:9,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var P=/[^0-9\.]+/g;var K=400;var O=e("duet_date_picker",function(){function e(e){var t=this;a(this,e);this.duetChange=n(this,"duetChange",7);this.duetBlur=n(this,"duetBlur",7);this.duetFocus=n(this,"duetFocus",7);this.monthSelectId=Y("DuetDateMonth");this.yearSelectId=Y("DuetDateYear");this.dialogLabelId=Y("DuetDateLabel");this.initialTouchX=null;this.initialTouchY=null;this.activeFocus=false;this.focusedDay=new Date;this.open=false;this.name="";this.identifier="";this.language="en";this.disabled=false;this.value="";this.min="";this.max="";this.enableActiveFocus=function(){t.activeFocus=true};this.disableActiveFocus=function(){t.activeFocus=false};this.toggleOpen=function(e){e.preventDefault();t.open?t.hide(false):t.show()};this.handleEscKey=function(e){if(e.keyCode===B.ESC){t.hide()}};this.handleBlur=function(e){e.stopPropagation();t.duetBlur.emit({component:"duet-date-picker"})};this.handleFocus=function(e){e.stopPropagation();t.duetFocus.emit({component:"duet-date-picker"})};this.handleTouchStart=function(e){var a=e.changedTouches[0];t.initialTouchX=a.pageX;t.initialTouchY=a.pageY};this.handleTouchMove=function(e){e.preventDefault()};this.handleTouchEnd=function(e){var a=e.changedTouches[0];var n=a.pageX-t.initialTouchX;var o=a.pageY-t.initialTouchY;var i=70;var r=Math.abs(n)>=i&&Math.abs(o)<=i;var d=Math.abs(o)>=i&&Math.abs(n)<=i&&o>0;if(r){t.addMonths(n<0?1:-1)}else if(d){t.hide(false);e.preventDefault()}t.initialTouchY=null;t.initialTouchX=null};this.handleNextMonthClick=function(e){e.preventDefault();t.addMonths(1)};this.handlePreviousMonthClick=function(e){e.preventDefault();t.addMonths(-1)};this.handleFirstFocusableKeydown=function(e){if(e.keyCode===B.TAB&&e.shiftKey){t.focusedDayNode.focus();e.preventDefault()}};this.handleKeyboardNavigation=function(e){if(e.keyCode===B.TAB&&!e.shiftKey){e.preventDefault();t.firstFocusableElement.focus();return}var a=true;switch(e.keyCode){case B.RIGHT:t.addDays(1);break;case B.LEFT:t.addDays(-1);break;case B.DOWN:t.addDays(7);break;case B.UP:t.addDays(-7);break;case B.PAGE_UP:if(e.shiftKey){t.addYears(-1)}else{t.addMonths(-1)}break;case B.PAGE_DOWN:if(e.shiftKey){t.addYears(1)}else{t.addMonths(1)}break;case B.HOME:t.startOfWeek();break;case B.END:t.endOfWeek();break;default:a=false}if(a){e.preventDefault();t.enableActiveFocus()}};this.handleDaySelect=function(e,a){if(!M(a,p(t.min),p(t.max))){return}if(a.getMonth()===t.focusedDay.getMonth()){t.setValue(a);t.hide()}else{t.setFocusedDay(a)}};this.handleMonthSelect=function(e){t.setMonth(parseInt(e.target.value,10))};this.handleYearSelect=function(e){t.setYear(parseInt(e.target.value,10))};this.handleInputChange=function(e){var a=e.target;a.value=a.value.replace(P,"");var n=h(a.value);if(n||a.value===""){t.setValue(n)}};this.processFocusedDayNode=function(e){t.focusedDayNode=e;if(t.activeFocus&&t.open){setTimeout((function(){return e.focus()}),0)}}}e.prototype.handleDocumentClick=function(e){if(!this.open){return}var t=e.target;if(this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)){return}this.hide(false)};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.datePickerInput.focus()]}))}))};e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.open=true;this.setFocusedDay(p(this.value)||new Date);clearTimeout(this.focusTimeoutId);this.focusTimeoutId=setTimeout((function(){return e.monthSelectNode.focus()}),K);return[2]}))}))};e.prototype.hide=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(a){this.open=false;clearTimeout(this.focusTimeoutId);if(e){setTimeout((function(){return t.datePickerButton.focus()}),K+200)}return[2]}))}))};e.prototype.addDays=function(e){this.setFocusedDay(y(this.focusedDay,e))};e.prototype.addMonths=function(e){this.setMonth(this.focusedDay.getMonth()+e)};e.prototype.addYears=function(e){this.setYear(this.focusedDay.getFullYear()+e)};e.prototype.startOfWeek=function(){this.setFocusedDay(m(this.focusedDay))};e.prototype.endOfWeek=function(){this.setFocusedDay(_(this.focusedDay))};e.prototype.setMonth=function(e){var t=D(x(this.focusedDay),e);var a=w(t);var n=D(this.focusedDay,e);this.setFocusedDay(L(n,t,a))};e.prototype.setYear=function(e){var t=k(x(this.focusedDay),e);var a=w(t);var n=k(this.focusedDay,e);this.setFocusedDay(L(n,t,a))};e.prototype.setFocusedDay=function(e){this.focusedDay=L(e,p(this.min),p(this.max))};e.prototype.setValue=function(e){this.value=b(e);this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})};e.prototype.render=function(){var e=this;var a=p(this.value);var n=v(a);var i=(a||this.focusedDay).getFullYear();var d=this.focusedDay.getMonth();var s=this.focusedDay.getFullYear();var l=I[this.language];var u=p(this.min);var c=p(this.max);var h=u!=null&&u.getMonth()===d&&u.getFullYear()===s;var f=c!=null&&c.getMonth()===d&&c.getFullYear()===s;return t(o,null,t("div",{class:"duet-date"},t(r,{value:n,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:l.placeholder,buttonLabel:l.buttonLabel,selectedLabel:l.selected,identifier:this.identifier,buttonRef:function(t){return e.datePickerButton=t},inputRef:function(t){return e.datePickerInput=t}}),t("div",{class:{"duet-date__dialog":true,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},t("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:function(t){return e.dialogWrapperNode=t}},t("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},t("label",{class:"duet-date__mobile-heading"},l.calendarHeading),t("button",{class:"duet-date__close",ref:function(t){return e.firstFocusableElement=t},onKeyDown:this.handleFirstFocusableKeydown,onClick:function(){return e.hide()},"data-label":l.closeLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),t("span",{class:"duet-date__vhidden"},l.closeLabel))),t("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},t("div",null,t("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},l.monthLabels[d]," ",this.focusedDay.getFullYear()),t("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},l.monthSelectLabel),t("div",{class:"duet-date__select"},t("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:function(t){return e.monthSelectNode=t},onChange:this.handleMonthSelect},l.monthLabels.map((function(e,a){return t("option",{value:a,selected:a===d},e)}))),t("div",{class:"duet-date__select-label","aria-hidden":"true"},t("span",null,l.monthLabelsShort[d]),t("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),t("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},l.yearSelectLabel),t("div",{class:"duet-date__select"},t("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},A(i-10,i+10).map((function(e){return t("option",{selected:e===s},e)}))),t("div",{class:"duet-date__select-label","aria-hidden":"true"},t("span",null,this.focusedDay.getFullYear()),t("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},t("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),t("div",{class:"duet-date__nav"},t("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:h,"data-label":l.prevMonthLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},t("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),t("span",{class:"duet-date__vhidden"},l.prevMonthLabel)),t("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:f,"data-label":l.nextMonthLabel,type:"button"},t("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},t("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),t("span",{class:"duet-date__vhidden"},l.nextMonthLabel)))),t(z,{selectedDate:a,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:u,max:c}),t("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},l.keyboardInstruction)))))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());O.style=E}}})); |
@@ -1,1 +0,1 @@ | ||
var __awaiter=this&&this.__awaiter||function(e,t,a,n){function i(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function r(e){try{s(n.next(e))}catch(e){o(e)}}function d(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?a(e.value):i(e.value).then(r,d)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,r;return r={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function d(e){return function(t){return s([e,t])}}function s(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,i&&(o=r[0]&2?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;if(i=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;i=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(r[0]===6&&a.label<o[1]){a.label=o[1];o=r;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(r);break}if(o[2])a.ops.pop();a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e];i=0}finally{n=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-51ab19fe.js";var DatePickerInput=function(e){var t=e.onClick,a=e.placeholder,n=e.buttonLabel,i=e.selectedLabel,o=e.name,r=e.value,d=e.identifier,s=e.disabled,l=e.role,u=e.buttonRef,c=e.inputRef,p=e.onInput,f=e.onBlur,v=e.onFocus;return h("div",{class:"duet-date__input-wrapper"},h("input",{class:"duet-date__input",name:o,value:r,placeholder:a,id:d,disabled:s,role:l,"aria-autocomplete":"none",onInput:p,onFocus:v,onBlur:f,autoComplete:"off",ref:c}),h("button",{class:"duet-date__toggle",onClick:t,disabled:s,ref:u,type:"button"},h("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},h("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},h("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),h("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),h("g",{fill:"currentColor"},h("circle",{cx:"8.5",cy:"8.5",r:"1"}),h("circle",{cx:"4.5",cy:"8.5",r:"1"}),h("circle",{cx:"12.5",cy:"8.5",r:"1"}),h("circle",{cx:"8.5",cy:"12.5",r:"1"}),h("circle",{cx:"4.5",cy:"12.5",r:"1"}),h("circle",{cx:"12.5",cy:"12.5",r:"1"})))),h("span",{class:"duet-date__vhidden"},n,r&&h("span",null,", ",i," ",r))))};var DATE_FORMAT=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;var ISO_DATE_FORMAT=/^(\d{4})-(\d{2})-(\d{2})$/;var DATE_OUTPUT_FORMAT="dd.mm.yyyy";var DATE_ISO_OUTPUT_FORMAT="YYYY-MM-DD";function createDate(e,t,a){var n=parseInt(a,10);var i=parseInt(t,10);var o=parseInt(e,10);var r=Number.isInteger(o)&&Number.isInteger(i)&&Number.isInteger(n)&&i>0&&i<=12&&n>0&&n<=31&&o>0;if(r){return new Date(o,i-1,n)}}function parseDate(e){if(!e){return}var t=e.match(DATE_FORMAT);if(t){return createDate(t[3],t[2],t[1])}}function parseISODate(e){if(!e){return}var t=e.match(ISO_DATE_FORMAT);if(t){return createDate(t[1],t[2],t[3])}}function formatDate(e,t){if(!e){return""}var a=e.getDate().toString(10);var n=(e.getMonth()+1).toString(10);var i=e.getFullYear().toString(10);if(e.getDate()<10){a="0"+a}if(e.getMonth()<9){n="0"+n}return t.replace(/MM/i,n).replace(/YYYY/i,i).replace(/DD/i,a)}function printDate(e){return formatDate(e,DATE_OUTPUT_FORMAT)}function printISODate(e){return formatDate(e,DATE_ISO_OUTPUT_FORMAT)}function isEqual(e,t){if(e==null||t==null){return false}return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function addDays(e,t){var a=new Date(e);a.setDate(a.getDate()+t);return a}function startOfWeek(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var i=(n<t?7:0)+n-t;a.setDate(a.getDate()-i);return a}function endOfWeek(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var i=(n<t?-7:0)+6-(n-t);a.setDate(a.getDate()+i);return a}function startOfMonth(e){return new Date(e.getFullYear(),e.getMonth(),1)}function endOfMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function setMonth(e,t){var a=new Date(e);a.setMonth(t);return a}function setYear(e,t){var a=new Date(e);a.setFullYear(t);return a}function inRange(e,t,a){return clamp(e,t,a)===e}function clamp(e,t,a){var n=e.getTime();if(t&&t instanceof Date&&n<t.getTime()){return t}if(a&&a instanceof Date&&n>a.getTime()){return a}return e}function getDaysInRange(e,t){var a=[];var n=e;while(!isEqual(n,t)){a.push(n);n=addDays(n,1)}a.push(n);return a}function getViewOfMonth(e,t){if(t===void 0){t=1}var a=startOfWeek(startOfMonth(e),t);var n=endOfWeek(endOfMonth(e),t);return getDaysInRange(a,n)}function chr4(){return Math.random().toString(16).slice(-4)}function createIdentifier(e){return e+"-"+chr4()+chr4()+"-"+chr4()+"-"+chr4()+"-"+chr4()+"-"+chr4()+chr4()+chr4()}var i18n={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}};var DatePickerDay=function(e){var t=e.selectedDay,a=e.focusedDay,n=e.today,i=e.day,o=e.language,r=e.onDaySelect,d=e.onKeyboardNavigation,s=e.focusedDayRef,l=e.inRange;var u=isEqual(i,n);var c=isEqual(i,a);var p=isEqual(i,t);var f=i.getMonth()!==a.getMonth();var v=!l;var b=i18n[o].locale;function g(e){r(e,i)}return h("button",{class:{"duet-date__day":true,"is-outside":v,"is-disabled":f,"is-today":u},tabIndex:c?0:-1,onClick:g,onKeyDown:d,"aria-selected":p?"true":undefined,"data-label":i.toLocaleDateString(b),disabled:v||f,type:"button",ref:function(e){if(c&&e&&s){s(e)}}},h("span",{"aria-hidden":"true"},i.getDate()),h("span",{class:"duet-date__vhidden"},i.toLocaleDateString(b)))};function chunk(e,t){var a=[];for(var n=0;n<e.length;n+=t){a.push(e.slice(n,n+t))}return a}var DatePickerMonth=function(e){var t=e.selectedDate,a=e.focusedDate,n=e.labelledById,i=e.language,o=e.min,r=e.max,d=e.onDateSelect,s=e.onKeyboardNavigation,l=e.focusedDayRef,u=e.onMouseDown,c=e.onFocusIn;var p=i18n[i].dayLabels;var f=new Date;var v=getViewOfMonth(a);return h("table",{class:"duet-date__table",role:"grid","aria-labelledby":n,onFocusin:c,onMouseDown:u},h("thead",null,h("tr",null,p.map((function(e){return h("th",{class:"duet-date__table-header",scope:"col"},h("span",{"aria-hidden":"true"},e.substr(0,2)),h("span",{class:"duet-date__vhidden"},e))})))),h("tbody",null,chunk(v,7).map((function(e){return h("tr",{class:"duet-date__row"},e.map((function(e){return h("td",{class:"duet-date__cell"},h(DatePickerDay,{day:e,today:f,language:i,selectedDay:t,focusedDay:a,inRange:inRange(e,o,r),onDaySelect:d,onKeyboardNavigation:s,focusedDayRef:l}))})))}))))};var duetDatePickerCss='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';function range(e,t){var a=[];for(var n=0;n<=t-e;n++){a.push(e+n)}return a}var keyCode={TAB:9,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var DISALLOWED_CHARACTERS=/[^0-9\.]+/g;var TRANSITION_MS=400;var DuetDatePicker=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",7);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.monthSelectId=createIdentifier("DuetDateMonth");this.yearSelectId=createIdentifier("DuetDateYear");this.dialogLabelId=createIdentifier("DuetDateLabel");this.initialTouchX=null;this.initialTouchY=null;this.activeFocus=false;this.focusedDay=new Date;this.open=false;this.name="";this.identifier="";this.language="en";this.disabled=false;this.value="";this.min="";this.max="";this.enableActiveFocus=function(){t.activeFocus=true};this.disableActiveFocus=function(){t.activeFocus=false};this.toggleOpen=function(e){e.preventDefault();t.open?t.hide(false):t.show()};this.handleEscKey=function(e){if(e.keyCode===keyCode.ESC){t.hide()}};this.handleBlur=function(e){e.stopPropagation();t.duetBlur.emit({component:"duet-date-picker"})};this.handleFocus=function(e){e.stopPropagation();t.duetFocus.emit({component:"duet-date-picker"})};this.handleTouchStart=function(e){var a=e.changedTouches[0];t.initialTouchX=a.pageX;t.initialTouchY=a.pageY};this.handleTouchMove=function(e){e.preventDefault()};this.handleTouchEnd=function(e){var a=e.changedTouches[0];var n=a.pageX-t.initialTouchX;var i=a.pageY-t.initialTouchY;var o=70;var r=Math.abs(n)>=o&&Math.abs(i)<=o;var d=Math.abs(i)>=o&&Math.abs(n)<=o&&i>0;if(r){t.addMonths(n<0?1:-1)}else if(d){t.hide(false);e.preventDefault()}t.initialTouchY=null;t.initialTouchX=null};this.handleNextMonthClick=function(e){e.preventDefault();t.addMonths(1)};this.handlePreviousMonthClick=function(e){e.preventDefault();t.addMonths(-1)};this.handleFirstFocusableKeydown=function(e){if(e.keyCode===keyCode.TAB&&e.shiftKey){t.focusedDayNode.focus();e.preventDefault()}};this.handleKeyboardNavigation=function(e){if(e.keyCode===keyCode.TAB&&!e.shiftKey){e.preventDefault();t.firstFocusableElement.focus();return}var a=true;switch(e.keyCode){case keyCode.RIGHT:t.addDays(1);break;case keyCode.LEFT:t.addDays(-1);break;case keyCode.DOWN:t.addDays(7);break;case keyCode.UP:t.addDays(-7);break;case keyCode.PAGE_UP:if(e.shiftKey){t.addYears(-1)}else{t.addMonths(-1)}break;case keyCode.PAGE_DOWN:if(e.shiftKey){t.addYears(1)}else{t.addMonths(1)}break;case keyCode.HOME:t.startOfWeek();break;case keyCode.END:t.endOfWeek();break;default:a=false}if(a){e.preventDefault();t.enableActiveFocus()}};this.handleDaySelect=function(e,a){if(!inRange(a,parseISODate(t.min),parseISODate(t.max))){return}if(a.getMonth()===t.focusedDay.getMonth()){t.setValue(a);t.hide()}else{t.setFocusedDay(a)}};this.handleMonthSelect=function(e){t.setMonth(parseInt(e.target.value,10))};this.handleYearSelect=function(e){t.setYear(parseInt(e.target.value,10))};this.handleInputChange=function(e){var a=e.target;a.value=a.value.replace(DISALLOWED_CHARACTERS,"");var n=parseDate(a.value);if(n||a.value===""){t.setValue(n)}};this.processFocusedDayNode=function(e){t.focusedDayNode=e;if(t.activeFocus&&t.open){setTimeout((function(){return e.focus()}),0)}}}e.prototype.handleDocumentClick=function(e){if(!this.open){return}var t=e.target;if(this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)){return}this.hide(false)};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.datePickerInput.focus()]}))}))};e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.open=true;this.setFocusedDay(parseISODate(this.value)||new Date);clearTimeout(this.focusTimeoutId);this.focusTimeoutId=setTimeout((function(){return e.monthSelectNode.focus()}),TRANSITION_MS);return[2]}))}))};e.prototype.hide=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(a){this.open=false;clearTimeout(this.focusTimeoutId);if(e){setTimeout((function(){return t.datePickerButton.focus()}),TRANSITION_MS+200)}return[2]}))}))};e.prototype.addDays=function(e){this.setFocusedDay(addDays(this.focusedDay,e))};e.prototype.addMonths=function(e){this.setMonth(this.focusedDay.getMonth()+e)};e.prototype.addYears=function(e){this.setYear(this.focusedDay.getFullYear()+e)};e.prototype.startOfWeek=function(){this.setFocusedDay(startOfWeek(this.focusedDay))};e.prototype.endOfWeek=function(){this.setFocusedDay(endOfWeek(this.focusedDay))};e.prototype.setMonth=function(e){var t=setMonth(startOfMonth(this.focusedDay),e);var a=endOfMonth(t);var n=setMonth(this.focusedDay,e);this.setFocusedDay(clamp(n,t,a))};e.prototype.setYear=function(e){var t=setYear(startOfMonth(this.focusedDay),e);var a=endOfMonth(t);var n=setYear(this.focusedDay,e);this.setFocusedDay(clamp(n,t,a))};e.prototype.setFocusedDay=function(e){this.focusedDay=clamp(e,parseISODate(this.min),parseISODate(this.max))};e.prototype.setValue=function(e){this.value=printISODate(e);this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})};e.prototype.render=function(){var e=this;var t=parseISODate(this.value);var a=printDate(t);var n=(t||this.focusedDay).getFullYear();var i=this.focusedDay.getMonth();var o=this.focusedDay.getFullYear();var r=i18n[this.language];var d=parseISODate(this.min);var s=parseISODate(this.max);var l=d!=null&&d.getMonth()===i&&d.getFullYear()===o;var u=s!=null&&s.getMonth()===i&&s.getFullYear()===o;return h(Host,null,h("div",{class:"duet-date"},h(DatePickerInput,{value:a,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:r.placeholder,buttonLabel:r.buttonLabel,selectedLabel:r.selected,identifier:this.identifier,buttonRef:function(t){return e.datePickerButton=t},inputRef:function(t){return e.datePickerInput=t}}),h("div",{class:{"duet-date__dialog":true,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},h("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:function(t){return e.dialogWrapperNode=t}},h("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},h("label",{class:"duet-date__mobile-heading"},r.calendarHeading),h("button",{class:"duet-date__close",ref:function(t){return e.firstFocusableElement=t},onKeyDown:this.handleFirstFocusableKeydown,onClick:function(){return e.hide()},"data-label":r.closeLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),h("span",{class:"duet-date__vhidden"},r.closeLabel))),h("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},h("div",null,h("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},r.monthLabels[i]," ",this.focusedDay.getFullYear()),h("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},r.monthSelectLabel),h("div",{class:"duet-date__select"},h("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:function(t){return e.monthSelectNode=t},onChange:this.handleMonthSelect},r.monthLabels.map((function(e,t){return h("option",{value:t,selected:t===i},e)}))),h("div",{class:"duet-date__select-label","aria-hidden":"true"},h("span",null,r.monthLabelsShort[i]),h("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),h("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},r.yearSelectLabel),h("div",{class:"duet-date__select"},h("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},range(n-10,n+10).map((function(e){return h("option",{selected:e===o},e)}))),h("div",{class:"duet-date__select-label","aria-hidden":"true"},h("span",null,this.focusedDay.getFullYear()),h("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),h("div",{class:"duet-date__nav"},h("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:l,"data-label":r.prevMonthLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},h("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),h("span",{class:"duet-date__vhidden"},r.prevMonthLabel)),h("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:u,"data-label":r.nextMonthLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},h("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),h("span",{class:"duet-date__vhidden"},r.nextMonthLabel)))),h(DatePickerMonth,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:d,max:s}),h("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},r.keyboardInstruction)))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetDatePicker.style=duetDatePickerCss;export{DuetDatePicker as duet_date_picker}; | ||
var __awaiter=this&&this.__awaiter||function(e,t,a,n){function o(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,i){function r(e){try{s(n.next(e))}catch(e){i(e)}}function d(e){try{s(n["throw"](e))}catch(e){i(e)}}function s(e){e.done?a(e.value):o(e.value).then(r,d)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,r;return r={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function d(e){return function(t){return s([e,t])}}function s(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,o&&(i=r[0]&2?o["return"]:r[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;if(o=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;o=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(r[0]===6&&a.label<i[1]){a.label=i[1];i=r;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(r);break}if(i[2])a.ops.pop();a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e];o=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-51ab19fe.js";var DatePickerInput=function(e){var t=e.onClick,a=e.placeholder,n=e.buttonLabel,o=e.selectedLabel,i=e.name,r=e.value,d=e.identifier,s=e.disabled,l=e.role,u=e.buttonRef,c=e.inputRef,p=e.onInput,f=e.onBlur,v=e.onFocus;return h("div",{class:"duet-date__input-wrapper"},h("input",{class:"duet-date__input",name:i,value:r,placeholder:a,id:d,disabled:s,role:l,"aria-autocomplete":"none",onInput:p,onFocus:v,onBlur:f,autoComplete:"off",ref:c}),h("button",{class:"duet-date__toggle",onClick:t,disabled:s,ref:u,type:"button"},h("svg",{"aria-hidden":"true",height:"24",viewBox:"0 0 21 21",width:"24",xmlns:"http://www.w3.org/2000/svg"},h("g",{fill:"none","fill-rule":"evenodd",transform:"translate(2 2)"},h("path",{d:"m2.5.5h12c1.1045695 0 2 .8954305 2 2v12c0 1.1045695-.8954305 2-2 2h-12c-1.1045695 0-2-.8954305-2-2v-12c0-1.1045695.8954305-2 2-2z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),h("path",{d:"m.5 4.5h16",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),h("g",{fill:"currentColor"},h("circle",{cx:"8.5",cy:"8.5",r:"1"}),h("circle",{cx:"4.5",cy:"8.5",r:"1"}),h("circle",{cx:"12.5",cy:"8.5",r:"1"}),h("circle",{cx:"8.5",cy:"12.5",r:"1"}),h("circle",{cx:"4.5",cy:"12.5",r:"1"}),h("circle",{cx:"12.5",cy:"12.5",r:"1"})))),h("span",{class:"duet-date__vhidden"},n,r&&h("span",null,", ",o," ",r))))};var DATE_FORMAT=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;var ISO_DATE_FORMAT=/^(\d{4})-(\d{2})-(\d{2})$/;var DATE_OUTPUT_FORMAT="dd.mm.yyyy";var DATE_ISO_OUTPUT_FORMAT="YYYY-MM-DD";function createDate(e,t,a){var n=parseInt(a,10);var o=parseInt(t,10);var i=parseInt(e,10);var r=Number.isInteger(i)&&Number.isInteger(o)&&Number.isInteger(n)&&o>0&&o<=12&&n>0&&n<=31&&i>0;if(r){return new Date(i,o-1,n)}}function parseDate(e){if(!e){return}var t=e.match(DATE_FORMAT);if(t){return createDate(t[3],t[2],t[1])}}function parseISODate(e){if(!e){return}var t=e.match(ISO_DATE_FORMAT);if(t){return createDate(t[1],t[2],t[3])}}function formatDate(e,t){if(!e){return""}var a=e.getDate().toString(10);var n=(e.getMonth()+1).toString(10);var o=e.getFullYear().toString(10);if(e.getDate()<10){a="0"+a}if(e.getMonth()<9){n="0"+n}return t.replace(/MM/i,n).replace(/YYYY/i,o).replace(/DD/i,a)}function printDate(e){return formatDate(e,DATE_OUTPUT_FORMAT)}function printISODate(e){return formatDate(e,DATE_ISO_OUTPUT_FORMAT)}function isEqual(e,t){if(e==null||t==null){return false}return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function addDays(e,t){var a=new Date(e);a.setDate(a.getDate()+t);return a}function startOfWeek(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var o=(n<t?7:0)+n-t;a.setDate(a.getDate()-o);return a}function endOfWeek(e,t){if(t===void 0){t=1}var a=new Date(e);var n=a.getDay();var o=(n<t?-7:0)+6-(n-t);a.setDate(a.getDate()+o);return a}function startOfMonth(e){return new Date(e.getFullYear(),e.getMonth(),1)}function endOfMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function setMonth(e,t){var a=new Date(e);a.setMonth(t);return a}function setYear(e,t){var a=new Date(e);a.setFullYear(t);return a}function inRange(e,t,a){return clamp(e,t,a)===e}function clamp(e,t,a){var n=e.getTime();if(t&&t instanceof Date&&n<t.getTime()){return t}if(a&&a instanceof Date&&n>a.getTime()){return a}return e}function getDaysInRange(e,t){var a=[];var n=e;while(!isEqual(n,t)){a.push(n);n=addDays(n,1)}a.push(n);return a}function getViewOfMonth(e,t){if(t===void 0){t=1}var a=startOfWeek(startOfMonth(e),t);var n=endOfWeek(endOfMonth(e),t);return getDaysInRange(a,n)}function chr4(){return Math.random().toString(16).slice(-4)}function createIdentifier(e){return e+"-"+chr4()+chr4()+"-"+chr4()+"-"+chr4()+"-"+chr4()+"-"+chr4()+chr4()+chr4()}var i18n={en:{locale:"en-GB",buttonLabel:"Choose date",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",monthSelectLabel:"Month",yearSelectLabel:"Year",closeLabel:"Close window",keyboardInstruction:"You can use arrow keys to navigate dates",dayLabels:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],calendarHeading:"Choose a date",selected:"Selected date is",placeholder:"dd.mm.yyyy",monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],monthLabelsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},fi:{locale:"fi-FI",buttonLabel:"Valitse päivämäärä",prevMonthLabel:"Edellinen kuukausi",nextMonthLabel:"Seuraava kuukausi",monthSelectLabel:"Kuukausi",yearSelectLabel:"Vuosi",closeLabel:"Sulje ikkuna",keyboardInstruction:"Voit navigoida päivämääriä nuolinäppäimillä",dayLabels:["Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai","Sunnuntai"],calendarHeading:"Valitse päivämäärä",selected:"Valittu päivämäärä on",placeholder:"pp.kk.vvvv",monthLabels:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthLabelsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},sv:{locale:"sv-SE",buttonLabel:"Välj datum",prevMonthLabel:"Föregående månad",nextMonthLabel:"Nästa månad",monthSelectLabel:"Månad",yearSelectLabel:"År",closeLabel:"Stäng fönstret",keyboardInstruction:"Använd piltangenterna för att navigera i kalender",dayLabels:["Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],calendarHeading:"Välj datum",selected:"Valt datum är",placeholder:"dd.mm.åååå",monthLabels:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthLabelsShort:["Jan","Feb","Mars","April","Maj","Juni","Juli","Aug","Sep","Okt","Nov","Dec"]}};var DatePickerDay=function(e){var t=e.selectedDay,a=e.focusedDay,n=e.today,o=e.day,i=e.language,r=e.onDaySelect,d=e.onKeyboardNavigation,s=e.focusedDayRef,l=e.inRange;var u=isEqual(o,n);var c=isEqual(o,a);var p=isEqual(o,t);var f=o.getMonth()!==a.getMonth();var v=!l;var b=i18n[i].locale;function g(e){r(e,o)}return h("button",{class:{"duet-date__day":true,"is-outside":v,"is-disabled":f,"is-today":u},tabIndex:c?0:-1,onClick:g,onKeyDown:d,"aria-selected":p?"true":undefined,"data-label":o.toLocaleDateString(b),disabled:v||f,type:"button",ref:function(e){if(c&&e&&s){s(e)}}},h("span",{"aria-hidden":"true"},o.getDate()),h("span",{class:"duet-date__vhidden"},o.toLocaleDateString(b)))};function chunk(e,t){var a=[];for(var n=0;n<e.length;n+=t){a.push(e.slice(n,n+t))}return a}var DatePickerMonth=function(e){var t=e.selectedDate,a=e.focusedDate,n=e.labelledById,o=e.language,i=e.min,r=e.max,d=e.onDateSelect,s=e.onKeyboardNavigation,l=e.focusedDayRef,u=e.onMouseDown,c=e.onFocusIn;var p=i18n[o].dayLabels;var f=new Date;var v=getViewOfMonth(a);return h("table",{class:"duet-date__table",role:"grid","aria-labelledby":n,onFocusin:c,onMouseDown:u},h("thead",null,h("tr",null,p.map((function(e){return h("th",{class:"duet-date__table-header",scope:"col"},h("span",{"aria-hidden":"true"},e.substr(0,2)),h("span",{class:"duet-date__vhidden"},e))})))),h("tbody",null,chunk(v,7).map((function(e){return h("tr",{class:"duet-date__row"},e.map((function(e){return h("td",{class:"duet-date__cell"},h(DatePickerDay,{day:e,today:f,language:o,selectedDay:t,focusedDay:a,inRange:inRange(e,i,r),onDaySelect:d,onKeyboardNavigation:s,focusedDayRef:l}))})))}))))};var duetDatePickerCss='.duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:"";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';function range(e,t){var a=[];for(var n=0;n<=t-e;n++){a.push(e+n)}return a}var keyCode={TAB:9,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var DISALLOWED_CHARACTERS=/[^0-9\.]+/g;var TRANSITION_MS=400;var DuetDatePicker=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",7);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.monthSelectId=createIdentifier("DuetDateMonth");this.yearSelectId=createIdentifier("DuetDateYear");this.dialogLabelId=createIdentifier("DuetDateLabel");this.initialTouchX=null;this.initialTouchY=null;this.activeFocus=false;this.focusedDay=new Date;this.open=false;this.name="";this.identifier="";this.language="en";this.disabled=false;this.value="";this.min="";this.max="";this.enableActiveFocus=function(){t.activeFocus=true};this.disableActiveFocus=function(){t.activeFocus=false};this.toggleOpen=function(e){e.preventDefault();t.open?t.hide(false):t.show()};this.handleEscKey=function(e){if(e.keyCode===keyCode.ESC){t.hide()}};this.handleBlur=function(e){e.stopPropagation();t.duetBlur.emit({component:"duet-date-picker"})};this.handleFocus=function(e){e.stopPropagation();t.duetFocus.emit({component:"duet-date-picker"})};this.handleTouchStart=function(e){var a=e.changedTouches[0];t.initialTouchX=a.pageX;t.initialTouchY=a.pageY};this.handleTouchMove=function(e){e.preventDefault()};this.handleTouchEnd=function(e){var a=e.changedTouches[0];var n=a.pageX-t.initialTouchX;var o=a.pageY-t.initialTouchY;var i=70;var r=Math.abs(n)>=i&&Math.abs(o)<=i;var d=Math.abs(o)>=i&&Math.abs(n)<=i&&o>0;if(r){t.addMonths(n<0?1:-1)}else if(d){t.hide(false);e.preventDefault()}t.initialTouchY=null;t.initialTouchX=null};this.handleNextMonthClick=function(e){e.preventDefault();t.addMonths(1)};this.handlePreviousMonthClick=function(e){e.preventDefault();t.addMonths(-1)};this.handleFirstFocusableKeydown=function(e){if(e.keyCode===keyCode.TAB&&e.shiftKey){t.focusedDayNode.focus();e.preventDefault()}};this.handleKeyboardNavigation=function(e){if(e.keyCode===keyCode.TAB&&!e.shiftKey){e.preventDefault();t.firstFocusableElement.focus();return}var a=true;switch(e.keyCode){case keyCode.RIGHT:t.addDays(1);break;case keyCode.LEFT:t.addDays(-1);break;case keyCode.DOWN:t.addDays(7);break;case keyCode.UP:t.addDays(-7);break;case keyCode.PAGE_UP:if(e.shiftKey){t.addYears(-1)}else{t.addMonths(-1)}break;case keyCode.PAGE_DOWN:if(e.shiftKey){t.addYears(1)}else{t.addMonths(1)}break;case keyCode.HOME:t.startOfWeek();break;case keyCode.END:t.endOfWeek();break;default:a=false}if(a){e.preventDefault();t.enableActiveFocus()}};this.handleDaySelect=function(e,a){if(!inRange(a,parseISODate(t.min),parseISODate(t.max))){return}if(a.getMonth()===t.focusedDay.getMonth()){t.setValue(a);t.hide()}else{t.setFocusedDay(a)}};this.handleMonthSelect=function(e){t.setMonth(parseInt(e.target.value,10))};this.handleYearSelect=function(e){t.setYear(parseInt(e.target.value,10))};this.handleInputChange=function(e){var a=e.target;a.value=a.value.replace(DISALLOWED_CHARACTERS,"");var n=parseDate(a.value);if(n||a.value===""){t.setValue(n)}};this.processFocusedDayNode=function(e){t.focusedDayNode=e;if(t.activeFocus&&t.open){setTimeout((function(){return e.focus()}),0)}}}e.prototype.handleDocumentClick=function(e){if(!this.open){return}var t=e.target;if(this.dialogWrapperNode.contains(t)||this.datePickerButton.contains(t)){return}this.hide(false)};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.datePickerInput.focus()]}))}))};e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.open=true;this.setFocusedDay(parseISODate(this.value)||new Date);clearTimeout(this.focusTimeoutId);this.focusTimeoutId=setTimeout((function(){return e.monthSelectNode.focus()}),TRANSITION_MS);return[2]}))}))};e.prototype.hide=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(a){this.open=false;clearTimeout(this.focusTimeoutId);if(e){setTimeout((function(){return t.datePickerButton.focus()}),TRANSITION_MS+200)}return[2]}))}))};e.prototype.addDays=function(e){this.setFocusedDay(addDays(this.focusedDay,e))};e.prototype.addMonths=function(e){this.setMonth(this.focusedDay.getMonth()+e)};e.prototype.addYears=function(e){this.setYear(this.focusedDay.getFullYear()+e)};e.prototype.startOfWeek=function(){this.setFocusedDay(startOfWeek(this.focusedDay))};e.prototype.endOfWeek=function(){this.setFocusedDay(endOfWeek(this.focusedDay))};e.prototype.setMonth=function(e){var t=setMonth(startOfMonth(this.focusedDay),e);var a=endOfMonth(t);var n=setMonth(this.focusedDay,e);this.setFocusedDay(clamp(n,t,a))};e.prototype.setYear=function(e){var t=setYear(startOfMonth(this.focusedDay),e);var a=endOfMonth(t);var n=setYear(this.focusedDay,e);this.setFocusedDay(clamp(n,t,a))};e.prototype.setFocusedDay=function(e){this.focusedDay=clamp(e,parseISODate(this.min),parseISODate(this.max))};e.prototype.setValue=function(e){this.value=printISODate(e);this.duetChange.emit({component:"duet-date-picker",value:this.value,valueAsDate:e})};e.prototype.render=function(){var e=this;var t=parseISODate(this.value);var a=printDate(t);var n=(t||this.focusedDay).getFullYear();var o=this.focusedDay.getMonth();var i=this.focusedDay.getFullYear();var r=i18n[this.language];var d=parseISODate(this.min);var s=parseISODate(this.max);var l=d!=null&&d.getMonth()===o&&d.getFullYear()===i;var u=s!=null&&s.getMonth()===o&&s.getFullYear()===i;return h(Host,null,h("div",{class:"duet-date"},h(DatePickerInput,{value:a,onInput:this.handleInputChange,onBlur:this.handleBlur,onFocus:this.handleFocus,onClick:this.toggleOpen,name:this.name,disabled:this.disabled,role:this.role,placeholder:r.placeholder,buttonLabel:r.buttonLabel,selectedLabel:r.selected,identifier:this.identifier,buttonRef:function(t){return e.datePickerButton=t},inputRef:function(t){return e.datePickerInput=t}}),h("div",{class:{"duet-date__dialog":true,"is-active":this.open},role:"dialog","aria-modal":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},h("div",{class:"duet-date__dialog-content",onKeyDown:this.handleEscKey,ref:function(t){return e.dialogWrapperNode=t}},h("div",{class:"duet-date__mobile",onFocusin:this.disableActiveFocus},h("label",{class:"duet-date__mobile-heading"},r.calendarHeading),h("button",{class:"duet-date__close",ref:function(t){return e.firstFocusableElement=t},onKeyDown:this.handleFirstFocusableKeydown,onClick:function(){return e.hide()},"data-label":r.closeLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"})),h("span",{class:"duet-date__vhidden"},r.closeLabel))),h("div",{class:"duet-date__header",onFocusin:this.disableActiveFocus},h("div",null,h("h2",{id:this.dialogLabelId,class:"duet-date__vhidden","aria-live":"polite"},r.monthLabels[o]," ",this.focusedDay.getFullYear()),h("label",{htmlFor:this.monthSelectId,class:"duet-date__vhidden"},r.monthSelectLabel),h("div",{class:"duet-date__select"},h("select",{id:this.monthSelectId,class:"duet-date__select--month",ref:function(t){return e.monthSelectNode=t},onChange:this.handleMonthSelect},r.monthLabels.map((function(e,t){return h("option",{value:t,selected:t===o},e)}))),h("div",{class:"duet-date__select-label","aria-hidden":"true"},h("span",null,r.monthLabelsShort[o]),h("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"})))),h("label",{htmlFor:this.yearSelectId,class:"duet-date__vhidden"},r.yearSelectLabel),h("div",{class:"duet-date__select"},h("select",{id:this.yearSelectId,class:"duet-date__select--year",onChange:this.handleYearSelect},range(n-10,n+10).map((function(e){return h("option",{selected:e===i},e)}))),h("div",{class:"duet-date__select-label","aria-hidden":"true"},h("span",null,this.focusedDay.getFullYear()),h("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},h("path",{d:"M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"}))))),h("div",{class:"duet-date__nav"},h("button",{class:"duet-date__prev",onClick:this.handlePreviousMonthClick,disabled:l,"data-label":r.prevMonthLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},h("path",{d:"M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z"})),h("span",{class:"duet-date__vhidden"},r.prevMonthLabel)),h("button",{class:"duet-date__next",onClick:this.handleNextMonthClick,disabled:u,"data-label":r.nextMonthLabel,type:"button"},h("svg",{"aria-hidden":"true",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 24 24"},h("path",{d:"M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z"})),h("span",{class:"duet-date__vhidden"},r.nextMonthLabel)))),h(DatePickerMonth,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,language:this.language,focusedDayRef:this.processFocusedDayNode,min:d,max:s}),h("div",{class:"duet-date__vhidden duet-date__instructions","aria-live":"polite"},r.keyboardInstruction)))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetDatePicker.style=duetDatePickerCss;export{DuetDatePicker as duet_date_picker}; |
@@ -362,3 +362,3 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-51ab19fe.js'; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{font-family:var(--duet-font);padding:12px 48px 12px 12px;width:100%}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;color:var(--duet-color-text);cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;user-select:none;width:48px;z-index:2}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
const duetDatePickerCss = ".duet-date *,.duet-date *::before,.duet-date *::after{box-sizing:border-box;margin:0}.duet-date{box-sizing:border-box;color:var(--duet-color-text);display:block;font-family:var(--duet-font);margin:0;position:relative;text-align:left;width:100%}.duet-date__input{-webkit-appearance:none;appearance:none;background:var(--duet-color-surface);border:1px solid var(--duet-color-text);border-radius:var(--duet-radius);color:var(--duet-color-text);font-family:var(--duet-font);font-size:100%;padding:12px 60px 12px 12px;width:100%}.duet-date__input:focus{border-color:var(--duet-color-primary);box-shadow:0 0 0 1px var(--duet-color-primary);outline:0}.duet-date__input-wrapper{position:relative;width:100%}.duet-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-bottom-right-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.1);color:var(--duet-color-text);cursor:pointer;display:flex;height:calc(100% - 2px);justify-content:center;position:absolute;right:1px;top:1px;user-select:none;width:48px;z-index:2}.duet-date__toggle:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__dialog{display:flex;left:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;width:100%;will-change:transform, opacity, visibility;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog{background:var(--duet-color-overlay);bottom:0;position:fixed;right:0;top:0;transform:translateZ(0);transform-origin:bottom center;transition:opacity 400ms ease, visibility 400ms ease;will-change:opacity, visibility}}.duet-date__dialog.is-active{opacity:1;transform:scale(1) translateZ(0) translateY(0);visibility:visible}.duet-date__dialog-content{background:var(--duet-color-surface);border:1px solid rgba(0, 0, 0, 0.1);border-radius:var(--duet-radius);box-shadow:0 4px 10px 0 rgba(0, 0, 0, 0.1);margin-left:auto;margin-top:8px;max-width:310px;min-width:290px;padding:16px 16px 20px;position:relative;transform:none;width:100%;z-index:var(--duet-z-index)}@media (max-width: 35.9375em){.duet-date__dialog-content{border:0;border-radius:0;border-top-left-radius:var(--duet-radius);border-top-right-radius:var(--duet-radius);bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .duet-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.duet-date__table{border-collapse:collapse;border-spacing:0;color:var(--duet-color-text);font-size:1rem;font-weight:var(--duet-font-normal);line-height:1.25;text-align:center;width:100%}.duet-date__table-header{font-size:0.75rem;font-weight:var(--duet-font-bold);letter-spacing:1px;line-height:1.25;padding-bottom:8px;text-decoration:none;text-transform:uppercase}.duet-date__cell{text-align:center}.duet-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-block;font-family:var(--duet-font);font-size:0.875rem;font-variant-numeric:tabular-nums;font-weight:var(--duet-font-normal);height:36px;line-height:1.25;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;width:36px;z-index:1}.duet-date__day.is-today{box-shadow:0 0 0 1px var(--duet-color-primary);position:relative;z-index:200}.duet-date__day:hover::before,.duet-date__day.is-today::before{background:var(--duet-color-primary);border-radius:50%;bottom:0;content:\"\";left:0;opacity:0.06;position:absolute;right:0;top:0}.duet-date__day[aria-selected=true],.duet-date__day:focus{background:var(--duet-color-primary);box-shadow:none;color:var(--duet-color-text-active);outline:0}.duet-date__day:active{background:var(--duet-color-primary);box-shadow:0 0 5px var(--duet-color-primary);color:var(--duet-color-text-active);z-index:200}.duet-date__day:focus{box-shadow:0 0 5px var(--duet-color-primary);z-index:200}.duet-date__day.is-disabled{background:transparent;box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.5}.duet-date__day.is-disabled::before{display:none}.duet-date__day.is-outside{background:var(--duet-color-button);box-shadow:none;color:var(--duet-color-text);cursor:default;opacity:0.6;pointer-events:none}.duet-date__day.is-outside::before{display:none}.duet-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.duet-date__nav{white-space:nowrap}.duet-date__prev,.duet-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:inline-flex;height:32px;justify-content:center;margin-left:8px;padding:0;transition:background-color 300ms ease;width:32px}@media (max-width: 35.9375em){.duet-date__prev,.duet-date__next{height:40px;width:40px}}.duet-date__prev:focus,.duet-date__next:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:0}.duet-date__prev:active:focus,.duet-date__next:active:focus{box-shadow:none}.duet-date__prev:disabled,.duet-date__next:disabled{cursor:default;opacity:0.5}.duet-date__select{display:inline-flex;margin-top:4px;position:relative}.duet-date__select span{margin-right:4px}.duet-date__select select{cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.duet-date__select select:focus+.duet-date__select-label{box-shadow:0 0 0 2px var(--duet-color-primary)}.duet-date__select-label{align-items:center;border-radius:var(--duet-radius);color:var(--duet-color-text);display:flex;font-size:1.25rem;font-weight:var(--duet-font-bold);line-height:1.25;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.duet-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.duet-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-8px;top:-8px;width:auto}}.duet-date__mobile-heading{display:inline-block;font-weight:var(--duet-font-bold);max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date__mobile-heading{display:none}}.duet-date__close{-webkit-appearance:none;align-items:center;appearance:none;background:var(--duet-color-button);border:0;border-radius:50%;color:var(--duet-color-text);cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;width:24px}@media (min-width: 36em){.duet-date__close{opacity:0}}.duet-date__close:focus{box-shadow:0 0 0 2px var(--duet-color-primary);outline:none}@media (min-width: 36em){.duet-date__close:focus{opacity:1}}.duet-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}"; | ||
@@ -365,0 +365,0 @@ function range(from, to) { |
{ | ||
"name": "@duetds/date-picker", | ||
"version": "1.0.0-alpha.15", | ||
"version": "1.0.0-alpha.16", | ||
"description": "Duet Date Picker is an open source version of Duet Design System’s Date Picker. It’s a Web Component that lets user pick a single date using a special calendar like date picker interface.", | ||
@@ -65,3 +65,3 @@ "author": "LocalTapiola Services Ltd <duetdesignsystem@lahitapiola.fi>", | ||
"@stencil/utils": "latest", | ||
"@types/jest": "26.0.9", | ||
"@types/jest": "26.0.10", | ||
"@types/jest-image-snapshot": "3.1.0", | ||
@@ -68,0 +68,0 @@ "@types/puppeteer": "3.0.1", |
@@ -122,5 +122,5 @@ ![CI Status](https://github.com/duetds/duet-date-picker-prep/workflows/CI/badge.svg) [![NPM Version](https://img.shields.io/npm/v/@duetds/date-picker.svg)](https://www.npmjs.com/package/@duetds/date-picker) ![Dependencies status](https://david-dm.org/duetds/date-picker.svg) ![MIT License](https://img.shields.io/badge/license-MIT-blue.svg) | ||
```html | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/duet.esm.js"></script> | ||
<script nomodule src="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/duet.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/themes/default.css" /> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/duet.esm.js"></script> | ||
<script nomodule src="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/duet.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/themes/default.css" /> | ||
``` | ||
@@ -441,3 +441,3 @@ | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/themes/default.css" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/themes/default.css" /> | ||
``` | ||
@@ -530,4 +530,4 @@ | ||
```html | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/duet.esm.js" as="script" crossorigin="anonymous" /> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/duet-date-picker.entry.js" as="script" crossorigin="anonymous" /> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/duet.esm.js" as="script" crossorigin="anonymous" /> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/duet-date-picker.entry.js" as="script" crossorigin="anonymous" /> | ||
``` | ||
@@ -538,3 +538,3 @@ | ||
```html | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.15/dist/duet/themes/default.css" as="style" /> | ||
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@duetds/date-picker@1.0.0-alpha.16/dist/duet/themes/default.css" as="style" /> | ||
``` | ||
@@ -541,0 +541,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1562623
18213