@oslokommune/punkt-elements 12.42.3 → 12.42.5

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.
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./element-90YeMNbV.cjs"),c=require("./if-defined-C8eotHpL.cjs"),d=require("./state-D-Recv7U.cjs"),r=require("./ref-B-w1vCo8.cjs"),O=require("./class-map-DWDPOqjO.cjs"),I=require("./repeat-CxQA3AeF.cjs"),$=require("./input-element-CInrWeac.cjs"),y=require("./pkt-options-controller-Ay9ELZTV.cjs"),w=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-Uw7_cZ4w.cjs");require("./icon-B1_BRNqf.cjs");require("./tag-lU4vz70a.cjs");require("./listbox-AjDNhDsQ.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(b,e,t,i)=>{for(var s=i>1?void 0:i?S(e,t):e,l=b.length-1,n;l>=0;l--)(n=b[l])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new y.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...structuredClone(this.defaultOptions)],this._options=[...this.options]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){var t;if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...i,...structuredClone(this.defaultOptions)],this._options=[...this.options]}if(e.has("options")&&this.options.length){const s=this._options.filter(l=>l.userAdded).filter(l=>!this.options.some(n=>n.value===l.value));this._options=[...s,...this.options],this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const n=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,n)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=this.options,this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
1
+ "use strict";const a=require("./element-90YeMNbV.cjs"),c=require("./if-defined-C8eotHpL.cjs"),d=require("./state-D-Recv7U.cjs"),r=require("./ref-B-w1vCo8.cjs"),O=require("./class-map-DWDPOqjO.cjs"),I=require("./repeat-CxQA3AeF.cjs"),$=require("./input-element-CInrWeac.cjs"),y=require("./pkt-options-controller-Ay9ELZTV.cjs"),w=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-Uw7_cZ4w.cjs");require("./icon-B1_BRNqf.cjs");require("./tag-lU4vz70a.cjs");require("./listbox-AjDNhDsQ.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(b,e,t,i)=>{for(var s=i>1?void 0:i?S(e,t):e,l=b.length-1,n;l>=0;l--)(n=b[l])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new y.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=[...this.options]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){var t;if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=[...this.options]}if(e.has("options")&&this.options.length){const s=this._options.filter(l=>l.userAdded).filter(l=>!this.options.some(n=>n.value===l.value));this._options=[...s,...this.options],this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const n=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,n)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=this.options,this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
2
2
  <pkt-input-wrapper
3
3
  .label=${this.label}
4
4
  .helptext=${this.helptext}
@@ -5,18 +5,18 @@ import { e as _, n as v } from "./ref-DnSbnXsj.js";
5
5
  import { e as w } from "./class-map-m7ZCZ49w.js";
6
6
  import { c as R } from "./repeat-lUFq9w5d.js";
7
7
  import { P as V } from "./input-element-BEvaQK4g.js";
8
- import { P as C } from "./pkt-options-controller-DepYQBqb.js";
9
- import { P as A } from "./pkt-slot-controller-DtDaD9q_.js";
8
+ import { P as S } from "./pkt-options-controller-DepYQBqb.js";
9
+ import { P as C } from "./pkt-slot-controller-DtDaD9q_.js";
10
10
  import "./input-wrapper-DnyRiuHR.js";
11
11
  import "./icon-CO1TLSs5.js";
12
12
  import "./tag-CX-zbR-7.js";
13
13
  import "./listbox-DCWdrjFp.js";
14
- const S = {
14
+ const A = {
15
15
  displayValueAs: {
16
16
  default: "label"
17
17
  }
18
18
  }, T = {
19
- props: S
19
+ props: A
20
20
  };
21
21
  var M = Object.defineProperty, F = Object.getOwnPropertyDescriptor, o = (t, e, i, s) => {
22
22
  for (var l = s > 1 ? void 0 : s ? F(e, i) : e, n = t.length - 1, a; n >= 0; n--)
@@ -25,7 +25,7 @@ var M = Object.defineProperty, F = Object.getOwnPropertyDescriptor, o = (t, e, i
25
25
  };
26
26
  let h = class extends V {
27
27
  constructor() {
28
- super(), this.helptextSlot = _(), this.value = "", this.options = [], this.defaultOptions = [], this.allowUserInput = !1, this.typeahead = !1, this.includeSearch = !1, this.searchPlaceholder = "", this.multiple = !1, this.maxlength = null, this.displayValueAs = T.props.displayValueAs.default, this.tagPlacement = null, this._options = [], this._isOptionsOpen = !1, this._value = [], this._userInfoMessage = "", this._addValueText = null, this._maxIsReached = !1, this._search = "", this._inputFocus = !1, this._editingSingleValue = !1, this.inputRef = _(), this.arrowRef = _(), this.listboxRef = _(), this.focusRef = _(), this.optionTagRef = _(), this.optionsController = new C(this), this.slotController = new A(this, this.helptextSlot), this.slotController.skipOptions = !0;
28
+ super(), this.helptextSlot = _(), this.value = "", this.options = [], this.defaultOptions = [], this.allowUserInput = !1, this.typeahead = !1, this.includeSearch = !1, this.searchPlaceholder = "", this.multiple = !1, this.maxlength = null, this.displayValueAs = T.props.displayValueAs.default, this.tagPlacement = null, this._options = [], this._isOptionsOpen = !1, this._value = [], this._userInfoMessage = "", this._addValueText = null, this._maxIsReached = !1, this._search = "", this._inputFocus = !1, this._editingSingleValue = !1, this.inputRef = _(), this.arrowRef = _(), this.listboxRef = _(), this.focusRef = _(), this.optionTagRef = _(), this.optionsController = new S(this), this.slotController = new C(this, this.helptextSlot), this.slotController.skipOptions = !0;
29
29
  }
30
30
  // Lifecycle methods
31
31
  connectedCallback() {
@@ -34,7 +34,7 @@ let h = class extends V {
34
34
  this._isOptionsOpen && !this.contains(e.target) && this.handleFocusOut(e);
35
35
  }), this._options = [], this.defaultOptions && this.defaultOptions.length) {
36
36
  const e = ((t = this.options) == null ? void 0 : t.filter((i) => i.userAdded)) || [];
37
- this.options = [...e, ...structuredClone(this.defaultOptions)], this._options = [...this.options];
37
+ this.options = [...e, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = [...this.options];
38
38
  }
39
39
  if (this.optionsController.nodes.length) {
40
40
  const e = [];
@@ -52,7 +52,7 @@ let h = class extends V {
52
52
  var e;
53
53
  if (t.has("_value") && this.valueChanged(this._value, t.get("_value")), t.has("value") && (this._value = Array.isArray(this.value) ? this.value : this.value ? this.value.split(",") : [], !this.multiple && this._value.length > 1 && (this._value = [this._value[0]]), this.isMaxItemsReached()), t.has("defaultOptions") && this.defaultOptions.length) {
54
54
  const i = ((e = this.options) == null ? void 0 : e.filter((s) => s.userAdded)) || [];
55
- this.options = [...i, ...structuredClone(this.defaultOptions)], this._options = [...this.options];
55
+ this.options = [...i, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = [...this.options];
56
56
  }
57
57
  if (t.has("options") && this.options.length) {
58
58
  const s = this._options.filter((l) => l.userAdded).filter(
@@ -371,12 +371,12 @@ let h = class extends V {
371
371
  return t ? this._maxIsReached = !0 : this._maxIsReached = !1, t;
372
372
  }
373
373
  toggleValue(t) {
374
- var I, O;
374
+ var $, I;
375
375
  if (this.disabled) return;
376
376
  this.touched = !0, this._userInfoMessage = "", this._addValueText = null;
377
- const e = ((I = this.findValueInOptions(t)) == null ? void 0 : I.value) || null, i = this._value.includes(t || e || ""), s = !!e, l = ((O = this._options.find((m) => m.value === t)) == null ? void 0 : O.disabled) || !1, n = !(t != null && t.trim()), a = !this.multiple, u = this.multiple, $ = this.isMaxItemsReached();
377
+ const e = (($ = this.findValueInOptions(t)) == null ? void 0 : $.value) || null, i = this._value.includes(t || e || ""), s = !!e, l = ((I = this._options.find((m) => m.value === t)) == null ? void 0 : I.disabled) || !1, n = !(t != null && t.trim()), a = !this.multiple, u = this.multiple, O = this.isMaxItemsReached();
378
378
  let p = !1, b = !0, g = "", x = "";
379
- l || (!s && this.allowUserInput && !n ? (this.addNewUserValue(t), g = "Ny verdi lagt til", p = !u) : !s && !this.allowUserInput ? (a && this._value[0] && this.removeValue(this._value[0]), b = !1, p = !0, g = "Ingen treff i søket") : i ? (this.removeValue(e), p = !0) : n && a ? (this.removeAllSelected(), p = !0) : a ? (this._value[0] && this.removeSelected(this._value[0]), this.setSelected(e), p = !1, this.inputRef.value && this.inputRef.value.type !== "hidden" && (this.inputRef.value.value = "", this.inputRef.value.blur())) : u && !$ ? (this.setSelected(e), p = !0) : u && $ ? (this._userInfoMessage = "Maks antall valg nådd", b = !1, x = t) : (a && this.removeAllSelected(), this._userInfoMessage = "Ingen gyldig verdi valgt", b = !1, p = !0, x = t), this._isOptionsOpen = p, p || window.setTimeout(() => {
379
+ l || (!s && this.allowUserInput && !n ? (this.addNewUserValue(t), g = "Ny verdi lagt til", p = !u) : !s && !this.allowUserInput ? (a && this._value[0] && this.removeValue(this._value[0]), b = !1, p = !0, g = "Ingen treff i søket") : i ? (this.removeValue(e), p = !0) : n && a ? (this.removeAllSelected(), p = !0) : a ? (this._value[0] && this.removeSelected(this._value[0]), this.setSelected(e), p = !1, this.inputRef.value && this.inputRef.value.type !== "hidden" && (this.inputRef.value.value = "", this.inputRef.value.blur())) : u && !O ? (this.setSelected(e), p = !0) : u && O ? (this._userInfoMessage = "Maks antall valg nådd", b = !1, x = t) : (a && this.removeAllSelected(), this._userInfoMessage = "Ingen gyldig verdi valgt", b = !1, p = !0, x = t), this._isOptionsOpen = p, p || window.setTimeout(() => {
380
380
  var m;
381
381
  (m = this.focusRef.value) == null || m.focus();
382
382
  }, 0), this._userInfoMessage = g, this._search = x || "", this.resetComboboxInput(b), u && this.isMaxItemsReached());
@@ -0,0 +1,11 @@
1
+ "use strict";const o=require("./element-90YeMNbV.cjs");require("./button-KzBZ-Bff.cjs");require("./icon-B1_BRNqf.cjs");const k={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(r,e,t,n)=>{for(var i=n>1?void 0:n?p(e,t):e,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&d(e,t,i),i};let c=null;function u(){return c||(c=new Promise((r,e)=>{if(document.querySelector("#oslo-consent-script")){r();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>r(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),c)}exports.PktConsent=class extends o.PktElement{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||k.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const n=this.returnJsonOrObject(e.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:n,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await u(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const n={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(n),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?o.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?o.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
2
+ <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
3
+ ${this.triggerText}
4
+ </a>`:this.triggerType==="icon"?o.x`<pkt-button
5
+ skin="tertiary"
6
+ variant="icon-only"
7
+ iconName="cookie"
8
+ @click=${this.openModal}
9
+ >
10
+ >${this.triggerText}</pkt-button
11
+ >`:o.x`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};s([o.n({type:Boolean})],exports.PktConsent.prototype,"devMode",2);s([o.n({type:String})],exports.PktConsent.prototype,"hotjarId",2);s([o.n({type:String})],exports.PktConsent.prototype,"googleAnalyticsId",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieDomain",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieSecure",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieExpiryDays",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerType",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerText",2);s([o.n({type:String})],exports.PktConsent.prototype,"i18nLanguage",2);exports.PktConsent=s([o.t("pkt-consent")],exports.PktConsent);
@@ -1,7 +1,7 @@
1
- import { P as k, x as l, n as a, a as u } from "./element-gAd63VwC.js";
1
+ import { P as p, x as c, n as a, a as g } from "./element-gAd63VwC.js";
2
2
  import "./button-OLSvT2Im.js";
3
3
  import "./icon-CO1TLSs5.js";
4
- const h = {
4
+ const u = {
5
5
  i18n: {
6
6
  nb: {
7
7
  contentPresentation: {
@@ -53,39 +53,35 @@ const h = {
53
53
  }
54
54
  }
55
55
  }
56
- }, g = globalThis, p = g.__cookieEvents || {
57
- events: {},
58
- on(e, t) {
59
- this.events[e] || (this.events[e] = []), this.events[e].push(t);
60
- },
61
- off(e, t) {
62
- this.events[e] && (this.events[e] = this.events[e].filter((n) => n !== t));
63
- },
64
- once(e, t) {
65
- const n = (s) => {
66
- this.off(e, n), t(s);
67
- };
68
- this.on(e, n);
69
- },
70
- emit(e, t) {
71
- this.events[e] && this.events[e].forEach((n) => n(t));
72
- }
73
56
  };
74
- g.__cookieEvents = p;
75
- const m = p;
76
- var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, r = (e, t, n, s) => {
77
- for (var o = s > 1 ? void 0 : s ? v(t, n) : t, c = e.length - 1, d; c >= 0; c--)
78
- (d = e[c]) && (o = (s ? d(t, n, o) : d(o)) || o);
79
- return s && o && f(t, n, o), o;
57
+ var h = Object.defineProperty, m = Object.getOwnPropertyDescriptor, r = (e, t, n, o) => {
58
+ for (var s = o > 1 ? void 0 : o ? m(t, n) : t, k = e.length - 1, d; k >= 0; k--)
59
+ (d = e[k]) && (s = (o ? d(t, n, s) : d(s)) || s);
60
+ return o && s && h(t, n, s), s;
80
61
  };
81
- let i = class extends k {
62
+ let l = null;
63
+ function f() {
64
+ return l || (l = new Promise((e, t) => {
65
+ if (document.querySelector("#oslo-consent-script")) {
66
+ e();
67
+ return;
68
+ }
69
+ const n = document.createElement("script");
70
+ n.src = "https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js", n.id = "oslo-consent-script", n.onload = () => e(), n.onerror = t, document.head.appendChild(n);
71
+ const o = document.createElement("link");
72
+ o.href = "https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css", o.type = "text/css", o.rel = "stylesheet", o.id = "oslo-consent-styles", document.head.appendChild(o);
73
+ }), l);
74
+ }
75
+ let i = class extends p {
82
76
  constructor() {
83
- super(), this.hotjarId = null, this.googleAnalyticsId = null, this.triggerType = "button", this.triggerText = null, this.i18nLanguage = "nb";
77
+ super(), this.devMode = !1, this.hotjarId = null, this.googleAnalyticsId = null, this.cookieDomain = null, this.cookieSecure = null, this.cookieExpiryDays = null, this.triggerType = "button", this.triggerText = null, this.i18nLanguage = "nb";
84
78
  }
85
79
  connectedCallback() {
86
- super.connectedCallback(), this.triggerText = this.triggerText || h.i18n[this.i18nLanguage].contentPresentation.buttons.settings, this.googleAnalyticsId && (window.googleAnalyticsId = this.googleAnalyticsId), this.hotjarId && (window.hotjarId = this.hotjarId), m.on("CookieManager.setCookie", (e) => {
87
- this.emitCookieConsents(e);
88
- });
80
+ super.connectedCallback(), this.triggerText = this.triggerText || u.i18n[this.i18nLanguage].contentPresentation.buttons.settings;
81
+ }
82
+ disconnectedCallback() {
83
+ var e;
84
+ super.disconnectedCallback(), this._cookieEventHandler && ((e = window.__cookieEvents) == null || e.off("CookieManager.setCookie", this._cookieEventHandler));
89
85
  }
90
86
  returnJsonOrObject(e) {
91
87
  let t;
@@ -97,62 +93,69 @@ let i = class extends k {
97
93
  return t;
98
94
  }
99
95
  emitCookieConsents(e) {
100
- const n = this.returnJsonOrObject(e.value).items.reduce((s, o) => (s[o.name] = o.consent, s), {});
96
+ const n = this.returnJsonOrObject(e.value).items.reduce((o, s) => (o[s.name] = s.consent, o), {});
101
97
  this.dispatchEvent(
102
98
  new CustomEvent("toggle-consent", {
103
99
  detail: n,
104
100
  bubbles: !0,
105
- composed: !0
101
+ cancelable: !1
106
102
  })
107
103
  );
108
104
  }
109
- firstUpdated(e) {
110
- if (!document.querySelector("#oslo-consent-script") && window.location.hostname.toLowerCase().includes("oslo.kommune.no")) {
111
- window.googleAnalyticsId = this.googleAnalyticsId, window.hotjarId = this.hotjarId;
112
- const t = document.createElement("script");
113
- t.src = "https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js", t.id = "oslo-consent-script", t.onload = () => {
114
- this.triggerInit();
115
- }, document.head.appendChild(t);
116
- const n = document.createElement("link");
117
- n.href = "https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css", n.type = "text/css", n.rel = "stylesheet", n.id = "oslo-consent-styles", document.head.appendChild(n);
118
- }
105
+ async firstUpdated(e) {
106
+ window.cookieBanner_googleAnalyticsId = this.googleAnalyticsId, window.cookieBanner_hotjarId = this.hotjarId, this.cookieDomain && (window.cookieBanner_cookieDomain = this.cookieDomain), this.cookieSecure && (window.cookieBanner_cookieSecure = this.cookieSecure), this.cookieExpiryDays && (window.cookieBanner_cookieExpiryDays = this.cookieExpiryDays), this.devMode && (window.cookieBanner_devMode = this.devMode), await f(), this.triggerInit();
119
107
  }
120
108
  triggerInit() {
121
109
  window.document.dispatchEvent(
122
- new Event("DOMContentLoaded", {
110
+ new Event("CookieBannerReady", {
123
111
  bubbles: !0,
124
112
  cancelable: !0
125
113
  })
126
114
  ), window.cookieBanner.cookieConsent.validateConsentCookie().then((e) => {
127
115
  if (e) {
128
116
  const n = { value: window.cookieBanner.cookieConsent.getConsentCookie() };
129
- this.emitCookieConsents(n);
117
+ window.setTimeout(() => this.emitCookieConsents(n), 0), this._cookieEventHandler && window.__cookieEvents.off("CookieManager.setCookie", this._cookieEventHandler), this._cookieEventHandler = (o) => {
118
+ this.emitCookieConsents(o);
119
+ }, window.__cookieEvents.on("CookieManager.setCookie", this._cookieEventHandler);
130
120
  }
131
121
  });
132
122
  }
133
123
  openModal(e) {
134
- e.preventDefault(), window.cookieBanner.cookieConsent || this.triggerInit(), setTimeout(() => window.cookieBanner.openCookieModal());
124
+ var t;
125
+ e.preventDefault(), (t = window.cookieBanner) != null && t.cookieConsent || this.triggerInit(), setTimeout(() => window.cookieBanner.openCookieModal());
135
126
  }
136
127
  render() {
137
- return this.triggerType === "link" ? l`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>` : this.triggerType === "footerlink" ? l`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
128
+ return this.triggerType === "link" ? c`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>` : this.triggerType === "footerlink" ? c`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
138
129
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
139
130
  ${this.triggerText}
140
- </a>` : this.triggerType === "icon" ? l`<pkt-button
131
+ </a>` : this.triggerType === "icon" ? c`<pkt-button
141
132
  skin="tertiary"
142
133
  variant="icon-only"
143
134
  iconName="cookie"
144
135
  @click=${this.openModal}
145
136
  >
146
137
  >${this.triggerText}</pkt-button
147
- >` : l`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`;
138
+ >` : c`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`;
148
139
  }
149
140
  };
141
+ r([
142
+ a({ type: Boolean })
143
+ ], i.prototype, "devMode", 2);
150
144
  r([
151
145
  a({ type: String })
152
146
  ], i.prototype, "hotjarId", 2);
153
147
  r([
154
148
  a({ type: String })
155
149
  ], i.prototype, "googleAnalyticsId", 2);
150
+ r([
151
+ a({ type: String })
152
+ ], i.prototype, "cookieDomain", 2);
153
+ r([
154
+ a({ type: String })
155
+ ], i.prototype, "cookieSecure", 2);
156
+ r([
157
+ a({ type: String })
158
+ ], i.prototype, "cookieExpiryDays", 2);
156
159
  r([
157
160
  a({ type: String })
158
161
  ], i.prototype, "triggerType", 2);
@@ -163,7 +166,7 @@ r([
163
166
  a({ type: String })
164
167
  ], i.prototype, "i18nLanguage", 2);
165
168
  i = r([
166
- u("pkt-consent")
169
+ g("pkt-consent")
167
170
  ], i);
168
171
  export {
169
172
  i as P
@@ -1,4 +1,4 @@
1
- "use strict";const d=require("./class-map-DWDPOqjO.cjs"),p=require("./if-defined-C8eotHpL.cjs"),s=require("./element-90YeMNbV.cjs"),m=require("./state-D-Recv7U.cjs"),h=require("./calendar-BDeaGBaH.cjs"),k=require("./input-element-CInrWeac.cjs"),r=require("./ref-B-w1vCo8.cjs"),v=require("./repeat-CxQA3AeF.cjs");require("./icon-B1_BRNqf.cjs");require("./input-wrapper-Uw7_cZ4w.cjs");require("./tag-lU4vz70a.cjs");const $=require("./pkt-slot-controller-Da-RgXfS.cjs"),y={dateformat:{default:"dd.MM.yyyy"},min:{default:null},max:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},o={props:y};var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var a=i>1?void 0:i?x(t,e):t,n=c.length-1,u;n>=0;n--)(u=c[n])&&(a=(i?u(t,e,a):u(a))||a);return i&&a&&b(t,e,a),a};const g=c=>new Promise(t=>setTimeout(t,c));exports.PktDatepicker=class extends k.PktInputElement{constructor(){super(),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.dateformat=o.props.dateformat.default,this.multiple=o.props.multiple.default,this.maxlength=null,this.range=o.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=o.props.weeknumbers.default,this.withcontrols=o.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.buttonClasses={},this.inputRef=r.e(),this.inputRefTo=r.e(),this.btnRef=r.e(),this.calRef=r.e(),this.popupRef=r.e(),this.helptextSlot=r.e(),this.addToSelected=t=>{const e=t.target;if(!e.value)return;const i=this.min?h.newDate(this.min):null,a=this.max?h.newDate(this.max):null,n=h.newDate(e.value.split(",")[0]);n&&!isNaN(n.getTime())&&(!i||n>=i)&&(!a||n<=a)&&this.calRef.value&&this.calRef.value.handleDateSelect(n),e.value=""},this.slotController=new $.PktSlotController(this,this.helptextSlot)}async connectedCallback(){super.connectedCallback();const t=navigator.userAgent,e=/iP(hone|od|ad)/.test(t);this.inputType=e?"text":"date",document&&document.body.addEventListener("click",i=>{var a,n;(a=this.inputRef)!=null&&a.value&&((n=this.btnRef)!=null&&n.value)&&!this.inputRef.value.contains(i.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(i.target))&&!this.btnRef.value.contains(i.target)&&!i.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||o.props.min.default,this.max=this.max||o.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await g(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",t=>{var e,i;(e=this.inputRef)!=null&&e.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(t.target)&&!this.btnRef.value.contains(t.target)&&this.hideCalendar()})}attributeChangedCallback(t,e,i){if(t==="value"){if(this.range&&(i==null?void 0:i.split(",").length)===1)return;this.value!==e&&this.valueChanged(i,e)}t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(i==null?void 0:i.split(","))??[]),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(i==null?void 0:i.split(","))??[]),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){if(this.range&&this.value.length===1)return;this.valueChanged(this.value,t.get("value"))}super.updated(t)}renderInput(){return s.x`
1
+ "use strict";const d=require("./class-map-DWDPOqjO.cjs"),p=require("./if-defined-C8eotHpL.cjs"),s=require("./element-90YeMNbV.cjs"),m=require("./state-D-Recv7U.cjs"),h=require("./calendar-D4qfcRtv.cjs"),k=require("./input-element-CInrWeac.cjs"),r=require("./ref-B-w1vCo8.cjs"),v=require("./repeat-CxQA3AeF.cjs");require("./icon-B1_BRNqf.cjs");require("./input-wrapper-Uw7_cZ4w.cjs");require("./tag-lU4vz70a.cjs");const $=require("./pkt-slot-controller-Da-RgXfS.cjs"),y={dateformat:{default:"dd.MM.yyyy"},min:{default:null},max:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},o={props:y};var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var a=i>1?void 0:i?x(t,e):t,n=c.length-1,u;n>=0;n--)(u=c[n])&&(a=(i?u(t,e,a):u(a))||a);return i&&a&&b(t,e,a),a};const g=c=>new Promise(t=>setTimeout(t,c));exports.PktDatepicker=class extends k.PktInputElement{constructor(){super(),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.dateformat=o.props.dateformat.default,this.multiple=o.props.multiple.default,this.maxlength=null,this.range=o.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=o.props.weeknumbers.default,this.withcontrols=o.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.buttonClasses={},this.inputRef=r.e(),this.inputRefTo=r.e(),this.btnRef=r.e(),this.calRef=r.e(),this.popupRef=r.e(),this.helptextSlot=r.e(),this.addToSelected=t=>{const e=t.target;if(!e.value)return;const i=this.min?h.newDate(this.min):null,a=this.max?h.newDate(this.max):null,n=h.newDate(e.value.split(",")[0]);n&&!isNaN(n.getTime())&&(!i||n>=i)&&(!a||n<=a)&&this.calRef.value&&this.calRef.value.handleDateSelect(n),e.value=""},this.slotController=new $.PktSlotController(this,this.helptextSlot)}async connectedCallback(){super.connectedCallback();const t=navigator.userAgent,e=/iP(hone|od|ad)/.test(t);this.inputType=e?"text":"date",document&&document.body.addEventListener("click",i=>{var a,n;(a=this.inputRef)!=null&&a.value&&((n=this.btnRef)!=null&&n.value)&&!this.inputRef.value.contains(i.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(i.target))&&!this.btnRef.value.contains(i.target)&&!i.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||o.props.min.default,this.max=this.max||o.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await g(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",t=>{var e,i;(e=this.inputRef)!=null&&e.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(t.target)&&!this.btnRef.value.contains(t.target)&&this.hideCalendar()})}attributeChangedCallback(t,e,i){if(t==="value"){if(this.range&&(i==null?void 0:i.split(",").length)===1)return;this.value!==e&&this.valueChanged(i,e)}t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(i==null?void 0:i.split(","))??[]),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(i==null?void 0:i.split(","))??[]),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){if(this.range&&this.value.length===1)return;this.valueChanged(this.value,t.get("value"))}super.updated(t)}renderInput(){return s.x`
2
2
  <input
3
3
  class="${d.e(this.inputClasses)}"
4
4
  .type=${this.inputType}
@@ -2,7 +2,7 @@ import { e as f } from "./class-map-m7ZCZ49w.js";
2
2
  import { o } from "./if-defined-Cj-3Kdsr.js";
3
3
  import { x as u, E as g, n as r, a as w } from "./element-gAd63VwC.js";
4
4
  import { r as k } from "./state-BxrO4zNJ.js";
5
- import { n as v, f as $, a as R, b as y, d as x } from "./calendar-Beno8yU7.js";
5
+ import { n as v, f as $, a as R, b as y, d as x } from "./calendar-Df6-FDRW.js";
6
6
  import { P as C } from "./input-element-BEvaQK4g.js";
7
7
  import { e as m, n as p } from "./ref-DnSbnXsj.js";
8
8
  import { c as T } from "./repeat-lUFq9w5d.js";
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ import { ReactiveController } from 'lit';
6
6
  import { ReactiveControllerHost } from 'lit';
7
7
  import { Ref } from 'lit/directives/ref.js';
8
8
  import { TemplateResult } from 'lit-html';
9
- import { TZDate } from '@date-fns/tz';
10
9
 
11
10
  declare type Booleanish = boolean | 'true' | 'false';
12
11
 
@@ -188,8 +187,13 @@ export declare interface IPktComboboxOption {
188
187
  }
189
188
 
190
189
  export declare interface IPktConsent {
190
+ devMode?: boolean;
191
+ cookieDomain?: string | null;
192
+ cookieSecure?: string | null;
193
+ cookieExpiryDays?: string | null;
191
194
  hotjarId?: string | null;
192
195
  googleAnalyticsId?: string | null;
196
+ i18nLanguage?: string;
193
197
  triggerType?: 'button' | 'link' | 'footerlink' | 'icon' | null;
194
198
  triggerText?: string | null;
195
199
  }
@@ -447,12 +451,12 @@ export declare class PktCalendar extends PktElement {
447
451
  private isInRange;
448
452
  private isRangeAllowed;
449
453
  private emptySelected;
450
- addToSelected(selectedDate: TZDate): void;
451
- removeFromSelected(selectedDate: TZDate): void;
452
- toggleSelected(selectedDate: TZDate): void;
454
+ addToSelected(selectedDate: Date): void;
455
+ removeFromSelected(selectedDate: Date): void;
456
+ toggleSelected(selectedDate: Date): void;
453
457
  private handleRangeSelect;
454
458
  private handleRangeHover;
455
- handleDateSelect(selectedDate: TZDate | null): Promise<void> | undefined;
459
+ handleDateSelect(selectedDate: Date | null): Promise<void> | undefined;
456
460
  focusOnCurrentDate(): void;
457
461
  closeEvent(e: FocusEvent): void;
458
462
  close(): void;
@@ -616,16 +620,22 @@ export declare class PktComponent extends PktElement {
616
620
  }
617
621
 
618
622
  export declare class PktConsent extends PktElement<IPktConsent> implements IPktConsent {
623
+ private _cookieEventHandler?;
624
+ devMode: boolean;
619
625
  hotjarId: string | null;
620
626
  googleAnalyticsId: string | null;
627
+ cookieDomain: string | null;
628
+ cookieSecure: string | null;
629
+ cookieExpiryDays: string | null;
621
630
  triggerType: 'button' | 'link' | 'footerlink' | 'icon' | null;
622
631
  triggerText: string | null;
623
632
  i18nLanguage: string;
624
633
  constructor();
625
634
  connectedCallback(): void;
635
+ disconnectedCallback(): void;
626
636
  returnJsonOrObject(obj: any): any;
627
637
  emitCookieConsents(consent: any): void;
628
- protected firstUpdated(_changedProperties: PropertyValues): void;
638
+ protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
629
639
  triggerInit(): void;
630
640
  openModal(e: Event): void;
631
641
  render(): TemplateResult<1>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./calendar-BDeaGBaH.cjs"),t=e.PktCalendar;Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./calendar-D4qfcRtv.cjs"),t=e.PktCalendar;Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as a } from "./calendar-Beno8yU7.js";
1
+ import { P as a } from "./calendar-Df6-FDRW.js";
2
2
  const r = a;
3
3
  export {
4
4
  a as PktCalendar,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-BxW5wREE.cjs"),o=e.PktCombobox;Object.defineProperty(exports,"PktCombobox",{enumerable:!0,get:()=>e.PktCombobox});exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-Bsj1W0ad.cjs"),o=e.PktCombobox;Object.defineProperty(exports,"PktCombobox",{enumerable:!0,get:()=>e.PktCombobox});exports.default=o;
@@ -1,4 +1,4 @@
1
- import { P as o } from "./combobox-C57pmfdV.js";
1
+ import { P as o } from "./combobox-j5xdN9KE.js";
2
2
  const b = o;
3
3
  export {
4
4
  o as PktCombobox,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-D1r9LYda.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-B7w1--m7.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./consent-a09DlJZT.js";
1
+ import { P as t } from "./consent-ChCTj6FB.js";
2
2
  const o = t;
3
3
  export {
4
4
  t as PktConsent,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-CNAYXlJe.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-CE5oM9D3.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./datepicker-iS8pezF5.js";
1
+ import { P as t } from "./datepicker-Cf45KOxr.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktDatepicker,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-BY97zZYx.cjs"),l=require("./accordionitem-Dz6jwPpb.cjs"),d=require("./backlink-CcAZfB1d.cjs"),b=require("./button-KzBZ-Bff.cjs"),k=require("./calendar-BDeaGBaH.cjs"),m=require("./card-CmdIb2X9.cjs"),g=require("./combobox-BxW5wREE.cjs"),h=require("./consent-D1r9LYda.cjs"),f=require("./checkbox-CiXWukkL.cjs"),t=require("./element-90YeMNbV.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-B-w1vCo8.cjs"),O=require("./class-map-DWDPOqjO.cjs"),j=require("./datepicker-CNAYXlJe.cjs"),q=require("./helptext-AqNI_oFG.cjs"),x=require("./heading-CxJ0IqpU.cjs"),C=require("./icon-B1_BRNqf.cjs"),v=require("./input-wrapper-Uw7_cZ4w.cjs"),S=require("./link-BWJrqWi7.cjs"),$=require("./linkcard-0KLDuaGM.cjs"),L=require("./loader--5h6NKGl.cjs"),_=require("./messagebox-IJOkv427.cjs"),A=require("./modal-CBURcXBd.cjs"),B=require("./progressbar-BrXtjUvh.cjs"),p=require("./radiobutton-x10h-JEh.cjs"),T=require("./tag-lU4vz70a.cjs"),I=require("./textarea-DcpZnWkt.cjs"),M=require("./textinput-DcES1ibY.cjs"),R=require("./select-BkwZL7mg.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new y.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-BY97zZYx.cjs"),l=require("./accordionitem-Dz6jwPpb.cjs"),d=require("./backlink-CcAZfB1d.cjs"),b=require("./button-KzBZ-Bff.cjs"),k=require("./calendar-D4qfcRtv.cjs"),m=require("./card-CmdIb2X9.cjs"),g=require("./combobox-Bsj1W0ad.cjs"),h=require("./consent-B7w1--m7.cjs"),f=require("./checkbox-CiXWukkL.cjs"),t=require("./element-90YeMNbV.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-B-w1vCo8.cjs"),O=require("./class-map-DWDPOqjO.cjs"),j=require("./datepicker-CE5oM9D3.cjs"),q=require("./helptext-AqNI_oFG.cjs"),x=require("./heading-CxJ0IqpU.cjs"),C=require("./icon-B1_BRNqf.cjs"),v=require("./input-wrapper-Uw7_cZ4w.cjs"),S=require("./link-BWJrqWi7.cjs"),$=require("./linkcard-0KLDuaGM.cjs"),L=require("./loader--5h6NKGl.cjs"),_=require("./messagebox-IJOkv427.cjs"),A=require("./modal-CBURcXBd.cjs"),B=require("./progressbar-BrXtjUvh.cjs"),p=require("./radiobutton-x10h-JEh.cjs"),T=require("./tag-lU4vz70a.cjs"),I=require("./textarea-DcpZnWkt.cjs"),M=require("./textinput-DcES1ibY.cjs"),R=require("./select-BkwZL7mg.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new y.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${O.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -2,17 +2,17 @@ import { P as A } from "./alert-oh7nc3ip.js";
2
2
  import { P as B, a as E } from "./accordionitem-DkE9or0K.js";
3
3
  import { P as O } from "./backlink-BnlrDl9O.js";
4
4
  import { P as T } from "./button-OLSvT2Im.js";
5
- import { c as f } from "./calendar-Beno8yU7.js";
6
- import { P as D } from "./calendar-Beno8yU7.js";
5
+ import { c as f } from "./calendar-Df6-FDRW.js";
6
+ import { P as D } from "./calendar-Df6-FDRW.js";
7
7
  import { P as G } from "./card-BxHlJq4J.js";
8
- import { P as K } from "./combobox-C57pmfdV.js";
9
- import { P as U } from "./consent-a09DlJZT.js";
8
+ import { P as K } from "./combobox-j5xdN9KE.js";
9
+ import { P as U } from "./consent-ChCTj6FB.js";
10
10
  import { P as q } from "./checkbox-B67_cfqW.js";
11
11
  import { P as k, t as h, x as P, n, a as c } from "./element-gAd63VwC.js";
12
12
  import { P as x } from "./pkt-slot-controller-DtDaD9q_.js";
13
13
  import { e as m, n as d } from "./ref-DnSbnXsj.js";
14
14
  import { e as u } from "./class-map-m7ZCZ49w.js";
15
- import { P as F } from "./datepicker-iS8pezF5.js";
15
+ import { P as F } from "./datepicker-Cf45KOxr.js";
16
16
  import { P as Q } from "./helptext-DBearL3P.js";
17
17
  import { P as X } from "./heading-Bxonbv8M.js";
18
18
  import { P as Z } from "./icon-CO1TLSs5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.42.3",
3
+ "version": "12.42.5",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -23,7 +23,6 @@
23
23
  "dependencies": {
24
24
  "@date-fns/tz": "^1.2.0",
25
25
  "@lit-labs/router": "^0.1.3",
26
- "@oslokommune/cookie-manager": "^1.1.0",
27
26
  "date-fns": "^4.1.0",
28
27
  "dialog-polyfill": "^0.5.6",
29
28
  "lit": "^3.3.0",
@@ -32,7 +31,7 @@
32
31
  },
33
32
  "devDependencies": {
34
33
  "@oslokommune/punkt-assets": "^12.39.2",
35
- "@oslokommune/punkt-css": "^12.42.3",
34
+ "@oslokommune/punkt-css": "^12.42.5",
36
35
  "sass": "^1.78.0",
37
36
  "typescript": "^5.6.2",
38
37
  "vite": "^5.4.18",
@@ -59,5 +58,5 @@
59
58
  "url": "https://github.com/oslokommune/punkt/issues"
60
59
  },
61
60
  "license": "MIT",
62
- "gitHead": "892aacec2a4994677e7da4c3535820ce42048d15"
61
+ "gitHead": "568e687d99deef74b129835c9fd66b14b5dd3b7f"
63
62
  }