@oslokommune/punkt-elements 12.6.3 → 12.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{class-map-DunDFQn7.js → class-map-CC5YmUWA.js} +1 -1
  2. package/dist/{class-map-Ch54kkX5.cjs → class-map-DuDzlp5t.cjs} +1 -1
  3. package/dist/{index-CyqOyy_9.js → index-CBp5twsn.js} +1 -1
  4. package/dist/{index-DSyh6tUw.cjs → index-D8H97G5s.cjs} +1 -1
  5. package/dist/{index-BI6-RUqp.js → index-D8wkW6WM.js} +114 -106
  6. package/dist/{index-BNOnscrA.cjs → index-OhFn59AM.cjs} +22 -16
  7. package/dist/{index-CsTujnXs.js → index-d6Lj2RhC.js} +2 -0
  8. package/dist/{index-Bpc07w_P.cjs → index-kJnGegz8.cjs} +1 -1
  9. package/dist/pkt-alert.cjs +1 -1
  10. package/dist/pkt-alert.js +4 -4
  11. package/dist/pkt-calendar.cjs +1 -1
  12. package/dist/pkt-calendar.js +4 -4
  13. package/dist/pkt-card.cjs +1 -1
  14. package/dist/pkt-card.js +4 -4
  15. package/dist/pkt-component-template.cjs +1 -1
  16. package/dist/pkt-component-template.js +3 -3
  17. package/dist/pkt-datepicker.cjs +11 -8
  18. package/dist/pkt-datepicker.js +9 -6
  19. package/dist/pkt-element.cjs +1 -1
  20. package/dist/pkt-element.js +1 -1
  21. package/dist/pkt-icon.cjs +1 -1
  22. package/dist/pkt-icon.js +2 -2
  23. package/dist/pkt-index.cjs +1 -1
  24. package/dist/pkt-index.js +2 -2
  25. package/dist/pkt-input-wrapper.cjs +1 -1
  26. package/dist/pkt-input-wrapper.js +4 -4
  27. package/dist/pkt-link.cjs +1 -1
  28. package/dist/pkt-link.js +4 -4
  29. package/dist/pkt-messagebox.cjs +1 -1
  30. package/dist/pkt-messagebox.js +4 -4
  31. package/dist/pkt-tag.cjs +1 -1
  32. package/dist/pkt-tag.js +4 -4
  33. package/dist/{ref-C3InMDfU.cjs → ref-Bi2ZZNQq.cjs} +1 -1
  34. package/dist/{ref-By_W8A-f.js → ref-bB529lv7.js} +1 -1
  35. package/package.json +2 -2
  36. package/src/components/calendar/index.ts +13 -4
  37. package/src/components/datepicker/index.ts +4 -1
@@ -1,4 +1,4 @@
1
- import { T as a } from "./index-CsTujnXs.js";
1
+ import { T as a } from "./index-d6Lj2RhC.js";
2
2
  import { e as h, i as d, a as c } from "./directive-Cxhakbpr.js";
