@oslokommune/punkt-elements 12.37.1 → 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 +17 -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-iCBnadXj.cjs → button-jdMbbn-e.cjs} +1 -1
- package/dist/{button-BYZHwPtW.js → button-sf_Yzx3X.js} +1 -1
- package/dist/{card-B5zTEmH1.js → card-Cyww1yKr.js} +2 -2
- package/dist/{card-BDcr3PII.cjs → card-DH-3qNgp.cjs} +1 -1
- package/dist/{combobox-Bsaj6Z6Y.js → combobox-CFH5-Ioh.js} +4 -4
- package/dist/{combobox-AbD1tkKx.cjs → combobox-ChFttX7F.cjs} +1 -1
- package/dist/{consent-CFgCfRsF.cjs → consent-BNY1XvpV.cjs} +1 -1
- package/dist/{consent-B888aPfK.js → consent-CTX9zf81.js} +6 -6
- package/dist/{datepicker-cNYYOtBI.js → datepicker-hetVXVX4.js} +3 -3
- package/dist/{datepicker-BAn16Z8U.cjs → datepicker-mhQrHoNJ.cjs} +1 -1
- 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 +1 -0
- 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-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 +20 -20
- 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-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/{select-BO7s0ym6.js → select-CNK8uoVi.js} +3 -3
- package/dist/{select-CsrHon8V.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-BdjszjRh.js → textarea-C9Kj6gGv.js} +2 -2
- package/dist/{textarea-vr4tUfJ3.cjs → textarea-CeUz6coA.cjs} +1 -1
- package/dist/{textinput-DTKG8h7M.cjs → textinput-BArDDwC2.cjs} +1 -1
- package/dist/{textinput-D-hYhwtS.js → textinput-Dj6R0L45.js} +2 -2
- package/package.json +4 -3
- package/src/components/consent/consent.ts +1 -1
- package/src/components/modal/modal.ts +14 -2
- package/dist/modal-OC0efchb.cjs +0 -33
- package/dist/pkt-slot-controller-plQxXRvV.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ 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
|
+
|
|
8
25
|
## [12.37.1](https://github.com/oslokommune/punkt/compare/12.37.0...12.37.1) (2025-05-06)
|
|
9
26
|
|
|
10
27
|
### ⚠ 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--)
|
|
@@ -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">
|
|
@@ -5,11 +5,11 @@ 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
7
|
import { P as V } from "./input-element-aQDMXDVQ.js";
|
|
8
|
-
import { P as C } from "./pkt-options-controller-
|
|
9
|
-
import { P as S } from "./pkt-slot-controller-
|
|
10
|
-
import "./input-wrapper-
|
|
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-XmmyUZmB.cjs"),y=require("./pkt-options-controller-
|
|
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
|
|
@@ -7,9 +7,9 @@ import { P as C } from "./input-element-aQDMXDVQ.js";
|
|
|
7
7
|
import { e as m, n as p } from "./ref-iIffqQAI.js";
|
|
8
8
|
import { c as T } from "./repeat-D4kMediE.js";
|
|
9
9
|
import "./icon-Beoxup8E.js";
|
|
10
|
-
import "./input-wrapper-
|
|
11
|
-
import "./tag-
|
|
12
|
-
import { P as _ } from "./pkt-slot-controller-
|
|
10
|
+
import "./input-wrapper-BdeoMGnk.js";
|
|
11
|
+
import "./tag-Cu8afZy8.js";
|
|
12
|
+
import { P as _ } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
13
13
|
const S = {
|
|
14
14
|
dateformat: {
|
|
15
15
|
default: "dd.MM.yyyy"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const d=require("./class-map-DCyaICmy.cjs"),p=require("./if-defined-a3sotaUr.cjs"),s=require("./element-BSypUpzA.cjs"),m=require("./state-B5KCNjEd.cjs"),h=require("./calendar-CYY42kN4.cjs"),k=require("./input-element-XmmyUZmB.cjs"),r=require("./ref-BvbyvXRH.cjs"),v=require("./repeat-BnuruAat.cjs");require("./icon-BnKGwYjj.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const d=require("./class-map-DCyaICmy.cjs"),p=require("./if-defined-a3sotaUr.cjs"),s=require("./element-BSypUpzA.cjs"),m=require("./state-B5KCNjEd.cjs"),h=require("./calendar-CYY42kN4.cjs"),k=require("./input-element-XmmyUZmB.cjs"),r=require("./ref-BvbyvXRH.cjs"),v=require("./repeat-BnuruAat.cjs");require("./icon-BnKGwYjj.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./tag-B9kFYxHg.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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var d=window.CustomEvent;(!d||typeof d=="object")&&(d=function(t,o){o=o||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),i},d.prototype=window.Event.prototype);function g(e,t){var o="on"+t.type.toLowerCase();return typeof e[o]=="function"&&e[o](t),e.dispatchEvent(t)}function E(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(i,a){return!(t[i]===void 0||t[i]===a)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function c(e){for(;e;){if(e.localName==="dialog")return e;e.parentElement?e=e.parentElement:e.parentNode?e=e.parentNode.host:e=null}return null}function b(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function M(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function h(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function v(e){var t=["button","input","keygen","select","textarea"],o=t.map(function(s){return s+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=e.querySelector(o.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var a=e.querySelectorAll("*"),r=0;r<a.length&&!(a[r].tagName&&a[r].shadowRoot&&(i=v(a[r].shadowRoot),i));r++);return i}function m(e){return e.isConnected||document.body.contains(e)}function y(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var o=n.formSubmitter;if(!o){var i=e.target,a="getRootNode"in i&&i.getRootNode()||document;o=a.activeElement}return!o||o.form!==t?null:o}function D(e){if(!e.defaultPrevented){var t=e.target,o=n.imagemapUseValue,i=y(e);o===null&&i&&(o=i.value);var a=c(t);if(a){var r=i&&i.getAttribute("formmethod")||t.getAttribute("method");r==="dialog"&&(e.preventDefault(),o!=null?a.close(o):a.close())}}}function _(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener("submit",D,!1),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,i=(function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}).bind(this),a,r=function(s){if(s.target===e){var u="DOMNodeRemoved";o|=s.type.substr(0,u.length)===u,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(s){e.addEventListener(s,r)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}_.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&m(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),n.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||(e=v(this.dialog_)),b(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!m(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!n.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");E(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,n.needsCentering(this.dialog_)?(n.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new d("close",{bubbles:!1,cancelable:!1});g(this.dialog_,t)}};var n={};n.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};n.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],i=null;try{i=o.cssRules}catch{}if(i)for(var a=0;a<i.length;++a){var r=i[a],s=null;try{s=document.querySelectorAll(r.selectorText)}catch{}if(!(!s||!M(s,e))){var u=r.style.getPropertyValue("top"),f=r.style.getPropertyValue("bottom");if(u&&u!=="auto"||f&&f!=="auto")return!0}}}return!1};n.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!n.isInlinePositionSetByStylesheet(e)};n.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new _(e)};n.registerDialog=function(e){e.showModal||n.forceRegisterDialog(e)};n.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(i){for(var a=0,r;r=i.removedNodes[a];++a){if(r instanceof Element)r.localName==="dialog"&&o.push(r);else continue;o=o.concat(r.querySelectorAll("dialog"))}}),o.length&&e(o)}))};n.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};n.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};n.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var i=this.pendingDialogStack[0];if(i){var a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};n.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=c(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};n.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),b(t),this.forwardTab_!==void 0)){var o=this.pendingDialogStack[0],i=o.dialog,a=i.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?o.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}};n.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new d("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&g(o.dialog,t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};n.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};n.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};n.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};n.dm=new n.DialogManager;n.formSubmitter=null;n.imagemapUseValue=null;if(window.HTMLDialogElement===void 0){var p=document.createElement("form");if(p.setAttribute("method","dialog"),p.method!=="dialog"){var l=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(l){var k=l.get;l.get=function(){return h(this)?"dialog":k.call(this)};var S=l.set;l.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):S.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",l)}}document.addEventListener("click",function(e){if(n.formSubmitter=null,n.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if("composedPath"in e){var o=e.composedPath();t=o.shift()||t}if(!(!t||!h(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;n.imagemapUseValue=e.offsetX+","+e.offsetY}var a=c(t);a&&(n.formSubmitter=t)}}},!1),document.addEventListener("submit",function(e){var t=e.target,o=c(t);if(!o){var i=y(e),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&e.preventDefault()}});var T=HTMLFormElement.prototype.submit,x=function(){if(!h(this))return T.call(this);var e=c(this);e&&e.close()};HTMLFormElement.prototype.submit=x}exports.default=n;
|