@oslokommune/punkt-elements 12.37.0 → 12.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/{accordionitem-cvsySqgK.cjs → accordionitem-RFwXQC_0.cjs} +1 -1
- package/dist/{accordionitem-Db-3WiJS.js → accordionitem-vmwqD9rr.js} +1 -1
- package/dist/{alert-DWIElKEZ.cjs → alert-C2EPmB0W.cjs} +1 -1
- package/dist/{alert-B5lVS6Qs.js → alert-C33z1kBf.js} +1 -1
- package/dist/{button-BNdVIhUp.cjs → button-jdMbbn-e.cjs} +1 -1
- package/dist/{button-B6uRE7uT.js → button-sf_Yzx3X.js} +2 -2
- package/dist/{card-B5zTEmH1.js → card-Cyww1yKr.js} +2 -2
- package/dist/{card-BDcr3PII.cjs → card-DH-3qNgp.cjs} +1 -1
- package/dist/{checkbox-CyYfA2fu.js → checkbox-Cz3sIWt0.js} +1 -1
- package/dist/{checkbox-CqatE-eX.cjs → checkbox-U8aPrLjG.cjs} +1 -1
- package/dist/{combobox-CELUAZxF.js → combobox-CFH5-Ioh.js} +5 -5
- package/dist/{combobox-D9NKnao2.cjs → combobox-ChFttX7F.cjs} +1 -1
- package/dist/{consent-jXR0vKAu.cjs → consent-BNY1XvpV.cjs} +1 -1
- package/dist/{consent-Baktq_-1.js → consent-CTX9zf81.js} +6 -6
- package/dist/{datepicker-CpkTwszH.js → datepicker-hetVXVX4.js} +118 -105
- package/dist/{datepicker-cR9MtXOh.cjs → datepicker-mhQrHoNJ.cjs} +16 -16
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +1 -0
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +395 -0
- package/dist/{heading-CP3NaeWE.cjs → heading-BnJhJDMD.cjs} +1 -1
- package/dist/{heading-BkC05ohM.js → heading-DNLQdsXY.js} +1 -1
- package/dist/{helptext-BLHAJ1aC.js → helptext-DcSUjjEq.js} +1 -1
- package/dist/{helptext-CCnYxYA9.cjs → helptext-bMgnhZ1R.cjs} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/input-element-XmmyUZmB.cjs +1 -0
- package/dist/{input-element-Bic-t96S.js → input-element-aQDMXDVQ.js} +31 -26
- package/dist/{input-wrapper-Cn929YTV.cjs → input-wrapper-B-f_SotM.cjs} +1 -1
- package/dist/{input-wrapper-CeeNYbDA.js → input-wrapper-BdeoMGnk.js} +2 -2
- package/dist/{link-BYI8VNGd.js → link-B748tCGi.js} +1 -1
- package/dist/{link-CnibgS3c.cjs → link-BrDbM3GT.cjs} +1 -1
- package/dist/{linkcard--zuuAt_v.js → linkcard-Bt-Qa_SP.js} +1 -1
- package/dist/{linkcard-DPGX1kb1.cjs → linkcard-s9yoOq90.cjs} +1 -1
- package/dist/{loader-BN4q8pSl.cjs → loader-Bk4XPiOY.cjs} +1 -1
- package/dist/{loader-DgIiyYBl.js → loader-C9EtX_mK.js} +1 -1
- package/dist/{messagebox-BWJr42m9.cjs → messagebox-B0kgftoP.cjs} +1 -1
- package/dist/{messagebox-cme5VbUM.js → messagebox-DZDP8XZt.js} +1 -1
- package/dist/modal-4aQZVxGl.cjs +33 -0
- package/dist/{modal-DIwagdAc.js → modal-m--Sfj_1.js} +14 -9
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +22 -22
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-TJ1apYGF.cjs → pkt-options-controller-Ay9ELZTV.cjs} +1 -1
- package/dist/{pkt-options-controller-CFmzX4xL.js → pkt-options-controller-DepYQBqb.js} +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-slot-controller-Da-RgXfS.cjs +1 -0
- package/dist/{pkt-slot-controller-DFrc5O93.js → pkt-slot-controller-DtDaD9q_.js} +19 -19
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{radiobutton-CIW0FvT8.cjs → radiobutton-DtL-nc1b.cjs} +1 -1
- package/dist/{radiobutton-DtHuz7qn.js → radiobutton-DtpGqoci.js} +1 -1
- package/dist/{select-DbRLz-7l.js → select-CNK8uoVi.js} +4 -4
- package/dist/{select-BJziJVde.cjs → select-s98KeDqQ.cjs} +1 -1
- package/dist/{tag-CgkUxA5D.cjs → tag-B9kFYxHg.cjs} +1 -1
- package/dist/{tag-CGnj4c1Z.js → tag-Cu8afZy8.js} +1 -1
- package/dist/{textarea-CiA4IzMs.js → textarea-C9Kj6gGv.js} +3 -3
- package/dist/{textarea-qX4Inr1X.cjs → textarea-CeUz6coA.cjs} +1 -1
- package/dist/{textinput-BlsgLNwW.cjs → textinput-BArDDwC2.cjs} +4 -3
- package/dist/{textinput-CrxjZNEq.js → textinput-Dj6R0L45.js} +33 -26
- package/package.json +4 -3
- package/src/components/button/button.ts +1 -0
- package/src/components/consent/consent.ts +1 -1
- package/src/components/datepicker/datepicker.ts +36 -4
- package/src/components/modal/modal.ts +14 -2
- package/src/components/textinput/textinput.ts +10 -0
- package/dist/input-element-C9ma8cdz.cjs +0 -1
- package/dist/modal-OC0efchb.cjs +0 -33
- package/dist/pkt-slot-controller-plQxXRvV.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.37.2](https://github.com/oslokommune/punkt/compare/12.37.1...12.37.2) (2025-05-08)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [12.37.1](https://github.com/oslokommune/punkt/compare/12.37.0...12.37.1) (2025-05-06)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
Ingen
|
|
35
|
+
|
|
36
|
+
### Chores
|
|
37
|
+
Ingen
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
8
42
|
## [12.37.0](https://github.com/oslokommune/punkt/compare/12.36.2...12.37.0) (2025-05-05)
|
|
9
43
|
|
|
10
44
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./class-map-DCyaICmy.cjs"),m=require("./pkt-slot-controller-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./class-map-DCyaICmy.cjs"),m=require("./pkt-slot-controller-Da-RgXfS.cjs"),d=require("./ref-BvbyvXRH.cjs");var f=Object.defineProperty,k=Object.getOwnPropertyDescriptor,u=(o,i,n,r)=>{for(var t=r>1?void 0:r?k(i,n):i,s=o.length-1,a;s>=0;s--)(a=o[s])&&(t=(r?a(i,n,t):a(t))||t);return r&&t&&f(i,n,t),t};let l=class extends e.i{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless"}updated(o){o.has("skin")&&this.requestUpdate()}render(){const o={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e.x`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
4
|
class=${h.e(o)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as k, x as u, n as s, a as f, P as _ } from "./element-DjjF_tEh.js";
|
|
2
2
|
import { e as y } from "./class-map-KyMqi0fa.js";
|
|
3
|
-
import { P as v } from "./pkt-slot-controller-
|
|
3
|
+
import { P as v } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
4
4
|
import { e as m, n as h } from "./ref-iIffqQAI.js";
|
|
5
5
|
var $ = Object.defineProperty, P = Object.getOwnPropertyDescriptor, d = (e, o, c, i) => {
|
|
6
6
|
for (var t = i > 1 ? void 0 : i ? P(o, c) : o, a = e.length - 1, n; a >= 0; a--)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-DCyaICmy.cjs"),e=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),h=require("./pkt-slot-controller-
|
|
1
|
+
"use strict";const c=require("./class-map-DCyaICmy.cjs"),e=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),h=require("./pkt-slot-controller-Da-RgXfS.cjs"),d=require("./ref-BvbyvXRH.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-BnKGwYjj.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:v};var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(o,t,s,l)=>{for(var r=l>1?void 0:l?_(t,s):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(r=(l?n(t,s,r):n(r))||r);return l&&r&&f(t,s,r),r};exports.PktAlert=class extends e.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,s,l){t==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(t,s,l)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.x`
|
|
2
2
|
<div class=${c.e(t)}>
|
|
3
3
|
<div class=${c.e(s)}>
|
|
4
4
|
<pkt-icon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as u } from "./class-map-KyMqi0fa.js";
|
|
2
2
|
import { P as f, E as h, x as p, n as l, a as v } from "./element-DjjF_tEh.js";
|
|
3
3
|
import { r as k } from "./state-BtbpSrdV.js";
|
|
4
|
-
import { P as m } from "./pkt-slot-controller-
|
|
4
|
+
import { P as m } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
5
5
|
import { e as _, n as b } from "./ref-iIffqQAI.js";
|
|
6
6
|
import { u as C } from "./classutils-RQs1k6D9.js";
|
|
7
7
|
import "./icon-Beoxup8E.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./pkt-slot-controller-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./pkt-slot-controller-Da-RgXfS.cjs"),d=require("./ref-BvbyvXRH.cjs");var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(r,t,s,o)=>{for(var n=o>1?void 0:o?u(t,s):t,a=r.length-1,l;a>=0;a--)(l=r[a])&&(n=(o?l(t,s,n):l(n))||n);return o&&n&&p(t,s,n),n};exports.PktButton=class extends e.PktElement{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(t){super.updated(t),this.setAttribute("role","button"),this.internals.role="button",this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return e.x`
|
|
2
2
|
<div class="pkt-contents">
|
|
3
3
|
${this.isLoading?e.x`<pkt-icon
|
|
4
4
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as s, P as c, E as p, x as l, a as u } from "./element-DjjF_tEh.js";
|
|
2
|
-
import { P as b } from "./pkt-slot-controller-
|
|
2
|
+
import { P as b } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
3
3
|
import { e as f, n as k } from "./ref-iIffqQAI.js";
|
|
4
4
|
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, e = (t, n, r, o) => {
|
|
5
5
|
for (var a = o > 1 ? void 0 : o ? y(n, r) : n, d = t.length - 1, h; d >= 0; d--)
|
|
@@ -15,7 +15,7 @@ let i = class extends c {
|
|
|
15
15
|
super.disconnectedCallback(), this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeydown);
|
|
16
16
|
}
|
|
17
17
|
updated(t) {
|
|
18
|
-
super.updated(t), this.setAttribute("role", "button"), this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.removeAttribute("aria-disabled")), this.isLoading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), this.updateElementClasses();
|
|
18
|
+
super.updated(t), this.setAttribute("role", "button"), this.internals.role = "button", this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.removeAttribute("aria-disabled")), this.isLoading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), this.updateElementClasses();
|
|
19
19
|
}
|
|
20
20
|
// Render
|
|
21
21
|
render() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { e as m } from "./class-map-KyMqi0fa.js";
|
|
2
2
|
import { o as d } from "./if-defined-BErSJCeJ.js";
|
|
3
3
|
import { P as u, E as g, x as i, n as a, a as f } from "./element-DjjF_tEh.js";
|
|
4
|
-
import { P as k } from "./pkt-slot-controller-
|
|
4
|
+
import { P as k } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
5
5
|
import { e as $, n as v } from "./ref-iIffqQAI.js";
|
|
6
6
|
import "./icon-Beoxup8E.js";
|
|
7
|
-
import "./tag-
|
|
7
|
+
import "./tag-Cu8afZy8.js";
|
|
8
8
|
const y = {
|
|
9
9
|
skin: {
|
|
10
10
|
default: "outlined"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("./class-map-DCyaICmy.cjs"),d=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),u=require("./pkt-slot-controller-
|
|
1
|
+
"use strict";const h=require("./class-map-DCyaICmy.cjs"),d=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),u=require("./pkt-slot-controller-Da-RgXfS.cjs"),l=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");const k={skin:{default:"outlined"},direction:{default:"portrait"}},p={props:k};var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,s=(n,i,e,a)=>{for(var r=a>1?void 0:a?f(i,e):i,c=n.length-1,o;c>=0;c--)(o=n[c])&&(r=(a?o(i,e,r):o(r))||r);return a&&r&&g(i,e,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=l.e(),this.skin=p.props.skin.default,this.direction=p.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new u.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=${h.e(i)}>
|
|
3
3
|
${this.image.src&&t.x`
|
|
4
4
|
<div class="pkt-card__image">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as n, x as r, n as s, a as d } from "./element-DjjF_tEh.js";
|
|
2
|
-
import { P as k } from "./input-element-
|
|
2
|
+
import { P as k } from "./input-element-aQDMXDVQ.js";
|
|
3
3
|
import { e as b, n as f } from "./ref-iIffqQAI.js";
|
|
4
4
|
import { e as u } from "./class-map-KyMqi0fa.js";
|
|
5
5
|
var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, h, c, l) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-XmmyUZmB.cjs"),k=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var r=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c=(l,t,s,h)=>{for(var i=h>1?void 0:h?u(t,s):t,n=l.length-1,p;n>=0;n--)(p=l[n])&&(i=(h?p(t,s,i):p(i))||i);return h&&i&&r(t,s,i),i};exports.PktCheckbox=class extends a.PktInputElement{constructor(){super(...arguments),this.inputRef=k.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,s,h){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,s,h)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}render(){const t=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),s=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),h=o.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i=()=>e.x`
|
|
2
2
|
<label class=${h} for=${this.id+"-internal"}>
|
|
3
3
|
${this.label}
|
|
4
4
|
${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
|
|
@@ -4,12 +4,12 @@ import { r as c } from "./state-BtbpSrdV.js";
|
|
|
4
4
|
import { e as _, n as v } from "./ref-iIffqQAI.js";
|
|
5
5
|
import { e as k } from "./class-map-KyMqi0fa.js";
|
|
6
6
|
import { c as R } from "./repeat-D4kMediE.js";
|
|
7
|
-
import { P as V } from "./input-element-
|
|
8
|
-
import { P as C } from "./pkt-options-controller-
|
|
9
|
-
import { P as S } from "./pkt-slot-controller-
|
|
10
|
-
import "./input-wrapper-
|
|
7
|
+
import { P as V } from "./input-element-aQDMXDVQ.js";
|
|
8
|
+
import { P as C } from "./pkt-options-controller-DepYQBqb.js";
|
|
9
|
+
import { P as S } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
10
|
+
import "./input-wrapper-BdeoMGnk.js";
|
|
11
11
|
import "./icon-Beoxup8E.js";
|
|
12
|
-
import "./tag-
|
|
12
|
+
import "./tag-Cu8afZy8.js";
|
|
13
13
|
import "./listbox-C1oYnM-t.js";
|
|
14
14
|
const T = {
|
|
15
15
|
displayValueAs: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("./element-BSypUpzA.cjs"),c=require("./if-defined-a3sotaUr.cjs"),d=require("./state-B5KCNjEd.cjs"),r=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),I=require("./repeat-BnuruAat.cjs"),w=require("./input-element-
|
|
1
|
+
"use strict";const l=require("./element-BSypUpzA.cjs"),c=require("./if-defined-a3sotaUr.cjs"),d=require("./state-B5KCNjEd.cjs"),r=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),I=require("./repeat-BnuruAat.cjs"),w=require("./input-element-XmmyUZmB.cjs"),y=require("./pkt-options-controller-Ay9ELZTV.cjs"),O=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");require("./listbox-DqpGh7eq.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,h=b.length-1,n;h>=0;h--)(n=b[h])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends w.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],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 O.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(t=>{if(!t.textContent&&!t.getAttribute("value"))return null;const i={value:t.getAttribute("value")||t.textContent||"",label:t.textContent||t.getAttribute("value")||""};t.getAttribute("data-prefix")&&(i.prefix=t.getAttribute("data-prefix")||void 0),t.getAttribute("tagskincolor")&&(i.tagSkinColor=t.getAttribute("tagskincolor")),t.getAttribute("description")&&(i.description=t.getAttribute("description")||void 0),i.fulltext=i.value+i.label+(i.prefix||""),e.push(i)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(e){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("options")&&this.options.length&&(this._options=this.options,this._options.forEach(t=>{if(t.value&&!t.label&&(t.label=t.value),t.selected&&!this._value.includes(t.value)){const i=[...this._value];this._value=[...this._value,t.value],this.valueChanged(this._value,i)}t.fulltext=t.value+t.label+(t.prefix||""),t.selected=t.selected||this._value.includes(t.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 l.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./element-BSypUpzA.cjs");require("./button-
|
|
1
|
+
"use strict";const s=require("./element-BSypUpzA.cjs");require("./button-jdMbbn-e.cjs");require("./icon-BnKGwYjj.cjs");const g={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"}}}}},c=globalThis,d=c.__cookieEvents||{events:{},on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)},off(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e))},once(t,e){const n=o=>{this.off(t,n),e(o)};this.on(t,n)},emit(t,e){this.events[t]&&this.events[t].forEach(n=>n(e))}};c.__cookieEvents=d;const k=d;var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(t,e,n,o)=>{for(var i=o>1?void 0:o?u(e,n):e,r=t.length-1,l;r>=0;r--)(l=t[r])&&(i=(o?l(e,n,i):l(i))||i);return o&&i&&p(e,n,i),i};exports.PktConsent=class extends s.PktElement{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||g.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),k.on("CookieManager.setCookie",e=>{this.emitCookieConsents(e)})}emitCookieConsents(e){const o=JSON.parse(e.value).items.reduce((i,r)=>(i[r.name]=r.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:o,bubbles:!0,composed:!0}))}firstUpdated(e){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const n=document.createElement("script");n.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",n.id="oslo-consent-script",n.onload=()=>{this.triggerInit()},document.head.appendChild(n);const o=document.createElement("link");o.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",o.type="text/css",o.rel="stylesheet",o.id="oslo-consent-styles",document.head.appendChild(o)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const o={value:window.cookieBanner.cookieConsent.getConsentCookie().items};this.emitCookieConsents(o)}})}openModal(e){e.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?s.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?s.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
2
2
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
3
3
|
${this.triggerText}
|
|
4
4
|
</a>`:this.triggerType==="icon"?s.x`<pkt-button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as k, x as l, n as a, a as
|
|
2
|
-
import "./button-
|
|
1
|
+
import { P as k, x as l, n as a, a as u } from "./element-DjjF_tEh.js";
|
|
2
|
+
import "./button-sf_Yzx3X.js";
|
|
3
3
|
import "./icon-Beoxup8E.js";
|
|
4
|
-
const
|
|
4
|
+
const h = {
|
|
5
5
|
i18n: {
|
|
6
6
|
nb: {
|
|
7
7
|
contentPresentation: {
|
|
@@ -83,7 +83,7 @@ let i = class extends k {
|
|
|
83
83
|
super(), this.hotjarId = null, this.googleAnalyticsId = null, this.triggerType = "button", this.triggerText = null, this.i18nLanguage = "nb";
|
|
84
84
|
}
|
|
85
85
|
connectedCallback() {
|
|
86
|
-
super.connectedCallback(), this.triggerText = this.triggerText ||
|
|
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
87
|
this.emitCookieConsents(e);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -98,7 +98,7 @@ let i = class extends k {
|
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
100
|
firstUpdated(e) {
|
|
101
|
-
if (!document.querySelector("#oslo-consent-script") && window.location.hostname
|
|
101
|
+
if (!document.querySelector("#oslo-consent-script") && window.location.hostname.toLowerCase().includes("oslo.kommune.no")) {
|
|
102
102
|
window.googleAnalyticsId = this.googleAnalyticsId, window.hotjarId = this.hotjarId;
|
|
103
103
|
const n = document.createElement("script");
|
|
104
104
|
n.src = "https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js", n.id = "oslo-consent-script", n.onload = () => {
|
|
@@ -154,7 +154,7 @@ r([
|
|
|
154
154
|
a({ type: String })
|
|
155
155
|
], i.prototype, "i18nLanguage", 2);
|
|
156
156
|
i = r([
|
|
157
|
-
|
|
157
|
+
u("pkt-consent")
|
|
158
158
|
], i);
|
|
159
159
|
export {
|
|
160
160
|
i as P
|