3
3
  /**
4
4
  * @license
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./index-DSyh6tUw.cjs"),r=require("./directive-DtixNHDT.cjs");/**
1
+ "use strict";const a=require("./index-D8H97G5s.cjs"),r=require("./directive-DtixNHDT.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { E as f, T as v, P as m, x as y, n as h } from "./index-CsTujnXs.js";
1
+ import { E as f, T as v, P as m, x as y, n as h } from "./index-d6Lj2RhC.js";
2
2
  import { i as P, a as k, e as g, t as _ } from "./directive-Cxhakbpr.js";
3
3
  /**
4
4
  * @license
@@ -24,4 +24,4 @@
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(m[r[t+0]]+m[r[t+1]]+m[r[t+2]]+m[r[t+3]]+"-"+m[r[t+4]]+m[r[t+5]]+"-"+m[r[t+6]]+m[r[t+7]]+"-"+m[r[t+8]]+m[r[t+9]]+"-"+m[r[t+10]]+m[r[t+11]]+m[r[t+12]]+m[r[t+13]]+m[r[t+14]]+m[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:Bt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const jt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender"},Jt={days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Wt={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:jt,calendar:zt,dates:Jt,forms:Wt};var Zt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Zt(t,e,i),i};class X extends O{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],X.prototype,"strings");class g extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],g.prototype,"id");u([c({type:String,reflect:!0})],g.prototype,"name");u([c({type:Boolean,reflect:!0})],g.prototype,"required");u([c({type:Boolean,reflect:!0})],g.prototype,"disabled");u([c({type:String,reflect:!0})],g.prototype,"placeholder");u([c({type:Number,reflect:!0})],g.prototype,"min");u([c({type:Number,reflect:!0})],g.prototype,"max");u([c({type:Number,reflect:!0})],g.prototype,"minlength");u([c({type:Number,reflect:!0})],g.prototype,"maxlength");u([c({type:String,reflect:!0})],g.prototype,"pattern");u([c({type:Boolean,reflect:!0})],g.prototype,"optionalTag");u([c({type:String,reflect:!0})],g.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],g.prototype,"requiredTag");u([c({type:String,reflect:!0})],g.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],g.prototype,"hasError");u([c({type:String,reflect:!0})],g.prototype,"errorMessage");u([At()],g.prototype,"touched");exports.E=d;exports.PktElement=X;exports.PktInputElement=g;exports.T=w;exports.Z=kt;exports.n=c;exports.r=At;exports.translations=y;exports.v4=bt;exports.x=Nt;
27
+ */function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(m[r[t+0]]+m[r[t+1]]+m[r[t+2]]+m[r[t+3]]+"-"+m[r[t+4]]+m[r[t+5]]+"-"+m[r[t+6]]+m[r[t+7]]+"-"+m[r[t+8]]+m[r[t+9]]+"-"+m[r[t+10]]+m[r[t+11]]+m[r[t+12]]+m[r[t+13]]+m[r[t+14]]+m[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:Bt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const jt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender"},Jt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Wt={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:jt,calendar:zt,dates:Jt,forms:Wt};var Zt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Zt(t,e,i),i};class X extends O{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],X.prototype,"strings");class g extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],g.prototype,"id");u([c({type:String,reflect:!0})],g.prototype,"name");u([c({type:Boolean,reflect:!0})],g.prototype,"required");u([c({type:Boolean,reflect:!0})],g.prototype,"disabled");u([c({type:String,reflect:!0})],g.prototype,"placeholder");u([c({type:Number,reflect:!0})],g.prototype,"min");u([c({type:Number,reflect:!0})],g.prototype,"max");u([c({type:Number,reflect:!0})],g.prototype,"minlength");u([c({type:Number,reflect:!0})],g.prototype,"maxlength");u([c({type:String,reflect:!0})],g.prototype,"pattern");u([c({type:Boolean,reflect:!0})],g.prototype,"optionalTag");u([c({type:String,reflect:!0})],g.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],g.prototype,"requiredTag");u([c({type:String,reflect:!0})],g.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],g.prototype,"hasError");u([c({type:String,reflect:!0})],g.prototype,"errorMessage");u([At()],g.prototype,"touched");exports.E=d;exports.PktElement=X;exports.PktInputElement=g;exports.T=w;exports.Z=kt;exports.n=c;exports.r=At;exports.translations=y;exports.v4=bt;exports.x=Nt;
@@ -1,8 +1,8 @@
1
- import { r as k, P as $, x as y, E as v, n as c } from "./index-CsTujnXs.js";
1
+ import { r as k, P as $, x as y, E as w, n as d } from "./index-d6Lj2RhC.js";
2
2
  import { a as S } from "./converters-DNCwIFwr.js";
3
3
  import { t as A } from "./directive-Cxhakbpr.js";
4
- import { e as _ } from "./class-map-DunDFQn7.js";
5
- import "./index-CyqOyy_9.js";
4
+ import { e as _ } from "./class-map-CC5YmUWA.js";
5
+ import "./index-CBp5twsn.js";
6
6
  function D(e) {
7
7
  const t = Object.prototype.toString.call(e);
8
8
  return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
@@ -10,50 +10,50 @@ function D(e) {
10
10
  function M(e, t) {
11
11
  return e instanceof Date ? new e.constructor(t) : new Date(t);
12
12
  }
13
- const I = 6048e5, U = 864e5;
13
+ const I = 6048e5, j = 864e5;
14
14
  let T = {};
15
15
  function O() {
16
16
  return T;
17
17
  }
18
- function b(e, t) {
19
- var d, h, f, u;
20
- const s = O(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? s.weekStartsOn ?? ((u = (f = s.locale) == null ? void 0 : f.options) == null ? void 0 : u.weekStartsOn) ?? 0, i = D(e), o = i.getDay(), a = (o < n ? 7 : 0) + o - n;
21
- return i.setDate(i.getDate() - a), i.setHours(0, 0, 0, 0), i;
18
+ function v(e, t) {
19
+ var h, a, p, f;
20
+ const s = O(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((a = (h = t == null ? void 0 : t.locale) == null ? void 0 : h.options) == null ? void 0 : a.weekStartsOn) ?? s.weekStartsOn ?? ((f = (p = s.locale) == null ? void 0 : p.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = D(e), c = i.getDay(), o = (c < n ? 7 : 0) + c - n;
21
+ return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
22
22
  }
23
23
  function x(e, t) {
24
24
  const s = D(e.start), n = D(e.end);
25
25
  let i = +s > +n;
26
- const o = i ? +s : +n, a = i ? n : s;
27
- a.setHours(0, 0, 0, 0);
28
- let d = 1;
29
- const h = [];
30
- for (; +a <= o; )
31
- h.push(D(a)), a.setDate(a.getDate() + d), a.setHours(0, 0, 0, 0);
32
- return i ? h.reverse() : h;
33
- }
34
- function C(e, t) {
35
- var u, p, m, w;
36
- const s = D(e), n = s.getFullYear(), i = O(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((p = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : p.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((w = (m = i.locale) == null ? void 0 : m.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, a = M(e, 0);
37
- a.setFullYear(n + 1, 0, o), a.setHours(0, 0, 0, 0);
38
- const d = b(a, t), h = M(e, 0);
39
- h.setFullYear(n, 0, o), h.setHours(0, 0, 0, 0);
40
- const f = b(h, t);
41
- return s.getTime() >= d.getTime() ? n + 1 : s.getTime() >= f.getTime() ? n : n - 1;
26
+ const c = i ? +s : +n, o = i ? n : s;
27
+ o.setHours(0, 0, 0, 0);
28
+ let h = 1;
29
+ const a = [];
30
+ for (; +o <= c; )
31
+ a.push(D(o)), o.setDate(o.getDate() + h), o.setHours(0, 0, 0, 0);
32
+ return i ? a.reverse() : a;
42
33
  }
43
34
  function E(e, t) {
44
- var d, h, f, u;
45
- const s = O(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? s.firstWeekContainsDate ?? ((u = (f = s.locale) == null ? void 0 : f.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1, i = C(e, t), o = M(e, 0);
46
- return o.setFullYear(i, 0, n), o.setHours(0, 0, 0, 0), b(o, t);
35
+ var f, u, m, b;
36
+ const s = D(e), n = s.getFullYear(), i = O(), c = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : u.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((b = (m = i.locale) == null ? void 0 : m.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, o = M(e, 0);
37
+ o.setFullYear(n + 1, 0, c), o.setHours(0, 0, 0, 0);
38
+ const h = v(o, t), a = M(e, 0);
39
+ a.setFullYear(n, 0, c), a.setHours(0, 0, 0, 0);
40
+ const p = v(a, t);
41
+ return s.getTime() >= h.getTime() ? n + 1 : s.getTime() >= p.getTime() ? n : n - 1;
42
+ }
43
+ function C(e, t) {
44
+ var h, a, p, f;
45
+ const s = O(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((a = (h = t == null ? void 0 : t.locale) == null ? void 0 : h.options) == null ? void 0 : a.firstWeekContainsDate) ?? s.firstWeekContainsDate ?? ((f = (p = s.locale) == null ? void 0 : p.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = E(e, t), c = M(e, 0);
46
+ return c.setFullYear(i, 0, n), c.setHours(0, 0, 0, 0), v(c, t);
47
47
  }
48
- function H(e, t) {
49
- const s = D(e), n = +b(s, t) - +E(s, t);
48
+ function N(e, t) {
49
+ const s = D(e), n = +v(s, t) - +C(s, t);
50
50
  return Math.round(n / I) + 1;
51
51
  }
52
- function R(e) {
52
+ function H(e) {
53
53
  let s = D(e).getDay();
54
54
  return s === 0 && (s = 7), s;
55
55
  }
56
- const N = "pkt-calendar", P = {
56
+ const R = "pkt-calendar", P = {
57
57
  id: {
58
58
  type: "string",
59
59
  name: "ID",
@@ -135,14 +135,14 @@ const N = "pkt-calendar", P = {
135
135
  description: "Returns ISO formatted date string"
136
136
  }
137
137
  }, g = {
138
- name: N,
138
+ name: R,
139
139
  "css-class": "pkt-calendar",
140
140
  props: P,
141
141
  events: W
142
142
  };
143
143
  var Y = Object.defineProperty, F = Object.getOwnPropertyDescriptor, l = (e, t, s, n) => {
144
- for (var i = n > 1 ? void 0 : n ? F(t, s) : t, o = e.length - 1, a; o >= 0; o--)
145
- (a = e[o]) && (i = (n ? a(t, s, i) : a(i)) || i);
144
+ for (var i = n > 1 ? void 0 : n ? F(t, s) : t, c = e.length - 1, o; c >= 0; c--)
145
+ (o = e[c]) && (i = (n ? o(t, s, i) : o(i)) || i);
146
146
  return n && i && Y(t, s, i), i;
147
147
  };
148
148
  let r = class extends $ {
@@ -206,19 +206,21 @@ let r = class extends $ {
206
206
  }
207
207
  }
208
208
  handleArrowKey(e, t) {
209
+ var i, c, o;
210
+ if (((i = e.target) == null ? void 0 : i.nodeName) === "INPUT" || ((c = e.target) == null ? void 0 : c.nodeName) === "SELECT" || ((o = e.target) == null ? void 0 : o.nodeName) === "BUTTON") return;
209
211
  e.preventDefault(), this.focusedDate || this.focusOnCurrentDate();
210
212
  const s = this.focusedDate ? new Date(this.focusedDate) : new Date(this.year, this.month, 1);
211
213
  let n = new Date(s.setDate(s.getDate() + t));
212
214
  if (n) {
213
- let i = this.querySelector(`div[data-date="${this.formatISODate(n)}"]`);
214
- if (i instanceof HTMLDivElement) {
215
- if (i.dataset.disabled) {
216
- let o = new Date(s.setDate(s.getDate() + t)), a = this.querySelector(`div[data-date="${this.formatISODate(o)}"]`);
217
- for (; a && a instanceof HTMLDivElement && a.dataset.disabled; )
218
- o = new Date(o.setDate(o.getDate() + t)), a = this.querySelector(`div[data-date="${this.formatISODate(o)}"]`);
219
- i = a;
215
+ let h = this.querySelector(`div[data-date="${this.formatISODate(n)}"]`);
216
+ if (h instanceof HTMLDivElement) {
217
+ if (h.dataset.disabled) {
218
+ let a = new Date(s.setDate(s.getDate() + t)), p = this.querySelector(`div[data-date="${this.formatISODate(a)}"]`);
219
+ for (; p && p instanceof HTMLDivElement && p.dataset.disabled; )
220
+ a = new Date(a.setDate(a.getDate() + t)), p = this.querySelector(`div[data-date="${this.formatISODate(a)}"]`);
221
+ h = p;
220
222
  }
221
- i instanceof HTMLDivElement && !i.dataset.disabled && (this.focusedDate = this.formatISODate(n), i.focus());
223
+ h instanceof HTMLDivElement && !h.dataset.disabled && (this.focusedDate = this.formatISODate(n), h.focus());
222
224
  }
223
225
  }
224
226
  }
@@ -228,7 +230,7 @@ let r = class extends $ {
228
230
  render() {
229
231
  return y`
230
232
  <div
231
- class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : v}"
233
+ class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : w}"
232
234
  @focusout=${this.closeEvent}
233
235
  @keydown=${(e) => {
234
236
  e.key === "Escape" && (e.preventDefault(), this.close());
@@ -236,35 +238,37 @@ let r = class extends $ {
236
238
  >
237
239
  <nav class="pkt-cal-month-nav">
238
240
  <div>
239
- <div
241
+ <button
242
+ type="button"
240
243
  @click=${this.isPrevMonthAllowed() && this.prevMonth}
241
244
  @keydown=${(e) => {
242
245
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.isNextMonthAllowed() && this.prevMonth());
243
246
  }}
244
247
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isPrevMonthAllowed() ? "" : "pkt-hide"}"
245
- .data-disabled=${this.isPrevMonthAllowed() ? v : "disabled"}
248
+ .data-disabled=${this.isPrevMonthAllowed() ? w : "disabled"}
246
249
  ?aria-disabled=${!this.isPrevMonthAllowed()}
247
250
  tabindex=${this.isPrevMonthAllowed() ? "0" : "-1"}
248
251
  >
249
252
  <pkt-icon class="pkt-btn__icon" name="chevron-thin-left"></pkt-icon>
250
253
  <span class="pkt-btn__text">${this.prevMonthString}</span>
251
- </div>
254
+ </button>
252
255
  </div>
253
256
  ${this.renderMonthNav()}
254
257
  <div>
255
- <div
258
+ <button
259
+ type="button"
256
260
  @click=${this.isNextMonthAllowed() && this.nextMonth}
257
261
  @keydown=${(e) => {
258
262
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.isNextMonthAllowed() && this.nextMonth());
259
263
  }}
260
264
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isNextMonthAllowed() ? "" : "pkt-hide"}"
261
- .data-disabled=${this.isNextMonthAllowed() ? v : "disabled"}
265
+ .data-disabled=${this.isNextMonthAllowed() ? w : "disabled"}
262
266
  ?aria-disabled=${!this.isNextMonthAllowed()}
263
267
  tabindex=${this.isNextMonthAllowed() ? "0" : "-1"}
264
268
  >
265
269
  <pkt-icon class="pkt-btn__icon" name="chevron-thin-right"></pkt-icon>
266
270
  <span class="pkt-btn__text">${this.nextMonthString}</span>
267
- </div>
271
+ </button>
268
272
  </div>
269
273
  </nav>
270
274
  <table
@@ -290,8 +294,10 @@ let r = class extends $ {
290
294
  let e = [];
291
295
  return this.withcontrols ? e.push(
292
296
  y`<div class="pkt-cal-month-picker">
297
+ <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
293
298
  <select
294
299
  class="pkt-input pkt-input-compact"
300
+ id="${this.id}-monthnav"
295
301
  @change=${(t) => {
296
302
  this.changeMonth(this.year, t.target.value);
297
303
  }}
@@ -300,8 +306,10 @@ let r = class extends $ {
300
306
  (t, s) => y`<option value=${s} ?selected=${this.month === s}>${t}</option>`
301
307
  )}
302
308
  </select>
309
+ <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
303
310
  <input
304
311
  class="pkt-input pkt-cal-input-year pkt-input-compact"
312
+ id="${this.id}-yearnav"
305
313
  type="number"
306
314
  size="4"
307
315
  placeholder="0000"
@@ -318,35 +326,35 @@ let r = class extends $ {
318
326
  ), e;
319
327
  }
320
328
  renderDayView(e, t, s) {
321
- var u;
322
- const n = new Date(this.year, this.month, e, 12), i = this.formatISODate(n), o = i === this.formatISODate(t), a = this.selected.includes(i), d = this.isExcluded(s, n) || !a && this.multiple && this.maxMultiple > 0 && this.selected.length >= this.maxMultiple, h = this.focusedDate ? this.focusedDate === i && !d ? "0" : "-1" : !d && this.tabIndexSet === 0 || this.tabIndexSet === e ? "0" : "-1";
323
- h === "0" && (this.tabIndexSet = e), this.selectableDates.push({ currentDateISO: i, isDisabled: d, tabindex: h });
324
- const f = {
325
- "pkt-cal-today": o,
326
- "pkt-cal-selected": a,
329
+ var f;
330
+ const n = new Date(this.year, this.month, e, 12), i = this.formatISODate(n), c = i === this.formatISODate(t), o = this.selected.includes(i), h = this.isExcluded(s, n) || !o && this.multiple && this.maxMultiple > 0 && this.selected.length >= this.maxMultiple, a = this.focusedDate ? this.focusedDate === i && !h ? "0" : "-1" : !h && this.tabIndexSet === 0 || this.tabIndexSet === e ? "0" : "-1";
331
+ a === "0" && (this.tabIndexSet = e), this.selectableDates.push({ currentDateISO: i, isDisabled: h, tabindex: a });
332
+ const p = {
333
+ "pkt-cal-today": c,
334
+ "pkt-cal-selected": o,
327
335
  "pkt-cal-in-range": this.inRange[i],
328
336
  "pkt-cal-excluded": this.isExcluded(s, n),
329
337
  "pkt-cal-in-range-first": this.range && (this.selected.length === 2 || this.rangeHovered !== null) && i === this.selected[0],
330
338
  "pkt-cal-in-range-last": this.range && this.selected.length === 2 && i === this.selected[1],
331
339
  "pkt-cal-range-hover": this.rangeHovered !== null && i === this.formatISODate(this.rangeHovered)
332
340
  };
333
- return y`<td class=${_(f)}>
341
+ return y`<td class=${_(p)}>
334
342
  <div
335
- ?aria-selected=${a}
343
+ ?aria-selected=${o}
336
344
  role="gridcell"
337
345
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
338
346
  @mouseover=${() => this.range && !this.isExcluded(s, n) && this.handleRangeHover(n)}
339
347
  @focus=${() => {
340
348
  this.range && !this.isExcluded(s, n) && this.handleRangeHover(n), this.focusedDate = i;
341
349
  }}
342
- tabindex=${(u = this.selectableDates.find((p) => p.currentDateISO === i)) == null ? void 0 : u.tabindex}
343
- data-disabled=${d ? "disabled" : v}
350
+ tabindex=${(f = this.selectableDates.find((u) => u.currentDateISO === i)) == null ? void 0 : f.tabindex}
351
+ data-disabled=${h ? "disabled" : w}
344
352
  data-date=${i}
345
- @keydown=${(p) => {
346
- (p.key === "Enter" || p.key === " ") && (p.preventDefault(), this.handleDateSelect(n));
353
+ @keydown=${(u) => {
354
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), this.handleDateSelect(n));
347
355
  }}
348
- @click=${(p) => {
349
- d || (p.preventDefault(), this.handleDateSelect(n));
356
+ @click=${(u) => {
357
+ h || (u.preventDefault(), this.handleDateSelect(n));
350
358
  }}
351
359
  >
352
360
  <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
@@ -354,43 +362,43 @@ let r = class extends $ {
354
362
  </td>`;
355
363
  }
356
364
  renderCalendarBody() {
357
- const e = /* @__PURE__ */ new Date(), t = new Date(this.year, this.month, 1, 12), s = new Date(this.year, this.month + 1, 0, 12), n = (t.getDay() + 6) % 7, i = s.getDate(), o = Math.ceil((i + n) / 7), d = new Date(this.year, this.month, 0, 12).getDate();
358
- let h = 1;
359
- this.week = H(new Date(this.year, this.month, 1, 12));
360
- const f = [];
361
- for (let u = 0; u < o; u++) {
362
- const p = [];
363
- this.weeknumbers && p.push(y`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
365
+ const e = /* @__PURE__ */ new Date(), t = new Date(this.year, this.month, 1, 12), s = new Date(this.year, this.month + 1, 0, 12), n = (t.getDay() + 6) % 7, i = s.getDate(), c = Math.ceil((i + n) / 7), h = new Date(this.year, this.month, 0, 12).getDate();
366
+ let a = 1;
367
+ this.week = N(new Date(this.year, this.month, 1, 12));
368
+ const p = [];
369
+ for (let f = 0; f < c; f++) {
370
+ const u = [];
371
+ this.weeknumbers && u.push(y`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
364
372
  for (let m = 1; m < 8; m++)
365
- if (u === 0 && m < n + 1) {
366
- const w = d - (n - m);
367
- p.push(
373
+ if (f === 0 && m < n + 1) {
374
+ const b = h - (n - m);
375
+ u.push(
368
376
  y`<td class="pkt-cal-other">
369
377
  <div
370
378
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
371
379
  data-disabled="disabled"
372
380
  >
373
- <span class="pkt-btn__text pkt-txt-14-light">${w}</span>
381
+ <span class="pkt-btn__text pkt-txt-14-light">${b}</span>
374
382
  </div>
375
383
  </td>`
376
384
  );
377
- } else h > i ? (p.push(
385
+ } else a > i ? (u.push(
378
386
  y`<td class="pkt-cal-other">
379
387
  <div
380
388
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
381
389
  data-disabled="disabled"
382
390
  >
383
- <span class="pkt-btn__text pkt-txt-14-light">${h - i}</span>
391
+ <span class="pkt-btn__text pkt-txt-14-light">${a - i}</span>
384
392
  </div>
385
393
  </td>`
386
- ), h++) : (p.push(this.renderDayView(h, e, m)), h++);
387
- f.push(
394
+ ), a++) : (u.push(this.renderDayView(a, e, m)), a++);
395
+ p.push(
388
396
  y`<tr class="pkt-cal-week-row" role="row">
389
- ${p}
397
+ ${u}
390
398
  </tr>`
391
399
  );
392
400
  }
393
- return f;
401
+ return p;
394
402
  }
395
403
  isExcluded(e, t) {
396
404
  return this.excludeweekdays.includes(e.toString()) || this.earliest && t < new Date(this.earliest) || this.latest && t > new Date(this.latest) ? !0 : this.excludedates.some((s) => typeof s == "string" ? s === this.formatISODate(t) : s.toDateString() === t.toDateString());
@@ -435,7 +443,7 @@ let r = class extends $ {
435
443
  for (let n = 0; n < s.length; n++)
436
444
  this.excludedates.forEach((i) => {
437
445
  i > this._selected[0] && i < e && (t = !1);
438
- }), this.excludeweekdays.includes(R(s[n]).toString()) && (t = !1);
446
+ }), this.excludeweekdays.includes(H(s[n]).toString()) && (t = !1);
439
447
  }
440
448
  return t;
441
449
  }
@@ -512,67 +520,67 @@ let r = class extends $ {
512
520
  }
513
521
  };
514
522
  l([
515
- c({ type: Boolean })
523
+ d({ type: Boolean })
516
524
  ], r.prototype, "multiple", 2);
517
525
  l([
518
- c({ type: Number })
526
+ d({ type: Number })
519
527
  ], r.prototype, "maxMultiple", 2);
520
528
  l([
521
- c({ type: Boolean })
529
+ d({ type: Boolean })
522
530
  ], r.prototype, "range", 2);
523
531
  l([
524
- c({ type: Boolean })
532
+ d({ type: Boolean })
525
533
  ], r.prototype, "weeknumbers", 2);
526
534
  l([
527
- c({ type: Boolean })
535
+ d({ type: Boolean })
528
536
  ], r.prototype, "withcontrols", 2);
529
537
  l([
530
- c({ converter: S.csvToArray })
538
+ d({ converter: S.csvToArray })
531
539
  ], r.prototype, "selected", 2);
532
540
  l([
533
- c({ type: String })
541
+ d({ type: String })
534
542
  ], r.prototype, "earliest", 2);
535
543
  l([
536
- c({ type: String })
544
+ d({ type: String })
537
545
  ], r.prototype, "latest", 2);
538
546
  l([
539
- c({ converter: S.stringsToDate })
547
+ d({ converter: S.stringsToDate })
540
548
  ], r.prototype, "excludedates", 2);
541
549
  l([
542
- c({ converter: S.csvToArray })
550
+ d({ converter: S.csvToArray })
543
551
  ], r.prototype, "excludeweekdays", 2);
544
552
  l([
545
- c({ converter: S.stringToDate })
553
+ d({ converter: S.stringToDate })
546
554
  ], r.prototype, "currentmonth", 2);
547
555
  l([
548
- c({ type: Array })
556
+ d({ type: Array })
549
557
  ], r.prototype, "dayStrings", 2);
550
558
  l([
551
- c({ type: Array })
559
+ d({ type: Array })
552
560
  ], r.prototype, "monthStrings", 2);
553
561
  l([
554
- c({ type: String })
562
+ d({ type: String })
555
563
  ], r.prototype, "weekString", 2);
556
564
  l([
557
- c({ type: String })
565
+ d({ type: String })
558
566
  ], r.prototype, "prevMonthString", 2);
559
567
  l([
560
- c({ type: String })
568
+ d({ type: String })
561
569
  ], r.prototype, "nextMonthString", 2);
562
570
  l([
563
- c({ type: Array })
571
+ d({ type: Array })
564
572
  ], r.prototype, "_selected", 2);
565
573
  l([
566
- c({ type: Number })
574
+ d({ type: Number })
567
575
  ], r.prototype, "year", 2);
568
576
  l([
569
- c({ type: Number })
577
+ d({ type: Number })
570
578
  ], r.prototype, "month", 2);
571
579
  l([
572
- c({ type: Number })
580
+ d({ type: Number })
573
581
  ], r.prototype, "week", 2);
574
582
  l([
575
- c({ type: Date })
583
+ d({ type: Date })
576
584
  ], r.prototype, "rangeHovered", 2);
577
585
  l([
578
586
  k()
@@ -595,11 +603,11 @@ r = l([
595
603
  export {
596
604
  r as P,
597
605
  I as a,
598
- H as b,
606
+ N as b,
599
607
  M as c,
600
608
  O as d,
601
- C as g,
602
- U as m,
603
- b as s,
609
+ E as g,
610
+ j as m,
611
+ v as s,
604
612
  D as t
605
613
  };