@oslokommune/punkt-elements 12.17.0 → 12.17.2
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.
- package/dist/{class-map-d4EVPLBg.js → class-map-CBvUV2N3.js} +1 -1
- package/dist/{class-map-C92zObAn.cjs → class-map-a5HUzP83.cjs} +1 -1
- package/dist/{helptext-P1rM1x3p.js → helptext-DBolvFI4.js} +3 -3
- package/dist/{helptext-CquaEC6K.cjs → helptext-_fMLOOCL.cjs} +1 -1
- package/dist/{index-BXyp3qCS.js → index-CFDwiDTU.js} +349 -337
- package/dist/{index-BsgcXRmM.cjs → index-CR7t1zY9.cjs} +29 -29
- package/dist/{index-D2toJo-e.cjs → index-CmTjXoAb.cjs} +1 -1
- package/dist/{index-CPB5TLrS.js → index-D2jSRMrn.js} +6 -6
- package/dist/{index-BPPtpQWt.js → index-RwtTBIhT.js} +1 -1
- package/dist/{index-BPXZmGWV.cjs → index-tvpcg-ad.cjs} +4 -4
- package/dist/index.d.ts +5 -0
- package/dist/{input-wrapper-BbLHt2GC.js → input-wrapper-6vTrKtsW.js} +5 -5
- package/dist/{input-wrapper-Bv0JBG3z.cjs → input-wrapper-DX41tnbj.cjs} +1 -1
- package/dist/{linkcard-Gc0adgx0.js → linkcard-BlWQ8jOv.js} +3 -3
- package/dist/{linkcard-nkS6ET7M.cjs → linkcard-Det6CJ5D.cjs} +1 -1
- package/dist/{modal-Dq7JVtPA.js → modal-3OZTPqee.js} +4 -4
- package/dist/{modal-D_7T-rg0.cjs → modal-DYTVJjYh.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +4 -5
- package/dist/pkt-datepicker.js +52 -53
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +8 -8
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +4 -4
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{ref-DPUgHtT0.cjs → ref-C2yPtMJA.cjs} +1 -1
- package/dist/{ref-B5hXBqpP.js → ref-CaiKp3S2.js} +1 -1
- package/dist/{textarea-DpLTy6XT.cjs → textarea-B45ZZYpx.cjs} +6 -3
- package/dist/{textarea-oZpJKjwI.js → textarea-BTpJjEhO.js} +25 -22
- package/dist/{textinput-BD4p3Biy.cjs → textinput-BIhQEr8z.cjs} +7 -3
- package/dist/{textinput-ToIpNAvm.js → textinput-CVo5wG14.js} +63 -56
- package/package.json +3 -3
- package/src/components/calendar/index.ts +4 -4
- package/src/components/datepicker/index.ts +3 -4
- package/src/components/element/index.ts +20 -0
- package/src/components/textarea/textarea.ts +6 -3
- package/src/components/textinput/textinput.ts +10 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-CR7t1zY9.cjs"),r=require("./custom-element-B-TlBwRu.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as _, P as ht, x as D, E as I, n as m } from "./index-
|
|
1
|
+
import { r as _, P as ht, x as D, E as I, n as m } from "./index-CFDwiDTU.js";
|
|
2
2
|
import { a as L } from "./converters-DNCwIFwr.js";
|
|
3
3
|
import { t as dt } from "./custom-element-CWfU4dcr.js";
|
|
4
|
-
import { e as ft } from "./class-map-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { e as ft } from "./class-map-CBvUV2N3.js";
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
const at = 6048e5, mt = 864e5, gt = 36e5, X = Symbol.for("constructDateFrom");
|
|
7
7
|
function S(t, e) {
|
|
8
8
|
return typeof t == "function" ? t(e) : t && typeof t == "object" && X in t ? t[X](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
@@ -1642,7 +1642,7 @@ let u = class extends ht {
|
|
|
1642
1642
|
class="pkt-input pkt-input-compact"
|
|
1643
1643
|
id="${this.id}-monthnav"
|
|
1644
1644
|
@change=${(e) => {
|
|
1645
|
-
this.changeMonth(this.year, e.target.value);
|
|
1645
|
+
e.stopImmediatePropagation(), this.changeMonth(this.year, e.target.value);
|
|
1646
1646
|
}}
|
|
1647
1647
|
>
|
|
1648
1648
|
${this.monthStrings.map(
|
|
@@ -1658,7 +1658,7 @@ let u = class extends ht {
|
|
|
1658
1658
|
size="4"
|
|
1659
1659
|
placeholder="0000"
|
|
1660
1660
|
@change=${(e) => {
|
|
1661
|
-
this.changeMonth(e.target.value, this.month);
|
|
1661
|
+
e.stopImmediatePropagation(), this.changeMonth(e.target.value, this.month);
|
|
1662
1662
|
}}
|
|
1663
1663
|
.value=${this.year}
|
|
1664
1664
|
/>
|
|
@@ -1769,7 +1769,7 @@ let u = class extends ht {
|
|
|
1769
1769
|
this.changeMonth(e, t);
|
|
1770
1770
|
}
|
|
1771
1771
|
changeMonth(t, e) {
|
|
1772
|
-
this.year = t, this.month = e, this.tabIndexSet = 0, this.focusedDate = null, this.selectableDates = []
|
|
1772
|
+
this.year = typeof t == "string" ? parseInt(t) : t, this.month = typeof e == "string" ? parseInt(e) : e, this.tabIndexSet = 0, this.focusedDate = null, this.selectableDates = [];
|
|
1773
1773
|
}
|
|
1774
1774
|
isInRange(t) {
|
|
1775
1775
|
if (this.range && this.selected.length === 2) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./index-BsgcXRmM.cjs"),H=require("./converters-DhM11VlY.cjs"),ot=require("./custom-element-B-TlBwRu.cjs"),ct=require("./class-map-C92zObAn.cjs");require("./index-D2toJo-e.cjs");const tt=6048e5,lt=864e5,ut=36e5,B=Symbol.for("constructDateFrom");function D(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&B in n?n[B](t):n instanceof Date?new n.constructor(t):new Date(t)}function v(n,t){return D(t||n,n)}function q(n,t,e){const r=v(n,e==null?void 0:e.in);return isNaN(t)?D(n,NaN):(t&&r.setDate(r.getDate()+t),r)}function ht(n,t,e){return D(n,+v(n)+t)}function $(n,t,e){return ht(n,t*ut)}let dt={};function _(){return dt}function A(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,a=v(n,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(n,t){return A(n,{...t,weekStartsOn:1})}function et(n,t){const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=D(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=F(a),i=D(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=F(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=c.getTime()?r:r-1}function Q(n){const t=v(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function nt(n,...t){const e=D.bind(null,t.find(r=>typeof r=="object"));return t.map(e)}function j(n,t){const e=v(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function ft(n,t,e){const[r,a]=nt(e==null?void 0:e.in,n,t),s=j(r),i=j(a),c=+s-Q(s),l=+i-Q(i);return Math.round((c-l)/lt)}function mt(n,t){const e=et(n,t),r=D(n,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),F(r)}function gt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function yt(n){return!(!gt(n)&&typeof n!="number"||isNaN(+v(n)))}function pt(n,t){const[e,r]=nt(n,t.start,t.end);return{start:e,end:r}}function L(n,t){const{start:e,end:r}=pt(t==null?void 0:t.in,n);let a=+e>+r;const s=a?+e:+r,i=a?r:e;i.setHours(0,0,0,0);let c=1;const l=[];for(;+i<=s;)l.push(D(e,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return a?l.reverse():l}function wt(n,t){const e=v(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const bt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kt=(n,t,e)=>{let r;const a=bt[n];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function R(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const vt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mt={date:R({formats:vt,defaultWidth:"full"}),time:R({formats:Dt,defaultWidth:"full"}),dateTime:R({formats:St,defaultWidth:"full"})},xt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tt=(n,t,e,r)=>xt[n];function E(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(t):t;return a[s]}}const Pt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ot={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ct={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Nt=(n,t)=>{const e=Number(n),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Yt={ordinalNumber:Nt,era:E({values:Pt,defaultWidth:"wide"}),quarter:E({values:Ot,defaultWidth:"wide",argumentCallback:n=>n-1}),month:E({values:Ct,defaultWidth:"wide"}),day:E({values:$t,defaultWidth:"wide"}),dayPeriod:E({values:Et,defaultWidth:"wide",formattingValues:Wt,defaultFormattingWidth:"wide"})};function W(n){return(t,e={})=>{const r=e.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?Ft(c,p=>p.test(i)):At(c,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function At(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ft(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Ht(n){return(t,e={})=>{const r=t.match(n.matchPattern);if(!r)return null;const a=r[0],s=t.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=t.slice(a.length);return{value:i,rest:c}}}const _t=/^(\d+)(th|st|nd|rd)?/i,It=/\d+/i,qt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lt={any:[/^b/i,/^(a|c)/i]},Rt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ut={any:[/1/i,/2/i,/3/i,/4/i]},zt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vt={ordinalNumber:Ht({matchPattern:_t,parsePattern:It,valueCallback:n=>parseInt(n,10)}),era:W({matchPatterns:qt,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any"}),quarter:W({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:Ut,defaultParseWidth:"any",valueCallback:n=>n+1}),month:W({matchPatterns:zt,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:W({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:jt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Gt,defaultMatchWidth:"any",parsePatterns:Xt,defaultParseWidth:"any"})},Jt={code:"en-US",formatDistance:kt,formatLong:Mt,formatRelative:Tt,localize:Yt,match:Vt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Kt(n,t){const e=v(n,t==null?void 0:t.in);return ft(e,wt(e))+1}function Zt(n,t){const e=v(n,t==null?void 0:t.in),r=+F(e)-+mt(e);return Math.round(r/tt)+1}function rt(n,t){var f,p,w,m;const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=_(),s=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(w=a.locale)==null?void 0:w.options)==null?void 0:m.firstWeekContainsDate)??1,i=D((t==null?void 0:t.in)||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=A(i,t),l=D((t==null?void 0:t.in)||n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=A(l,t);return+e>=+c?r+1:+e>=+u?r:r-1}function te(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=rt(n,t),s=D((t==null?void 0:t.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),A(s,t)}function at(n,t){const e=v(n,t==null?void 0:t.in),r=+A(e,t)-+te(e,t);return Math.round(r/tt)+1}function h(n,t){const e=n<0?"-":"",r=Math.abs(n).toString().padStart(t,"0");return e+r}const x={y(n,t){const e=n.getFullYear(),r=e>0?e:1-e;return h(t==="yy"?r%100:r,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):h(e+1,2)},d(n,t){return h(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return h(n.getHours()%12||12,t.length)},H(n,t){return h(n.getHours(),t.length)},m(n,t){return h(n.getMinutes(),t.length)},s(n,t){return h(n.getSeconds(),t.length)},S(n,t){const e=t.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return h(a,t.length)}},C={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},G={G:function(n,t,e){const r=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return x.y(n,t)},Y:function(n,t,e,r){const a=rt(n,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return h(i,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):h(s,t.length)},R:function(n,t){const e=et(n);return h(e,t.length)},u:function(n,t){const e=n.getFullYear();return h(e,t.length)},Q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return h(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return h(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,t,e){const r=n.getMonth();switch(t){case"M":case"MM":return x.M(n,t);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(n,t,e){const r=n.getMonth();switch(t){case"L":return String(r+1);case"LL":return h(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(n,t,e,r){const a=at(n,r);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):h(a,t.length)},I:function(n,t,e){const r=Zt(n);return t==="Io"?e.ordinalNumber(r,{unit:"week"}):h(r,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):x.d(n,t)},D:function(n,t,e){const r=Kt(n);return t==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):h(r,t.length)},E:function(n,t,e){const r=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return h(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return h(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,t,e){const r=n.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return h(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(n,t,e){const a=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,t,e){const r=n.getHours();let a;switch(r===12?a=C.noon:r===0?a=C.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,t,e){const r=n.getHours();let a;switch(r>=17?a=C.evening:r>=12?a=C.afternoon:r>=4?a=C.morning:a=C.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let r=n.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return x.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):x.H(n,t)},K:function(n,t,e){const r=n.getHours()%12;return t==="Ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},k:function(n,t,e){let r=n.getHours();return r===0&&(r=24),t==="ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):x.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):x.s(n,t)},S:function(n,t){return x.S(n,t)},X:function(n,t,e){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return V(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"x":return V(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+X(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+X(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(n,t,e){const r=Math.trunc(+n/1e3);return h(r,t.length)},T:function(n,t,e){return h(+n,t.length)}};function X(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+t+h(s,2)}function V(n,t){return n%60===0?(n>0?"-":"+")+h(Math.abs(n)/60,2):O(n,t)}function O(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=h(Math.trunc(r/60),2),s=h(r%60,2);return e+a+t+s}const J=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},st=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ee=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return J(n,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",J(r,t)).replace("{{time}}",st(a,t))},ne={p:st,P:ee},re=/^D+$/,ae=/^Y+$/,se=["D","DD","YY","YYYY"];function ie(n){return re.test(n)}function oe(n){return ae.test(n)}function ce(n,t,e){const r=le(n,t,e);if(console.warn(r),se.includes(n))throw new RangeError(r)}function le(n,t,e){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,de=/^'([^]*?)'?$/,fe=/''/g,me=/[a-zA-Z]/;function ge(n,t,e){var f,p,w,m;const r=_(),a=r.locale??Jt,s=r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(w=r.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,c=v(n,e==null?void 0:e.in);if(!yt(c))throw new RangeError("Invalid time value");let l=t.match(he).map(g=>{const k=g[0];if(k==="p"||k==="P"){const I=ne[k];return I(g,a.formatLong)}return g}).join("").match(ue).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:ye(g)};if(G[k])return{isToken:!0,value:g};if(k.match(me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(c,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const k=g.value;(oe(k)||ie(k))&&ce(k,t,String(n));const I=G[k[0]];return I(c,k,a.localize,u)}).join("")}function ye(n){const t=n.match(de);return t?t[1].replace(fe,"'"):n}function pe(n,t){const e=v(n,t==null?void 0:t.in).getDay();return e===0?7:e}const U={},N={};function Y(n,t){try{const r=(U[n]||(U[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in N?N[r]:K(r,r.split(":"))}catch{if(n in N)return N[n];const e=n==null?void 0:n.match(we);return e?K(n,e.slice(1)):NaN}}const we=/([+-]\d\d):?(\d\d)?/;function K(n,t){const e=+t[0],r=+(t[1]||0);return N[n]=e>0?e*60+r:e*60-r}class S extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Y(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),it(this),z(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new S(...e,t):new S(Date.now(),t)}withTimeZone(t){return new S(+this,t)}getTimezoneOffset(){return-Y(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),z(this),+this}[Symbol.for("constructDateFrom")](t){return new S(+new Date(t),this.timeZone)}}const Z=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!Z.test(n))return;const t=n.replace(Z,"$1UTC");S.prototype[t]&&(n.startsWith("get")?S.prototype[n]=function(){return this.internal[t]()}:(S.prototype[n]=function(){return Date.prototype[t].apply(this.internal,arguments),be(this),+this},S.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),z(this),+this}))});function z(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function be(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),it(n)}function it(n){const t=Y(n.timeZone,n),e=new Date(+n);e.setUTCHours(e.getUTCHours()-1);const r=-new Date(+n).getTimezoneOffset(),a=-new Date(+e).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();s&&i&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+s);const c=r-t;c&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+c);const l=Y(n.timeZone,n),f=-new Date(+n).getTimezoneOffset()-l,p=l!==t,w=f-c;if(p&&w){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+w);const m=Y(n.timeZone,n),g=l-m;g&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+g))}}class M extends S{static tz(t,...e){return e.length?new M(...e,t):new M(Date.now(),t)}toISOString(){const[t,e,r]=this.tzComponents(),a=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,r,a]=this.tzComponents();return`${t} GMT${e}${r}${a} (${ke(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}function ke(n,t){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(t).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const y=n=>n.toISOString().split("T")[0],ve=n=>{if(!n)return null;const t=$(new M(n,window.pktTz),12);return isNaN(t.getTime())?null:t},De=(n,t)=>{const e=b(n);return isNaN(e.getTime())?"":ge(e,t)},b=(n="")=>$(n===""||!n?new M(new Date,window.pktTz):new M(n,window.pktTz),12),T=(n,t,e=1)=>$(new M(n,t,e,window.pktTz),12),Se=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),Me="pkt-calendar",xe={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},Te={"date-selected":{description:"Returns ISO formatted date string"}},P={name:Me,"css-class":"pkt-calendar",props:xe,events:Te};var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,d=(n,t,e,r)=>{for(var a=r>1?void 0:r?Oe(t,e):t,s=n.length-1,i;s>=0;s--)(i=n[s])&&(a=(r?i(t,e,a):i(a))||a);return r&&a&&Pe(t,e,a),a};exports.PktCalendar=class extends o.PktElement{constructor(){super(...arguments),this.multiple=P.props.multiple.default,this.maxMultiple=P.props.maxMultiple.default,this.range=P.props.range.default,this.weeknumbers=P.props.weeknumbers.default,this.withcontrols=P.props.withcontrols.default,this.selected=[],this.earliest=P.props.earliest.default,this.latest=P.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,e,r)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>b(t)),this.range&&this.selected.length===2){const t=L({start:b(this.selected[0]),end:b(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let r=0;r<t.length;r++)e[y(t[r])]=this.isInRange(t[r]);this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=b(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=b()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,i,c;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((c=t.target)==null?void 0:c.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const r=this.focusedDate?b(this.focusedDate):T(this.year,this.month,1);let a=q(r,e);if(a){let l=this.querySelector(`div[data-date="${y(a)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){a=q(a,e);let u=this.querySelector(`div[data-date="${y(a)}"]`);for(;u&&u instanceof HTMLDivElement&&u.dataset.disabled;)a=q(a,e),u=this.querySelector(`div[data-date="${y(a)}"]`);l=u}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=y(a),l.focus())}}}render(){return o.x`
|
|
1
|
+
"use strict";const o=require("./index-CR7t1zY9.cjs"),H=require("./converters-DhM11VlY.cjs"),ot=require("./custom-element-B-TlBwRu.cjs"),ct=require("./class-map-a5HUzP83.cjs");require("./index-CmTjXoAb.cjs");const tt=6048e5,lt=864e5,ut=36e5,B=Symbol.for("constructDateFrom");function D(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&B in n?n[B](t):n instanceof Date?new n.constructor(t):new Date(t)}function v(n,t){return D(t||n,n)}function q(n,t,e){const r=v(n,e==null?void 0:e.in);return isNaN(t)?D(n,NaN):(t&&r.setDate(r.getDate()+t),r)}function ht(n,t,e){return D(n,+v(n)+t)}function $(n,t,e){return ht(n,t*ut)}let dt={};function I(){return dt}function A(n,t){var c,l,u,f;const e=I(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,a=v(n,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(n,t){return A(n,{...t,weekStartsOn:1})}function et(n,t){const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=D(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=F(a),i=D(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=F(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=c.getTime()?r:r-1}function Q(n){const t=v(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function nt(n,...t){const e=D.bind(null,t.find(r=>typeof r=="object"));return t.map(e)}function j(n,t){const e=v(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function ft(n,t,e){const[r,a]=nt(e==null?void 0:e.in,n,t),s=j(r),i=j(a),c=+s-Q(s),l=+i-Q(i);return Math.round((c-l)/lt)}function mt(n,t){const e=et(n,t),r=D(n,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),F(r)}function gt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function yt(n){return!(!gt(n)&&typeof n!="number"||isNaN(+v(n)))}function pt(n,t){const[e,r]=nt(n,t.start,t.end);return{start:e,end:r}}function L(n,t){const{start:e,end:r}=pt(t==null?void 0:t.in,n);let a=+e>+r;const s=a?+e:+r,i=a?r:e;i.setHours(0,0,0,0);let c=1;const l=[];for(;+i<=s;)l.push(D(e,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return a?l.reverse():l}function wt(n,t){const e=v(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const bt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kt=(n,t,e)=>{let r;const a=bt[n];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function R(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const vt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mt={date:R({formats:vt,defaultWidth:"full"}),time:R({formats:Dt,defaultWidth:"full"}),dateTime:R({formats:St,defaultWidth:"full"})},xt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tt=(n,t,e,r)=>xt[n];function E(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(t):t;return a[s]}}const Pt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ot={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ct={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Nt=(n,t)=>{const e=Number(n),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Yt={ordinalNumber:Nt,era:E({values:Pt,defaultWidth:"wide"}),quarter:E({values:Ot,defaultWidth:"wide",argumentCallback:n=>n-1}),month:E({values:Ct,defaultWidth:"wide"}),day:E({values:$t,defaultWidth:"wide"}),dayPeriod:E({values:Et,defaultWidth:"wide",formattingValues:Wt,defaultFormattingWidth:"wide"})};function W(n){return(t,e={})=>{const r=e.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?Ft(c,p=>p.test(i)):At(c,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function At(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ft(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Ht(n){return(t,e={})=>{const r=t.match(n.matchPattern);if(!r)return null;const a=r[0],s=t.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=t.slice(a.length);return{value:i,rest:c}}}const It=/^(\d+)(th|st|nd|rd)?/i,_t=/\d+/i,qt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lt={any:[/^b/i,/^(a|c)/i]},Rt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ut={any:[/1/i,/2/i,/3/i,/4/i]},zt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vt={ordinalNumber:Ht({matchPattern:It,parsePattern:_t,valueCallback:n=>parseInt(n,10)}),era:W({matchPatterns:qt,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any"}),quarter:W({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:Ut,defaultParseWidth:"any",valueCallback:n=>n+1}),month:W({matchPatterns:zt,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:W({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:jt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Gt,defaultMatchWidth:"any",parsePatterns:Xt,defaultParseWidth:"any"})},Jt={code:"en-US",formatDistance:kt,formatLong:Mt,formatRelative:Tt,localize:Yt,match:Vt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Kt(n,t){const e=v(n,t==null?void 0:t.in);return ft(e,wt(e))+1}function Zt(n,t){const e=v(n,t==null?void 0:t.in),r=+F(e)-+mt(e);return Math.round(r/tt)+1}function rt(n,t){var f,p,w,m;const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=I(),s=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(w=a.locale)==null?void 0:w.options)==null?void 0:m.firstWeekContainsDate)??1,i=D((t==null?void 0:t.in)||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=A(i,t),l=D((t==null?void 0:t.in)||n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=A(l,t);return+e>=+c?r+1:+e>=+u?r:r-1}function te(n,t){var c,l,u,f;const e=I(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=rt(n,t),s=D((t==null?void 0:t.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),A(s,t)}function at(n,t){const e=v(n,t==null?void 0:t.in),r=+A(e,t)-+te(e,t);return Math.round(r/tt)+1}function h(n,t){const e=n<0?"-":"",r=Math.abs(n).toString().padStart(t,"0");return e+r}const x={y(n,t){const e=n.getFullYear(),r=e>0?e:1-e;return h(t==="yy"?r%100:r,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):h(e+1,2)},d(n,t){return h(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return h(n.getHours()%12||12,t.length)},H(n,t){return h(n.getHours(),t.length)},m(n,t){return h(n.getMinutes(),t.length)},s(n,t){return h(n.getSeconds(),t.length)},S(n,t){const e=t.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return h(a,t.length)}},C={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},G={G:function(n,t,e){const r=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return x.y(n,t)},Y:function(n,t,e,r){const a=rt(n,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return h(i,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):h(s,t.length)},R:function(n,t){const e=et(n);return h(e,t.length)},u:function(n,t){const e=n.getFullYear();return h(e,t.length)},Q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return h(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return h(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,t,e){const r=n.getMonth();switch(t){case"M":case"MM":return x.M(n,t);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(n,t,e){const r=n.getMonth();switch(t){case"L":return String(r+1);case"LL":return h(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(n,t,e,r){const a=at(n,r);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):h(a,t.length)},I:function(n,t,e){const r=Zt(n);return t==="Io"?e.ordinalNumber(r,{unit:"week"}):h(r,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):x.d(n,t)},D:function(n,t,e){const r=Kt(n);return t==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):h(r,t.length)},E:function(n,t,e){const r=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return h(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return h(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,t,e){const r=n.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return h(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(n,t,e){const a=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,t,e){const r=n.getHours();let a;switch(r===12?a=C.noon:r===0?a=C.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,t,e){const r=n.getHours();let a;switch(r>=17?a=C.evening:r>=12?a=C.afternoon:r>=4?a=C.morning:a=C.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let r=n.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return x.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):x.H(n,t)},K:function(n,t,e){const r=n.getHours()%12;return t==="Ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},k:function(n,t,e){let r=n.getHours();return r===0&&(r=24),t==="ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):x.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):x.s(n,t)},S:function(n,t){return x.S(n,t)},X:function(n,t,e){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return V(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"x":return V(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+X(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+X(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(n,t,e){const r=Math.trunc(+n/1e3);return h(r,t.length)},T:function(n,t,e){return h(+n,t.length)}};function X(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+t+h(s,2)}function V(n,t){return n%60===0?(n>0?"-":"+")+h(Math.abs(n)/60,2):O(n,t)}function O(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=h(Math.trunc(r/60),2),s=h(r%60,2);return e+a+t+s}const J=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},st=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ee=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return J(n,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",J(r,t)).replace("{{time}}",st(a,t))},ne={p:st,P:ee},re=/^D+$/,ae=/^Y+$/,se=["D","DD","YY","YYYY"];function ie(n){return re.test(n)}function oe(n){return ae.test(n)}function ce(n,t,e){const r=le(n,t,e);if(console.warn(r),se.includes(n))throw new RangeError(r)}function le(n,t,e){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,de=/^'([^]*?)'?$/,fe=/''/g,me=/[a-zA-Z]/;function ge(n,t,e){var f,p,w,m;const r=I(),a=r.locale??Jt,s=r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(w=r.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,c=v(n,e==null?void 0:e.in);if(!yt(c))throw new RangeError("Invalid time value");let l=t.match(he).map(g=>{const k=g[0];if(k==="p"||k==="P"){const _=ne[k];return _(g,a.formatLong)}return g}).join("").match(ue).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:ye(g)};if(G[k])return{isToken:!0,value:g};if(k.match(me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(c,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const k=g.value;(oe(k)||ie(k))&&ce(k,t,String(n));const _=G[k[0]];return _(c,k,a.localize,u)}).join("")}function ye(n){const t=n.match(de);return t?t[1].replace(fe,"'"):n}function pe(n,t){const e=v(n,t==null?void 0:t.in).getDay();return e===0?7:e}const U={},N={};function Y(n,t){try{const r=(U[n]||(U[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in N?N[r]:K(r,r.split(":"))}catch{if(n in N)return N[n];const e=n==null?void 0:n.match(we);return e?K(n,e.slice(1)):NaN}}const we=/([+-]\d\d):?(\d\d)?/;function K(n,t){const e=+t[0],r=+(t[1]||0);return N[n]=e>0?e*60+r:e*60-r}class S extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Y(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),it(this),z(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new S(...e,t):new S(Date.now(),t)}withTimeZone(t){return new S(+this,t)}getTimezoneOffset(){return-Y(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),z(this),+this}[Symbol.for("constructDateFrom")](t){return new S(+new Date(t),this.timeZone)}}const Z=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!Z.test(n))return;const t=n.replace(Z,"$1UTC");S.prototype[t]&&(n.startsWith("get")?S.prototype[n]=function(){return this.internal[t]()}:(S.prototype[n]=function(){return Date.prototype[t].apply(this.internal,arguments),be(this),+this},S.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),z(this),+this}))});function z(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function be(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),it(n)}function it(n){const t=Y(n.timeZone,n),e=new Date(+n);e.setUTCHours(e.getUTCHours()-1);const r=-new Date(+n).getTimezoneOffset(),a=-new Date(+e).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();s&&i&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+s);const c=r-t;c&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+c);const l=Y(n.timeZone,n),f=-new Date(+n).getTimezoneOffset()-l,p=l!==t,w=f-c;if(p&&w){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+w);const m=Y(n.timeZone,n),g=l-m;g&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+g))}}class M extends S{static tz(t,...e){return e.length?new M(...e,t):new M(Date.now(),t)}toISOString(){const[t,e,r]=this.tzComponents(),a=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,r,a]=this.tzComponents();return`${t} GMT${e}${r}${a} (${ke(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}function ke(n,t){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(t).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const y=n=>n.toISOString().split("T")[0],ve=n=>{if(!n)return null;const t=$(new M(n,window.pktTz),12);return isNaN(t.getTime())?null:t},De=(n,t)=>{const e=b(n);return isNaN(e.getTime())?"":ge(e,t)},b=(n="")=>$(n===""||!n?new M(new Date,window.pktTz):new M(n,window.pktTz),12),T=(n,t,e=1)=>$(new M(n,t,e,window.pktTz),12),Se=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),Me="pkt-calendar",xe={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},Te={"date-selected":{description:"Returns ISO formatted date string"}},P={name:Me,"css-class":"pkt-calendar",props:xe,events:Te};var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,d=(n,t,e,r)=>{for(var a=r>1?void 0:r?Oe(t,e):t,s=n.length-1,i;s>=0;s--)(i=n[s])&&(a=(r?i(t,e,a):i(a))||a);return r&&a&&Pe(t,e,a),a};exports.PktCalendar=class extends o.PktElement{constructor(){super(...arguments),this.multiple=P.props.multiple.default,this.maxMultiple=P.props.maxMultiple.default,this.range=P.props.range.default,this.weeknumbers=P.props.weeknumbers.default,this.withcontrols=P.props.withcontrols.default,this.selected=[],this.earliest=P.props.earliest.default,this.latest=P.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,e,r)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>b(t)),this.range&&this.selected.length===2){const t=L({start:b(this.selected[0]),end:b(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let r=0;r<t.length;r++)e[y(t[r])]=this.isInRange(t[r]);this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=b(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=b()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,i,c;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((c=t.target)==null?void 0:c.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const r=this.focusedDate?b(this.focusedDate):T(this.year,this.month,1);let a=q(r,e);if(a){let l=this.querySelector(`div[data-date="${y(a)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){a=q(a,e);let u=this.querySelector(`div[data-date="${y(a)}"]`);for(;u&&u instanceof HTMLDivElement&&u.dataset.disabled;)a=q(a,e),u=this.querySelector(`div[data-date="${y(a)}"]`);l=u}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=y(a),l.focus())}}}render(){return o.x`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":o.E}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
aria-label="${this.strings.dates.month}"
|
|
57
57
|
class="pkt-input pkt-input-compact"
|
|
58
58
|
id="${this.id}-monthnav"
|
|
59
|
-
@change=${e=>{this.changeMonth(this.year,e.target.value)}}
|
|
59
|
+
@change=${e=>{e.stopImmediatePropagation(),this.changeMonth(this.year,e.target.value)}}
|
|
60
60
|
>
|
|
61
61
|
${this.monthStrings.map((e,r)=>o.x`<option value=${r} ?selected=${this.month===r}>${e}</option>`)}
|
|
62
62
|
</select>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
type="number"
|
|
69
69
|
size="4"
|
|
70
70
|
placeholder="0000"
|
|
71
|
-
@change=${e=>{this.changeMonth(e.target.value,this.month)}}
|
|
71
|
+
@change=${e=>{e.stopImmediatePropagation(),this.changeMonth(e.target.value,this.month)}}
|
|
72
72
|
.value=${this.year}
|
|
73
73
|
/>
|
|
74
74
|
</div> `):t.push(o.x`<div class="pkt-txt-16-medium" aria-live="polite">
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
</div>
|
|
106
106
|
</td>`),u++):(w.push(this.renderDayView(u,t,m)),u++);f.push(o.x`<tr class="pkt-cal-week-row" role="row">
|
|
107
107
|
${w}
|
|
108
|
-
</tr>`)}return f}isExcluded(t,e){return this.excludeweekdays.includes(t.toString())||this.earliest&&$(e,1)<b(this.earliest)||this.latest&&$(e,-1)>b(this.latest)?!0:this.excludedates.some(r=>typeof r=="string"?r===y(e):r.toDateString()===e.toDateString())}isPrevMonthAllowed(){const t=T(this.year,this.month,0);return!(this.earliest&&b(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=T(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&b(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=t,this.month=e,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]
|
|
108
|
+
</tr>`)}return f}isExcluded(t,e){return this.excludeweekdays.includes(t.toString())||this.earliest&&$(e,1)<b(this.earliest)||this.latest&&$(e,-1)>b(this.latest)?!0:this.excludedates.some(r=>typeof r=="string"?r===y(e):r.toDateString()===e.toDateString())}isPrevMonthAllowed(){const t=T(this.year,this.month,0);return!(this.earliest&&b(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=T(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&b(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isInRange(t){if(this.range&&this.selected.length===2){if(t>b(this.selected[0])&&t<b(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&t>b(this.selected[0])&&t<this.rangeHovered)return!0;return!1}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const r=L({start:this._selected[0],end:t});if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++)this.excludedates.forEach(s=>{s>this._selected[0]&&s<t&&(e=!1)}),this.excludeweekdays.includes(pe(r[a]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(y(t))||(this.selected=[...this.selected,y(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&this.close())}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(y(t)),r=[...this.selected],a=[...this._selected];r.splice(e,1),a.splice(e,1),this.selected=r,this._selected=a}}toggleSelected(t){const e=y(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=y(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=L({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let r=0;r<e.length;r++)this.inRange[y(e[r])]=this.isInRange(e[r])}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(y(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const t=y(b()),e=this.querySelector(`div[data-date="${t}"]`);if(e instanceof HTMLDivElement)this.focusedDate=t,e.focus();else{const r=this.selectableDates.find(a=>!a.isDisabled);if(r){const a=this.querySelector(`div[data-date="${r.currentDateISO}"]`);a instanceof HTMLDivElement&&(this.focusedDate=r.currentDateISO,a.focus())}}}closeEvent(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};d([o.n({type:Boolean})],exports.PktCalendar.prototype,"multiple",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"maxMultiple",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"range",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"weeknumbers",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"withcontrols",2);d([o.n({converter:H.converters.csvToArray})],exports.PktCalendar.prototype,"selected",2);d([o.n({type:String})],exports.PktCalendar.prototype,"earliest",2);d([o.n({type:String})],exports.PktCalendar.prototype,"latest",2);d([o.n({converter:H.converters.stringsToDate})],exports.PktCalendar.prototype,"excludedates",2);d([o.n({converter:H.converters.csvToArray})],exports.PktCalendar.prototype,"excludeweekdays",2);d([o.n({converter:H.converters.stringToDate})],exports.PktCalendar.prototype,"currentmonth",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"dayStrings",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"dayStringsLong",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"monthStrings",2);d([o.n({type:String})],exports.PktCalendar.prototype,"weekString",2);d([o.n({type:String})],exports.PktCalendar.prototype,"prevMonthString",2);d([o.n({type:String})],exports.PktCalendar.prototype,"nextMonthString",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"_selected",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"year",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"month",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"week",2);d([o.n({type:Date})],exports.PktCalendar.prototype,"rangeHovered",2);d([o.r()],exports.PktCalendar.prototype,"inRange",2);d([o.r()],exports.PktCalendar.prototype,"focusedDate",2);d([o.r()],exports.PktCalendar.prototype,"selectableDates",2);d([o.r()],exports.PktCalendar.prototype,"currentmonthtouched",2);d([o.r()],exports.PktCalendar.prototype,"tabIndexSet",2);exports.PktCalendar=d([ot.t("pkt-calendar")],exports.PktCalendar);exports.formatISODate=y;exports.fromISOToDate=ve;exports.fromISOtoLocal=De;exports.newDate=b;
|
package/dist/index.d.ts
CHANGED
|
@@ -326,6 +326,7 @@ declare class PktInputElement extends PktElement {
|
|
|
326
326
|
minlength: number | null;
|
|
327
327
|
maxlength: number | null;
|
|
328
328
|
pattern: string;
|
|
329
|
+
readonly: boolean;
|
|
329
330
|
ariaLabelledby: string | null;
|
|
330
331
|
ariaDescribedBy: string | null;
|
|
331
332
|
label: string | null;
|
|
@@ -343,6 +344,8 @@ declare class PktInputElement extends PktElement {
|
|
|
343
344
|
helptextDropdownButton: string | null;
|
|
344
345
|
fullwidth: boolean;
|
|
345
346
|
useWrapper: boolean;
|
|
347
|
+
dataTestid: string;
|
|
348
|
+
skipForwardTestid: boolean;
|
|
346
349
|
touched: boolean;
|
|
347
350
|
constructor();
|
|
348
351
|
protected manageValidity(input: HTMLInputElement): void;
|
|
@@ -353,6 +356,7 @@ declare class PktInputElement extends PktElement {
|
|
|
353
356
|
protected onBlur(): void;
|
|
354
357
|
protected onInput(): void;
|
|
355
358
|
protected onChange(value: string | string[]): void;
|
|
359
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
356
360
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
357
361
|
}
|
|
358
362
|
|
|
@@ -499,6 +503,7 @@ export declare class PktTextarea extends PktInputElement {
|
|
|
499
503
|
export declare class PktTextinput extends PktInputElement {
|
|
500
504
|
value: string;
|
|
501
505
|
type: string;
|
|
506
|
+
size: number | null;
|
|
502
507
|
autocomplete: string;
|
|
503
508
|
iconNameRight: string | null;
|
|
504
509
|
prefix: string | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as x, u as w, s as o, E as a, x as p, n as r } from "./index-
|
|
2
|
-
import { e as k, P as m, n as v } from "./ref-
|
|
3
|
-
import { o as T } from "./index-
|
|
4
|
-
import { e as u } from "./class-map-
|
|
1
|
+
import { P as x, u as w, s as o, E as a, x as p, n as r } from "./index-CFDwiDTU.js";
|
|
2
|
+
import { e as k, P as m, n as v } from "./ref-CaiKp3S2.js";
|
|
3
|
+
import { o as T } from "./index-RwtTBIhT.js";
|
|
4
|
+
import { e as u } from "./class-map-CBvUV2N3.js";
|
|
5
5
|
import { t as _ } from "./custom-element-CWfU4dcr.js";
|
|
6
|
-
import "./helptext-
|
|
6
|
+
import "./helptext-DBolvFI4.js";
|
|
7
7
|
var D = Object.defineProperty, B = Object.getOwnPropertyDescriptor, e = (c, h, l, i) => {
|
|
8
8
|
for (var s = i > 1 ? void 0 : i ? B(h, l) : h, n = c.length - 1, d; n >= 0; n--)
|
|
9
9
|
(d = c[n]) && (s = (i ? d(h, l, s) : d(s)) || s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./index-
|
|
1
|
+
"use strict";const t=require("./index-CR7t1zY9.cjs"),h=require("./ref-C2yPtMJA.cjs"),b=require("./index-CmTjXoAb.cjs"),a=require("./class-map-a5HUzP83.cjs"),f=require("./custom-element-B-TlBwRu.cjs");require("./helptext-_fMLOOCL.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,e=(l,i,n,p)=>{for(var r=p>1?void 0:p?g(i,n):i,s=l.length-1,o;s>=0;s--)(o=l[s])&&(r=(p?o(i,n,r):o(r))||r);return p&&r&&$(i,n,r),r};exports.PktInputWrapper=class extends t.PktElement{constructor(){super(),this.defaultSlot=h.e(),this.forId=t.uuidish(),this.label="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=t.specs.props.helptextDropdownButton.default,this.counter=t.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.optionalTag=t.specs.props.optionalTag.default,this.optionalText=t.specs.props.optionalText.default,this.requiredTag=t.specs.props.requiredTag.default,this.requiredText=t.specs.props.requiredText.default,this.hasError=t.specs.props.hasError.default,this.errorMessage="",this.disabled=t.specs.props.disabled.default,this.inline=t.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=t.specs.props.hasFieldset.default,this.useWrapper=t.specs.props.useWrapper.default,this.slotController=new h.PktSlotController(this,this.defaultSlot)}render(){const i={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n={"pkt-tag":!0,"pkt-tag--small":!0,"pkt-tag--thin-text":!0,"pkt-tag--blue-light":this.optionalTag,"pkt-tag--beige":!this.optionalTag&&this.requiredTag},p=this.helptextDropdown!=="",r={"pkt-inputwrapper__label":!0,"pkt-inputwrapper__fieldset":this.hasFieldset,"pkt-inputwrapper__legend":this.hasFieldset},s=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.E,o=()=>this.optionalTag||this.requiredTag?t.x`<span class=${a.e(n)}
|
|
2
2
|
>${this.optionalTag?this.optionalText:this.requiredTag?this.requiredText:t.E}</span
|
|
3
3
|
>`:t.E,d=()=>this.useWrapper?this.hasFieldset?t.x`<legend class="pkt-inputwrapper__legend" id="${this.forId}-label">
|
|
4
4
|
${this.label} ${o()}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as f, x as c, n } from "./index-
|
|
1
|
+
import { P as f, x as c, n } from "./index-CFDwiDTU.js";
|
|
2
2
|
import { t as h } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { e as k, P as m, n as u } from "./ref-
|
|
4
|
-
import "./index-
|
|
3
|
+
import { e as k, P as m, n as u } from "./ref-CaiKp3S2.js";
|
|
4
|
+
import "./index-RwtTBIhT.js";
|
|
5
5
|
var _ = Object.defineProperty, d = Object.getOwnPropertyDescriptor, r = (l, i, s, o) => {
|
|
6
6
|
for (var e = o > 1 ? void 0 : o ? d(i, s) : i, a = l.length - 1, p; a >= 0; a--)
|
|
7
7
|
(p = l[a]) && (e = (o ? p(i, s, e) : p(e)) || e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./index-
|
|
1
|
+
"use strict";const t=require("./index-CR7t1zY9.cjs"),p=require("./custom-element-B-TlBwRu.cjs"),k=require("./ref-C2yPtMJA.cjs");require("./index-CmTjXoAb.cjs");var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(s,n,i,l)=>{for(var e=l>1?void 0:l?h(n,i):n,o=s.length-1,a;o>=0;o--)(a=s[o])&&(e=(l?a(n,i,e):a(e))||e);return l&&e&&c(n,i,e),e};exports.PktLinkCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=k.e(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const n=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),i=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return t.x`
|
|
2
2
|
<a
|
|
3
3
|
href=${this.href}
|
|
4
4
|
class=${n}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as c } from "./class-map-
|
|
1
|
+
import { e as c } from "./class-map-CBvUV2N3.js";
|
|
2
2
|
import { t as g } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { r as f, P as v, x as p, E as h, n as a } from "./index-
|
|
4
|
-
import { e as k, P as b, n as u } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as f, P as v, x as p, E as h, n as a } from "./index-CFDwiDTU.js";
|
|
4
|
+
import { e as k, P as b, n as u } from "./ref-CaiKp3S2.js";
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
const y = "pkt-modal", _ = !0, C = {
|
|
7
7
|
"background-click": {
|
|
8
8
|
description: "Event som trigges når bakgrunnen trykkes på"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-
|
|
1
|
+
"use strict";const c=require("./class-map-a5HUzP83.cjs"),k=require("./custom-element-B-TlBwRu.cjs"),n=require("./index-CR7t1zY9.cjs"),a=require("./ref-C2yPtMJA.cjs");require("./index-CmTjXoAb.cjs");const m="pkt-modal",u=!0,h={"background-click":{description:"Event som trigges når bakgrunnen trykkes på"},close:{description:"Event som trigges når meldingsboksen lukkes"}},g={headingText:{name:"Heading text",description:"Heading tekst på modalen",type:"string"},hideCloseButton:{name:"Gjem 'Lukk'-knapp",description:"Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.",type:"boolean",default:!1},closeOnBackdropClick:{name:"Lukk modalen når bakgrunnen trykkes på",description:"Lukk modalen når bakgrunnen trykkes på",type:"boolean",default:!1},size:{name:"Størrelse",description:"Størrelsen på modalen",type:["small","medium","large"],default:"medium"}},f={default:{description:"Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen."}},p={name:m,"css-class":"pkt-modal",isElements:u,events:h,props:g,slots:f};var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,i=(d,e,t,o)=>{for(var s=o>1?void 0:o?b(e,t):e,l=d.length-1,r;l>=0;l--)(r=d[l])&&(s=(o?r(e,t,s):r(s))||s);return o&&s&&v(e,t,s),s};exports.PktModal=class extends n.PktElement{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=p.props.hideCloseButton.default,this.closeOnBackdropClick=p.props.closeOnBackdropClick.default,this.size=p.props.size.default,this.defaultSlot=a.e(),this.dialogRef=a.e(),this._isOpen=!1,this.close=(e,t=!1)=>{var l;this._isOpen=!1,t||(l=this.dialogRef.value)==null||l.close();const o=document.activeElement;o&&!this.isElementInViewport(o)&&o.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),document.querySelector(".pkt-modal")&&document.body.classList.remove("pkt-modal--open"),this.requestUpdate()},this.showModal=e=>{var o;this._isOpen=!0,(o=this.dialogRef.value)==null||o.showModal(),document.querySelector(".pkt-modal")&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new a.PktSlotController(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){var e;super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this)),(e=this.dialogRef.value)==null||e.addEventListener("submit",t=>this.close(t,!0))}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),document.removeEventListener("click",this.handleBackdropClick.bind(this)),(e=this.dialogRef.value)==null||e.removeEventListener("submit",t=>this.close(t,!0))}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,[`pkt-modal--${this.size}`]:this.size!==void 0},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},o={"pkt-modal__content":!0,"pkt-txt-18-light":!0};return n.x`
|
|
2
2
|
<dialog
|
|
3
3
|
class=${c.e(e)}
|
|
4
4
|
aria-modal=${this._isOpen}
|
package/dist/pkt-alert.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./class-map-a5HUzP83.cjs"),k=require("./custom-element-B-TlBwRu.cjs"),t=require("./index-CR7t1zY9.cjs"),c=require("./ref-C2yPtMJA.cjs");require("./index-CmTjXoAb.cjs");const u="pkt-alert",v=!0,h={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},m={title:{name:"Tittel",description:"Tittelen som vises øverst i på meldingen",type:"string"},skin:{name:"Utseende",description:"Hvordan type melding er dette?",type:["info","success","warning","error"],default:"info"},date:{name:"Sist oppdatert",description:"Dato som vises nederst i på meldingen",type:"string"},ariaLive:{name:"aria-live",description:"Hvordan skal skjermleseren lese opp meldingen?",type:["off","polite","assertive"],default:"polite"},compact:{name:"Kompakt",description:"Gjør meldingen mindre",type:"boolean",default:!1},closeAlert:{name:"Vis 'Lukk'-knapp",description:"Viser 'Lukk'-knappen",type:"boolean",default:!1}},f={default:{description:"Innholdet i meldingen"}},n={name:u,"css-class":"pkt-alert","dark-mode":!0,isElement:v,events:h,props:m,slots:f};var b=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(a,e,r,l)=>{for(var s=l>1?void 0:l?y(e,r):e,o=a.length-1,p;o>=0;o--)(p=a[o])&&(s=(l?p(e,r,s):p(s))||s);return l&&s&&b(e,r,s),s};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.compact=n.props.compact.default,this.title="",this.skin=n.props.skin.default,this.ariaLive=n.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=n.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new c.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,r,l){e==="ariaLive"&&(this["aria-live"]=l)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return t.x`
|
|
2
2
|
<div class=${d.e(e)}>
|
|
3
3
|
<pkt-icon
|
|
4
4
|
class="pkt-alert__icon"
|
package/dist/pkt-alert.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as k } from "./class-map-
|
|
1
|
+
import { e as k } from "./class-map-CBvUV2N3.js";
|
|
2
2
|
import { t as m } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { r as v, P as h, x as n, E as u, n as l } from "./index-
|
|
4
|
-
import { e as f, P as b, n as y } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as v, P as h, x as n, E as u, n as l } from "./index-CFDwiDTU.js";
|
|
4
|
+
import { e as f, P as b, n as y } from "./ref-CaiKp3S2.js";
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
const _ = "pkt-alert", g = !0, C = {
|
|
7
7
|
onClose: {
|
|
8
8
|
description: "React: Klikk-event for 'Lukk'-knappen"
|
package/dist/pkt-calendar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CR7t1zY9.cjs");require("./converters-DhM11VlY.cjs");require("./custom-element-B-TlBwRu.cjs");require("./class-map-a5HUzP83.cjs");const e=require("./index-tvpcg-ad.cjs");require("./index-CmTjXoAb.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});
|
package/dist/pkt-calendar.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-CFDwiDTU.js";
|
|
2
2
|
import "./converters-DNCwIFwr.js";
|
|
3
3
|
import "./custom-element-CWfU4dcr.js";
|
|
4
|
-
import "./class-map-
|
|
5
|
-
import { P as e } from "./index-
|
|
6
|
-
import "./index-
|
|
4
|
+
import "./class-map-CBvUV2N3.js";
|
|
5
|
+
import { P as e } from "./index-D2jSRMrn.js";
|
|
6
|
+
import "./index-RwtTBIhT.js";
|
|
7
7
|
export {
|
|
8
8
|
e as PktCalendar
|
|
9
9
|
};
|
package/dist/pkt-card.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./class-map-a5HUzP83.cjs"),g=require("./custom-element-B-TlBwRu.cjs"),t=require("./index-CR7t1zY9.cjs"),d=require("./ref-C2yPtMJA.cjs");require("./index-CmTjXoAb.cjs");require("./pkt-tag.cjs");const u="pkt-card",k=!0,h={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"array",description:"Liste av tags på kortet. Tar inn en array med objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"icon",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag",required:!0}}}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},image:{type:"object",name:"Bilde",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",properties:{src:{type:"string",description:"Bilde på kortet",required:!0},alt:{type:"string",description:"Tekst for aria-label",required:!0}}}},m={default:{description:"Innholdet i kortet"}},l={name:u,"css-class":"pkt-card",isElement:k,props:h,slots:m};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(a,i,s,n)=>{for(var e=n>1?void 0:n?b(i,s):i,o=a.length-1,p;o>=0;o--)(p=a[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&y(i,s,e),e};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.skin=l.props.skin.default,this.direction=l.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new d.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return t.x`
|
|
2
2
|
<div class=${c.e(i)}>
|
|
3
3
|
${this.image.src&&t.x`
|
|
4
4
|
<div class="pkt-card__image">
|
package/dist/pkt-card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as g } from "./class-map-
|
|
1
|
+
import { e as g } from "./class-map-CBvUV2N3.js";
|
|
2
2
|
import { t as h } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { P as k, x as r, E as u, n as a } from "./index-
|
|
4
|
-
import { e as m, P as y, n as f } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { P as k, x as r, E as u, n as a } from "./index-CFDwiDTU.js";
|
|
4
|
+
import { e as m, P as y, n as f } from "./ref-CaiKp3S2.js";
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
import "./pkt-tag.js";
|
|
7
7
|
const b = "pkt-card", v = !0, $ = {
|
|
8
8
|
heading: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CR7t1zY9.cjs"),h=require("./custom-element-B-TlBwRu.cjs"),r=require("./ref-C2yPtMJA.cjs"),c=require("./class-map-a5HUzP83.cjs"),d=require("./converters-DhM11VlY.cjs");var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(l,t,s,i)=>{for(var n=i>1?void 0:i?m(t,s):t,a=l.length-1,p;a>=0;a--)(p=l[a])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&u(t,s,n),n};exports.PktComponent=class extends e.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=r.e(),this.namedSlot=r.e(),this.slotController=new r.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(t=>{this._list.push(t.toUpperCase())}),super.connectedCallback()}render(){const t={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return e.x`
|
|
2
2
|
<div class="${c.e(t)}">
|
|
3
3
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as m, x as h, t as u, n as i } from "./index-
|
|
1
|
+
import { P as m, x as h, t as u, n as i } from "./index-CFDwiDTU.js";
|
|
2
2
|
import { t as f } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { e as d, P as v, n as c } from "./ref-
|
|
4
|
-
import { e as g } from "./class-map-
|
|
3
|
+
import { e as d, P as v, n as c } from "./ref-CaiKp3S2.js";
|
|
4
|
+
import { e as g } from "./class-map-CBvUV2N3.js";
|
|
5
5
|
import { c as k } from "./converters-DNCwIFwr.js";
|
|
6
6
|
var S = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, n = (t, e, l, o) => {
|
|
7
7
|
for (var s = o > 1 ? void 0 : o ? $(e, l) : e, a = t.length - 1, p; a >= 0; a--)
|
package/dist/pkt-datepicker.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CR7t1zY9.cjs"),b=require("./custom-element-B-TlBwRu.cjs"),r=require("./ref-C2yPtMJA.cjs"),y=require("./class-map-a5HUzP83.cjs"),T=require("./converters-DhM11VlY.cjs"),m=require("./index-tvpcg-ad.cjs");require("./input-wrapper-DX41tnbj.cjs");require("./index-CmTjXoAb.cjs");require("./pkt-tag.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
.value=${this._value[0]??""}
|
|
29
29
|
min=${this.min}
|
|
30
30
|
max=${this.max}
|
|
31
|
-
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
32
31
|
?disabled=${this.disabled}
|
|
32
|
+
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
33
33
|
@keydown=${t=>{var i;(t.key===","||t.key==="Enter")&&((i=this.inputRef.value)==null||i.blur()),(t.key==="Space"||t.key===" ")&&(t.preventDefault(),this.toggleCalendar(t))}}
|
|
34
34
|
@input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
|
|
35
35
|
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
@@ -49,9 +49,8 @@
|
|
|
49
49
|
.value=${this._value[1]??""}
|
|
50
50
|
min=${this.min}
|
|
51
51
|
max=${this.max}
|
|
52
|
-
aria-labelledby="${this.id}-to-label"
|
|
53
|
-
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
54
52
|
?disabled=${this.disabled}
|
|
53
|
+
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
55
54
|
@keydown=${t=>{var i;(t.key===","||t.key==="Enter")&&((i=this.inputRefTo.value)==null||i.blur()),(t.key==="Space"||t.key===" ")&&(t.preventDefault(),this.toggleCalendar(t))}}
|
|
56
55
|
@input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
|
|
57
56
|
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
@@ -66,12 +65,12 @@
|
|
|
66
65
|
id="${this.id}-input"
|
|
67
66
|
min=${this.min||s.E}
|
|
68
67
|
max=${this.max||s.E}
|
|
68
|
+
?disabled=${this.disabled||this.maxlength&&this._value.length>=this.maxlength}
|
|
69
69
|
@click=${e=>{e.preventDefault(),this.showCalendar()}}
|
|
70
70
|
@blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.relatedTarget)||this.onBlur(),this.addToSelected(e)}}
|
|
71
71
|
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
72
72
|
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
73
73
|
@keydown=${e=>{(e.key===","||e.key==="Enter")&&(e.preventDefault(),this.addToSelected(e)),(e.key==="Space"||e.key===" ")&&(e.preventDefault(),this.toggleCalendar(e))}}
|
|
74
|
-
?disabled=${this.disabled||this.maxlength&&this._value.length>=this.maxlength}
|
|
75
74
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
76
75
|
${r.n(this.inputRef)}
|
|
77
76
|
/>
|