@oslokommune/punkt-elements 12.6.4 → 12.6.7
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-DuDzlp5t.cjs → class-map-DjxCaVFk.cjs} +1 -1
- package/dist/{class-map-CC5YmUWA.js → class-map-luGhSuLj.js} +1 -1
- package/dist/{index-CBp5twsn.js → index-B-KXmo65.js} +1 -1
- package/dist/{index-D8H97G5s.cjs → index-BYZhBzXZ.cjs} +1 -1
- package/dist/{index-D8wkW6WM.js → index-BkXggpNp.js} +12 -7
- package/dist/{index-d6Lj2RhC.js → index-CF6_-ZoF.js} +13 -12
- package/dist/{index-OhFn59AM.cjs → index-CzPkBTm-.cjs} +9 -4
- package/dist/{index-kJnGegz8.cjs → index-DAWAnAW_.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 +14 -13
- package/dist/pkt-datepicker.js +36 -36
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.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 +2 -2
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +4 -4
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-tag.cjs +2 -2
- package/dist/pkt-tag.js +13 -13
- package/dist/{ref-Bi2ZZNQq.cjs → ref-BuQtfKiL.cjs} +1 -1
- package/dist/{ref-bB529lv7.js → ref-rfvuMlT1.js} +1 -1
- package/package.json +3 -3
- package/src/components/calendar/index.ts +9 -4
- package/src/components/datepicker/index.ts +18 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-BYZhBzXZ.cjs"),r=require("./directive-DtixNHDT.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(m[r[t+0]]+m[r[t+1]]+m[r[t+2]]+m[r[t+3]]+"-"+m[r[t+4]]+m[r[t+5]]+"-"+m[r[t+6]]+m[r[t+7]]+"-"+m[r[t+8]]+m[r[t+9]]+"-"+m[r[t+10]]+m[r[t+11]]+m[r[t+12]]+m[r[t+13]]+m[r[t+14]]+m[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:Bt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const jt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender"},Jt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Wt={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:jt,calendar:zt,dates:Jt,forms:Wt};var Zt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Zt(t,e,i),i};class X extends O{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],X.prototype,"strings");class g extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],g.prototype,"id");u([c({type:String,reflect:!0})],g.prototype,"name");u([c({type:Boolean,reflect:!0})],g.prototype,"required");u([c({type:Boolean,reflect:!0})],g.prototype,"disabled");u([c({type:String,reflect:!0})],g.prototype,"placeholder");u([c({type:Number,reflect:!0})],g.prototype,"min");u([c({type:Number,reflect:!0})],g.prototype,"max");u([c({type:Number,reflect:!0})],g.prototype,"minlength");u([c({type:Number,reflect:!0})],g.prototype,"maxlength");u([c({type:String,reflect:!0})],g.prototype,"pattern");u([c({type:Boolean,reflect:!0})],g.prototype,"optionalTag");u([c({type:String,reflect:!0})],g.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],g.prototype,"requiredTag");u([c({type:String,reflect:!0})],g.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],g.prototype,"hasError");u([c({type:String,reflect:!0})],g.prototype,"errorMessage");u([At()],g.prototype,"touched");exports.E=d;exports.PktElement=X;exports.PktInputElement=g;exports.T=w;exports.Z=kt;exports.n=c;exports.r=At;exports.translations=y;exports.v4=bt;exports.x=Nt;
|
|
27
|
+
*/function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(m[r[t+0]]+m[r[t+1]]+m[r[t+2]]+m[r[t+3]]+"-"+m[r[t+4]]+m[r[t+5]]+"-"+m[r[t+6]]+m[r[t+7]]+"-"+m[r[t+8]]+m[r[t+9]]+"-"+m[r[t+10]]+m[r[t+11]]+m[r[t+12]]+m[r[t+13]]+m[r[t+14]]+m[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:Bt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const jt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Jt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Wt={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:jt,calendar:zt,dates:Jt,forms:Wt};var Zt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Zt(t,e,i),i};class X extends O{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],X.prototype,"strings");class g extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],g.prototype,"id");u([c({type:String,reflect:!0})],g.prototype,"name");u([c({type:Boolean,reflect:!0})],g.prototype,"required");u([c({type:Boolean,reflect:!0})],g.prototype,"disabled");u([c({type:String,reflect:!0})],g.prototype,"placeholder");u([c({type:Number,reflect:!0})],g.prototype,"min");u([c({type:Number,reflect:!0})],g.prototype,"max");u([c({type:Number,reflect:!0})],g.prototype,"minlength");u([c({type:Number,reflect:!0})],g.prototype,"maxlength");u([c({type:String,reflect:!0})],g.prototype,"pattern");u([c({type:Boolean,reflect:!0})],g.prototype,"optionalTag");u([c({type:String,reflect:!0})],g.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],g.prototype,"requiredTag");u([c({type:String,reflect:!0})],g.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],g.prototype,"hasError");u([c({type:String,reflect:!0})],g.prototype,"errorMessage");u([At()],g.prototype,"touched");exports.E=d;exports.PktElement=X;exports.PktInputElement=g;exports.T=w;exports.Z=kt;exports.n=c;exports.r=At;exports.translations=y;exports.v4=bt;exports.x=Nt;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as k, P as $, x as y, E as w, n as d } from "./index-
|
|
1
|
+
import { r as k, P as $, x as y, E as w, n as d } from "./index-CF6_-ZoF.js";
|
|
2
2
|
import { a as S } from "./converters-DNCwIFwr.js";
|
|
3
3
|
import { t as A } from "./directive-Cxhakbpr.js";
|
|
4
|
-
import { e as _ } from "./class-map-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { e as _ } from "./class-map-luGhSuLj.js";
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
function D(e) {
|
|
7
7
|
const t = Object.prototype.toString.call(e);
|
|
8
8
|
return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
@@ -276,17 +276,22 @@ let r = class extends $ {
|
|
|
276
276
|
role="grid"
|
|
277
277
|
?aria-multiselectable=${this.range || this.multiple}
|
|
278
278
|
>
|
|
279
|
-
|
|
279
|
+
<thead>
|
|
280
|
+
${this.renderDayNames()}
|
|
281
|
+
</thead>
|
|
282
|
+
<tbody>
|
|
283
|
+
${this.renderCalendarBody()}
|
|
284
|
+
</tbody>
|
|
280
285
|
</table>
|
|
281
286
|
</div>
|
|
282
287
|
`;
|
|
283
288
|
}
|
|
284
289
|
renderDayNames() {
|
|
285
290
|
const e = [];
|
|
286
|
-
this.weeknumbers && e.push(y`<
|
|
291
|
+
this.weeknumbers && e.push(y`<th><div>${this.weekString}</div></th>`);
|
|
287
292
|
for (let t = 0; t < this.dayStrings.length; t++)
|
|
288
|
-
e.push(y`<
|
|
289
|
-
return y`<tr class="pkt-cal-week-row"
|
|
293
|
+
e.push(y`<th><div>${this.dayStrings[t]}</div></th>`);
|
|
294
|
+
return y`<tr class="pkt-cal-week-row">
|
|
290
295
|
${e}
|
|
291
296
|
</tr>`;
|
|
292
297
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const D = globalThis, W = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, dt = Symbol(), X = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let At = class {
|
|
8
8
|
constructor(t, e, s) {
|
|
9
9
|
if (this._$cssResult$ = !0, s !== dt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -25,7 +25,7 @@ let At = class {
|
|
|
25
25
|
const bt = (r) => new At(typeof r == "string" ? r : r + "", void 0, dt), Et = (r, t) => {
|
|
26
26
|
if (W) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
27
27
|
else for (const e of t) {
|
|
28
|
-
const s = document.createElement("style"), i =
|
|
28
|
+
const s = document.createElement("style"), i = D.litNonce;
|
|
29
29
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
30
30
|
}
|
|
31
31
|
}, Y = W ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
@@ -38,7 +38,7 @@ const bt = (r) => new At(typeof r == "string" ? r : r + "", void 0, dt), Et = (r
|
|
|
38
38
|
* Copyright 2017 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
40
|
*/
|
|
41
|
-
const { is: St, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: Ct, getOwnPropertySymbols: xt, getPrototypeOf: Pt } = Object, A = globalThis, tt = A.trustedTypes, Tt = tt ? tt.emptyScript : "", q = A.reactiveElementPolyfillSupport, T = (r, t) => r,
|
|
41
|
+
const { is: St, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: Ct, getOwnPropertySymbols: xt, getPrototypeOf: Pt } = Object, A = globalThis, tt = A.trustedTypes, Tt = tt ? tt.emptyScript : "", q = A.reactiveElementPolyfillSupport, T = (r, t) => r, I = { toAttribute(r, t) {
|
|
42
42
|
switch (t) {
|
|
43
43
|
case Boolean:
|
|
44
44
|
r = r ? Tt : null;
|
|
@@ -66,7 +66,7 @@ const { is: St, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnProperty
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return e;
|
|
69
|
-
} }, Z = (r, t) => !St(r, t), et = { attribute: !0, type: String, converter:
|
|
69
|
+
} }, Z = (r, t) => !St(r, t), et = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: Z };
|
|
70
70
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
71
71
|
class U extends HTMLElement {
|
|
72
72
|
static addInitializer(t) {
|
|
@@ -179,7 +179,7 @@ class U extends HTMLElement {
|
|
|
179
179
|
var o;
|
|
180
180
|
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
181
181
|
if (i !== void 0 && s.reflect === !0) {
|
|
182
|
-
const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter :
|
|
182
|
+
const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : I).toAttribute(e, s.type);
|
|
183
183
|
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -187,7 +187,7 @@ class U extends HTMLElement {
|
|
|
187
187
|
var o;
|
|
188
188
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
189
189
|
if (i !== void 0 && this._$Em !== i) {
|
|
190
|
-
const n = s.getPropertyOptions(i), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter :
|
|
190
|
+
const n = s.getPropertyOptions(i), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : I;
|
|
191
191
|
this._$Em = i, this[i] = h.fromAttribute(e, n.type), this._$Em = null;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -543,7 +543,7 @@ z == null || z({ LitElement: O });
|
|
|
543
543
|
* Copyright 2017 Google LLC
|
|
544
544
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
545
545
|
*/
|
|
546
|
-
const Ht = { attribute: !0, type: String, converter:
|
|
546
|
+
const Ht = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: Z }, Nt = (r = Ht, t, e) => {
|
|
547
547
|
const { kind: s, metadata: i } = e;
|
|
548
548
|
let o = globalThis.litPropertyMetadata.get(i);
|
|
549
549
|
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") {
|
|
@@ -585,26 +585,27 @@ function Vt(r, t = 0) {
|
|
|
585
585
|
return (g[r[t + 0]] + g[r[t + 1]] + g[r[t + 2]] + g[r[t + 3]] + "-" + g[r[t + 4]] + g[r[t + 5]] + "-" + g[r[t + 6]] + g[r[t + 7]] + "-" + g[r[t + 8]] + g[r[t + 9]] + "-" + g[r[t + 10]] + g[r[t + 11]] + g[r[t + 12]] + g[r[t + 13]] + g[r[t + 14]] + g[r[t + 15]]).toLowerCase();
|
|
586
586
|
}
|
|
587
587
|
var L, Lt = new Uint8Array(16);
|
|
588
|
-
function
|
|
588
|
+
function Dt() {
|
|
589
589
|
if (!L && (L = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !L))
|
|
590
590
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
591
591
|
return L(Lt);
|
|
592
592
|
}
|
|
593
|
-
var
|
|
593
|
+
var It = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
594
594
|
const ht = {
|
|
595
|
-
randomUUID:
|
|
595
|
+
randomUUID: It
|
|
596
596
|
};
|
|
597
597
|
function Ft(r, t, e) {
|
|
598
598
|
if (ht.randomUUID && !t && !r)
|
|
599
599
|
return ht.randomUUID();
|
|
600
600
|
r = r || {};
|
|
601
|
-
var s = r.random || (r.rng ||
|
|
601
|
+
var s = r.random || (r.rng || Dt)();
|
|
602
602
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Vt(s);
|
|
603
603
|
}
|
|
604
604
|
const qt = {
|
|
605
605
|
hi: "Hei!"
|
|
606
606
|
}, Bt = {
|
|
607
|
-
buttonAltText: "Åpne kalender"
|
|
607
|
+
buttonAltText: "Åpne kalender",
|
|
608
|
+
deleteDate: "Fjern dato"
|
|
608
609
|
}, jt = {
|
|
609
610
|
month: "Måned",
|
|
610
611
|
year: "År",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-BYZhBzXZ.cjs"),b=require("./converters-DhM11VlY.cjs"),C=require("./directive-DtixNHDT.cjs"),$=require("./class-map-DjxCaVFk.cjs");require("./index-DAWAnAW_.cjs");function k(r){const e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new r.constructor(+r):typeof r=="number"||e==="[object Number]"||typeof r=="string"||e==="[object String]"?new Date(r):new Date(NaN)}function D(r,e){return r instanceof Date?new r.constructor(e):new Date(e)}const S=6048e5,P=864e5;let I={};function v(){return I}function g(r,e){var u,l,d,c;const t=v(),s=(e==null?void 0:e.weekStartsOn)??((l=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((c=(d=t.locale)==null?void 0:d.options)==null?void 0:c.weekStartsOn)??0,n=k(r),i=n.getDay(),h=(i<s?7:0)+i-s;return n.setDate(n.getDate()-h),n.setHours(0,0,0,0),n}function w(r,e){const t=k(r.start),s=k(r.end);let n=+t>+s;const i=n?+t:+s,h=n?s:t;h.setHours(0,0,0,0);let u=1;const l=[];for(;+h<=i;)l.push(k(h)),h.setDate(h.getDate()+u),h.setHours(0,0,0,0);return n?l.reverse():l}function x(r,e){var c,f,p,y;const t=k(r),s=t.getFullYear(),n=v(),i=(e==null?void 0:e.firstWeekContainsDate)??((f=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((y=(p=n.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??1,h=D(r,0);h.setFullYear(s+1,0,i),h.setHours(0,0,0,0);const u=g(h,e),l=D(r,0);l.setFullYear(s,0,i),l.setHours(0,0,0,0);const d=g(l,e);return t.getTime()>=u.getTime()?s+1:t.getTime()>=d.getTime()?s:s-1}function A(r,e){var u,l,d,c;const t=v(),s=(e==null?void 0:e.firstWeekContainsDate)??((l=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??t.firstWeekContainsDate??((c=(d=t.locale)==null?void 0:d.options)==null?void 0:c.firstWeekContainsDate)??1,n=x(r,e),i=D(r,0);return i.setFullYear(n,0,s),i.setHours(0,0,0,0),g(i,e)}function M(r,e){const t=k(r),s=+g(t,e)-+A(t,e);return Math.round(s/S)+1}function _(r){let t=k(r).getDay();return t===0&&(t=7),t}const T="pkt-calendar",E={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"}},N={"date-selected":{description:"Returns ISO formatted date string"}},m={name:T,"css-class":"pkt-calendar",props:E,events:N};var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,o=(r,e,t,s)=>{for(var n=s>1?void 0:s?R(e,t):e,i=r.length-1,h;i>=0;i--)(h=r[i])&&(n=(s?h(e,t,n):h(n))||n);return s&&n&&H(e,t,n),n};exports.PktCalendar=class extends a.PktElement{constructor(){super(...arguments),this.multiple=m.props.multiple.default,this.maxMultiple=m.props.maxMultiple.default,this.range=m.props.range.default,this.weeknumbers=m.props.weeknumbers.default,this.withcontrols=m.props.withcontrols.default,this.selected=[],this.earliest=m.props.earliest.default,this.latest=m.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,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(e,t,s){e==="selected"&&s&&this.convertSelected(),super.attributeChangedCallback(e,t,s)}updated(e){e.has("selected")&&this.convertSelected(),super.updated(e)}firstUpdated(e){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(e=>new Date(e)),this.range&&this.selected.length===2){const e=w({start:new Date(this.selected[0]),end:new Date(this.selected[1])});if(this.inRange={},Array.isArray(e)&&e.length){const t={};for(let s=0;s<e.length;s++)t[this.formatISODate(e[s])]=this.isInRange(e[s]);this.inRange=t}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=new Date(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=new Date),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){switch(e.key){case"ArrowLeft":this.handleArrowKey(e,-1);break;case"ArrowRight":this.handleArrowKey(e,1);break;case"ArrowUp":this.handleArrowKey(e,-7);break;case"ArrowDown":this.handleArrowKey(e,7);break}}handleArrowKey(e,t){var i,h,u;if(((i=e.target)==null?void 0:i.nodeName)==="INPUT"||((h=e.target)==null?void 0:h.nodeName)==="SELECT"||((u=e.target)==null?void 0:u.nodeName)==="BUTTON")return;e.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const s=this.focusedDate?new Date(this.focusedDate):new Date(this.year,this.month,1);let n=new Date(s.setDate(s.getDate()+t));if(n){let l=this.querySelector(`div[data-date="${this.formatISODate(n)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){let d=new Date(s.setDate(s.getDate()+t)),c=this.querySelector(`div[data-date="${this.formatISODate(d)}"]`);for(;c&&c instanceof HTMLDivElement&&c.dataset.disabled;)d=new Date(d.setDate(d.getDate()+t)),c=this.querySelector(`div[data-date="${this.formatISODate(d)}"]`);l=c}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=this.formatISODate(n),l.focus())}}}render(){return a.x`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":a.E}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
|
@@ -40,10 +40,15 @@
|
|
|
40
40
|
role="grid"
|
|
41
41
|
?aria-multiselectable=${this.range||this.multiple}
|
|
42
42
|
>
|
|
43
|
-
|
|
43
|
+
<thead>
|
|
44
|
+
${this.renderDayNames()}
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
${this.renderCalendarBody()}
|
|
48
|
+
</tbody>
|
|
44
49
|
</table>
|
|
45
50
|
</div>
|
|
46
|
-
`}renderDayNames(){const e=[];this.weeknumbers&&e.push(a.x`<
|
|
51
|
+
`}renderDayNames(){const e=[];this.weeknumbers&&e.push(a.x`<th><div>${this.weekString}</div></th>`);for(let t=0;t<this.dayStrings.length;t++)e.push(a.x`<th><div>${this.dayStrings[t]}</div></th>`);return a.x`<tr class="pkt-cal-week-row">
|
|
47
52
|
${e}
|
|
48
53
|
</tr>`}renderMonthNav(){let e=[];return this.withcontrols?e.push(a.x`<div class="pkt-cal-month-picker">
|
|
49
54
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
@@ -97,4 +102,4 @@
|
|
|
97
102
|
</div>
|
|
98
103
|
</td>`),d++):(p.push(this.renderDayView(d,e,y)),d++);c.push(a.x`<tr class="pkt-cal-week-row" role="row">
|
|
99
104
|
${p}
|
|
100
|
-
</tr>`)}return c}isExcluded(e,t){return this.excludeweekdays.includes(e.toString())||this.earliest&&t<new Date(this.earliest)||this.latest&&t>new Date(this.latest)?!0:this.excludedates.some(s=>typeof s=="string"?s===this.formatISODate(t):s.toDateString()===t.toDateString())}formatISODate(e){return e.toISOString().split("T")[0]}isPrevMonthAllowed(){const e=new Date(this.year,this.month,0,12);return!(this.earliest&&new Date(this.earliest)>e)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){const e=new Date(this.year,this.month===11?0:this.month+1,1,12);return!(this.latest&&new Date(this.latest)<e)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=e,this.month=t,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[],this.requestUpdate()}isInRange(e){if(this.range&&this.selected.length===2){if(e>new Date(this.selected[0])&&e<new Date(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&e>new Date(this.selected[0])&&e<this.rangeHovered)return!0;return!1}isRangeAllowed(e){let t=!0;if(this._selected.length===1){const s=w({start:this._selected[0],end:e});if(Array.isArray(s)&&s.length)for(let n=0;n<s.length;n++)this.excludedates.forEach(i=>{i>this._selected[0]&&i<e&&(t=!1)}),this.excludeweekdays.includes(_(s[n]).toString())&&(t=!1)}return t}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(e){this.selected.includes(this.formatISODate(e))||(this.selected=[...this.selected,this.formatISODate(e)],this._selected=[...this._selected,e],this.range&&this.selected.length===2&&this.close())}removeFromSelected(e){if(this.selected.length===1)this.emptySelected();else{const t=this.selected.indexOf(this.formatISODate(e)),s=[...this.selected],n=[...this._selected];s.splice(t,1),n.splice(t,1),this.selected=s,this._selected=n}}toggleSelected(e){const t=this.formatISODate(e);this.selected.includes(t)?this.removeFromSelected(e):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(e)}handleRangeSelect(e){const t=this.formatISODate(e);return this.selected.includes(t)?this.selected.indexOf(t)===0?this.emptySelected():this.removeFromSelected(e):this.selected.length>1?(this.emptySelected(),this.addToSelected(e)):(this.selected.length===1&&!this.isRangeAllowed(e)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>e&&this.emptySelected(),this.addToSelected(e)),Promise.resolve()}handleRangeHover(e){if(this.range&&this._selected.length===1&&this.isRangeAllowed(e)&&this._selected[0]<e){this.rangeHovered=e,this.inRange={};const t=w({start:this._selected[0],end:e});if(Array.isArray(t)&&t.length)for(let s=0;s<t.length;s++)this.inRange[this.formatISODate(t[s])]=this.isInRange(t[s])}else this.rangeHovered=null}handleDateSelect(e){if(e)return this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(this.formatISODate(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const e=this.formatISODate(new Date),t=this.querySelector(`div[data-date="${e}"]`);if(t instanceof HTMLDivElement)this.focusedDate=e,t.focus();else{const s=this.selectableDates.find(n=>!n.isDisabled);if(s){const n=this.querySelector(`div[data-date="${s.currentDateISO}"]`);n instanceof HTMLDivElement&&(this.focusedDate=s.currentDateISO,n.focus())}}}closeEvent(e){this.contains(e.relatedTarget)||this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};o([a.n({type:Boolean})],exports.PktCalendar.prototype,"multiple",2);o([a.n({type:Number})],exports.PktCalendar.prototype,"maxMultiple",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"range",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"weeknumbers",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"withcontrols",2);o([a.n({converter:
|
|
105
|
+
</tr>`)}return c}isExcluded(e,t){return this.excludeweekdays.includes(e.toString())||this.earliest&&t<new Date(this.earliest)||this.latest&&t>new Date(this.latest)?!0:this.excludedates.some(s=>typeof s=="string"?s===this.formatISODate(t):s.toDateString()===t.toDateString())}formatISODate(e){return e.toISOString().split("T")[0]}isPrevMonthAllowed(){const e=new Date(this.year,this.month,0,12);return!(this.earliest&&new Date(this.earliest)>e)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){const e=new Date(this.year,this.month===11?0:this.month+1,1,12);return!(this.latest&&new Date(this.latest)<e)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=e,this.month=t,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[],this.requestUpdate()}isInRange(e){if(this.range&&this.selected.length===2){if(e>new Date(this.selected[0])&&e<new Date(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&e>new Date(this.selected[0])&&e<this.rangeHovered)return!0;return!1}isRangeAllowed(e){let t=!0;if(this._selected.length===1){const s=w({start:this._selected[0],end:e});if(Array.isArray(s)&&s.length)for(let n=0;n<s.length;n++)this.excludedates.forEach(i=>{i>this._selected[0]&&i<e&&(t=!1)}),this.excludeweekdays.includes(_(s[n]).toString())&&(t=!1)}return t}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(e){this.selected.includes(this.formatISODate(e))||(this.selected=[...this.selected,this.formatISODate(e)],this._selected=[...this._selected,e],this.range&&this.selected.length===2&&this.close())}removeFromSelected(e){if(this.selected.length===1)this.emptySelected();else{const t=this.selected.indexOf(this.formatISODate(e)),s=[...this.selected],n=[...this._selected];s.splice(t,1),n.splice(t,1),this.selected=s,this._selected=n}}toggleSelected(e){const t=this.formatISODate(e);this.selected.includes(t)?this.removeFromSelected(e):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(e)}handleRangeSelect(e){const t=this.formatISODate(e);return this.selected.includes(t)?this.selected.indexOf(t)===0?this.emptySelected():this.removeFromSelected(e):this.selected.length>1?(this.emptySelected(),this.addToSelected(e)):(this.selected.length===1&&!this.isRangeAllowed(e)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>e&&this.emptySelected(),this.addToSelected(e)),Promise.resolve()}handleRangeHover(e){if(this.range&&this._selected.length===1&&this.isRangeAllowed(e)&&this._selected[0]<e){this.rangeHovered=e,this.inRange={};const t=w({start:this._selected[0],end:e});if(Array.isArray(t)&&t.length)for(let s=0;s<t.length;s++)this.inRange[this.formatISODate(t[s])]=this.isInRange(t[s])}else this.rangeHovered=null}handleDateSelect(e){if(e)return this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(this.formatISODate(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const e=this.formatISODate(new Date),t=this.querySelector(`div[data-date="${e}"]`);if(t instanceof HTMLDivElement)this.focusedDate=e,t.focus();else{const s=this.selectableDates.find(n=>!n.isDisabled);if(s){const n=this.querySelector(`div[data-date="${s.currentDateISO}"]`);n instanceof HTMLDivElement&&(this.focusedDate=s.currentDateISO,n.focus())}}}closeEvent(e){this.contains(e.relatedTarget)||this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};o([a.n({type:Boolean})],exports.PktCalendar.prototype,"multiple",2);o([a.n({type:Number})],exports.PktCalendar.prototype,"maxMultiple",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"range",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"weeknumbers",2);o([a.n({type:Boolean})],exports.PktCalendar.prototype,"withcontrols",2);o([a.n({converter:b.converters.csvToArray})],exports.PktCalendar.prototype,"selected",2);o([a.n({type:String})],exports.PktCalendar.prototype,"earliest",2);o([a.n({type:String})],exports.PktCalendar.prototype,"latest",2);o([a.n({converter:b.converters.stringsToDate})],exports.PktCalendar.prototype,"excludedates",2);o([a.n({converter:b.converters.csvToArray})],exports.PktCalendar.prototype,"excludeweekdays",2);o([a.n({converter:b.converters.stringToDate})],exports.PktCalendar.prototype,"currentmonth",2);o([a.n({type:Array})],exports.PktCalendar.prototype,"dayStrings",2);o([a.n({type:Array})],exports.PktCalendar.prototype,"monthStrings",2);o([a.n({type:String})],exports.PktCalendar.prototype,"weekString",2);o([a.n({type:String})],exports.PktCalendar.prototype,"prevMonthString",2);o([a.n({type:String})],exports.PktCalendar.prototype,"nextMonthString",2);o([a.n({type:Array})],exports.PktCalendar.prototype,"_selected",2);o([a.n({type:Number})],exports.PktCalendar.prototype,"year",2);o([a.n({type:Number})],exports.PktCalendar.prototype,"month",2);o([a.n({type:Number})],exports.PktCalendar.prototype,"week",2);o([a.n({type:Date})],exports.PktCalendar.prototype,"rangeHovered",2);o([a.r()],exports.PktCalendar.prototype,"inRange",2);o([a.r()],exports.PktCalendar.prototype,"focusedDate",2);o([a.r()],exports.PktCalendar.prototype,"selectableDates",2);o([a.r()],exports.PktCalendar.prototype,"currentmonthtouched",2);o([a.r()],exports.PktCalendar.prototype,"tabIndexSet",2);exports.PktCalendar=o([C.t("pkt-calendar")],exports.PktCalendar);exports.constructFrom=D;exports.getDefaultOptions=v;exports.getWeek=M;exports.getWeekYear=x;exports.millisecondsInDay=P;exports.millisecondsInWeek=S;exports.startOfWeek=g;exports.toDate=k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-BYZhBzXZ.cjs"),r=require("./directive-DtixNHDT.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/dist/pkt-alert.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BYZhBzXZ.cjs"),c=require("./ref-BuQtfKiL.cjs"),d=require("./class-map-DjxCaVFk.cjs"),k=require("./directive-DtixNHDT.cjs");require("./index-DAWAnAW_.cjs");const u="pkt-alert",m=!0,f={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},v={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}},h={default:{description:"Innholdet i meldingen"}},l={name:u,"css-class":"pkt-alert","dark-mode":!0,isElement:m,events:f,props:v,slots:h};var y=Object.defineProperty,_=Object.getOwnPropertyDescriptor,s=(n,e,o,r)=>{for(var i=r>1?void 0:r?_(e,o):e,a=n.length-1,p;a>=0;a--)(p=n[a])&&(i=(r?p(e,o,i):p(i))||i);return r&&i&&y(e,o,i),i};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.compact=l.props.compact.default,this.title="",this.skin=l.props.skin.default,this.ariaLive=l.props.ariaLive.default,this.closeAlert=l.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}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)} aria-live=${this.ariaLive}>
|
|
3
3
|
<pkt-icon
|
|
4
4
|
class="pkt-alert__icon"
|
package/dist/pkt-alert.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as m, P as u, x as n, E as k, n as o } from "./index-
|
|
2
|
-
import { e as f, P as h, n as v } from "./ref-
|
|
3
|
-
import { e as y } from "./class-map-
|
|
1
|
+
import { r as m, P as u, x as n, E as k, n as o } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as f, P as h, n as v } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as y } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as _ } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const b = "pkt-alert", g = !0, $ = {
|
|
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-BYZhBzXZ.cjs");require("./converters-DhM11VlY.cjs");require("./directive-DtixNHDT.cjs");require("./class-map-DjxCaVFk.cjs");const e=require("./index-CzPkBTm-.cjs");require("./index-DAWAnAW_.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-CF6_-ZoF.js";
|
|
2
2
|
import "./converters-DNCwIFwr.js";
|
|
3
3
|
import "./directive-Cxhakbpr.js";
|
|
4
|
-
import "./class-map-
|
|
5
|
-
import { P as e } from "./index-
|
|
6
|
-
import "./index-
|
|
4
|
+
import "./class-map-luGhSuLj.js";
|
|
5
|
+
import { P as e } from "./index-BkXggpNp.js";
|
|
6
|
+
import "./index-B-KXmo65.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 t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BYZhBzXZ.cjs"),d=require("./ref-BuQtfKiL.cjs"),c=require("./class-map-DjxCaVFk.cjs"),g=require("./directive-DtixNHDT.cjs");require("./index-DAWAnAW_.cjs");require("./pkt-tag.cjs");const k="pkt-card",u=!0,h={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-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:"string",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:["text"]}},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",image:"Image",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.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},m={default:{description:"Innholdet i kortet"}},l={name:k,"css-class":"pkt-card",isElement:u,props:h,slots:m};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(n,i,s,a)=>{for(var e=a>1?void 0:a?b(i,s):i,o=n.length-1,p;o>=0;o--)(p=n[o])&&(e=(a?p(i,s,e):p(e))||e);return a&&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 { P as g, x as r, E as k, n as a } from "./index-
|
|
2
|
-
import { e as h, P as m, n as u } from "./ref-
|
|
3
|
-
import { e as y } from "./class-map-
|
|
1
|
+
import { P as g, x as r, E as k, n as a } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as h, P as m, n as u } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as y } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as f } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.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-BYZhBzXZ.cjs"),h=require("./directive-DtixNHDT.cjs"),r=require("./ref-BuQtfKiL.cjs"),d=require("./class-map-DjxCaVFk.cjs"),c=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="${d.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-CF6_-ZoF.js";
|
|
2
2
|
import { t as f } from "./directive-Cxhakbpr.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-rfvuMlT1.js";
|
|
4
|
+
import { e as g } from "./class-map-luGhSuLj.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--)
|