@oslokommune/punkt-elements 18.5.1 → 18.6.0
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/{accordion-D814csFx.js → accordion-BI-Qiznz.js} +1 -1
- package/dist/{accordion-E0-pLzBq.cjs → accordion-NO9LYXaN.cjs} +2 -2
- package/dist/{alert-DNZtr3gd.js → alert-CayKowTW.js} +2 -2
- package/dist/{alert-DqM9l5as.cjs → alert-HFqn-cvb.cjs} +2 -2
- package/dist/base-elements/input-element.d.ts +2 -0
- package/dist/{button-jJfzE9C7.cjs → button-CIb0IxTg.cjs} +2 -2
- package/dist/{button-Drwt7Qe5.js → button-DWMHtdWk.js} +1 -1
- package/dist/{calendar-Cc0bjLPC.cjs → calendar-CA1mz04B.cjs} +1 -1
- package/dist/{calendar-iXilYFBa.js → calendar-CBghTpkZ.js} +10 -138
- package/dist/{card-BhmJZOGh.js → card-CwvUQj1a.js} +2 -2
- package/dist/{card-D-1JMn_h.cjs → card-b7jjKk6B.cjs} +2 -2
- package/dist/{checkbox--nYvm_Pc.cjs → checkbox-D6j7amKX.cjs} +1 -1
- package/dist/{checkbox-CZTR2qHf.js → checkbox-DcvKYDU2.js} +6 -3
- package/dist/{combobox-CRdBlMz1.cjs → combobox-BT1LB0gl.cjs} +2 -2
- package/dist/{combobox-BNstYIC5.js → combobox-CiT2YvLb.js} +5 -5
- package/dist/components/checkbox/checkbox.d.ts +1 -0
- package/dist/components/heading/heading.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +2 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -0
- package/dist/components/textinput/textinput.d.ts +1 -0
- package/dist/{consent-DaOFbopy.cjs → consent-D1SMUJLs.cjs} +1 -1
- package/dist/{consent-Yvw7gZI_.js → consent-Yt1MpkUy.js} +1 -1
- package/dist/{datepicker-DzTdWHkX.js → datepicker-CqWg6K2N.js} +6 -6
- package/dist/{datepicker-DjvL_Nb8.cjs → datepicker-DIgQrvbZ.cjs} +3 -3
- package/dist/{element-with-slot-MkibfzHp.cjs → element-with-slot-DgtT8lCH.cjs} +1 -1
- package/dist/{element-with-slot-COOwQUxM.js → element-with-slot-GwTT3WRD.js} +1 -1
- package/dist/{fileupload-B8Uhfx2d.js → fileupload-4nTdjPKw.js} +3 -3
- package/dist/{fileupload-BJVYPl8u.cjs → fileupload-BmT5nQX0.cjs} +1 -1
- package/dist/{footer-BGC5PkLa.cjs → footer-CLSihvYS.cjs} +1 -1
- package/dist/{footer-BPxKLaut.js → footer-YrlXRq7e.js} +1 -1
- package/dist/{header-BPzlBRhY.js → header-DU10rGhU.js} +5 -5
- package/dist/{header-CAqegPzW.cjs → header-DybJSDQQ.cjs} +3 -3
- package/dist/{header-menu-DWiPoQ58.js → header-menu-DKAcUFzh.js} +1 -1
- package/dist/{header-menu-DBy7Yrd_.cjs → header-menu-wcnhBSzs.cjs} +1 -1
- package/dist/{heading-NYqciBEJ.js → heading-C23xQS4l.js} +3 -3
- package/dist/heading-OfJKjUi2.cjs +1 -0
- package/dist/{helptext-mf-67-fv.js → helptext-DqdOdYRj.js} +1 -1
- package/dist/{helptext-BwDhf6VB.cjs → helptext-DyHzv2ZG.cjs} +2 -2
- package/dist/{input-element-KpXXnGi0.cjs → input-element-uajHIWAO.cjs} +1 -1
- package/dist/{input-element-DxHRTZ3K.js → input-element-zXKo9jpe.js} +7 -8
- package/dist/{input-wrapper-CS0qrYcm.cjs → input-wrapper-791L3L--.cjs} +3 -3
- package/dist/{input-wrapper-BetB7OLQ.js → input-wrapper-B4TCGGwj.js} +3 -3
- package/dist/{link-DXnoMJIo.cjs → link-BWAhHUku.cjs} +2 -2
- package/dist/{link-DkO7a3Fs.js → link-BvjWWWlc.js} +1 -1
- package/dist/{linkcard-aVKL5JPP.js → linkcard-6CbGf4I_.js} +1 -1
- package/dist/{linkcard-2l6z1M2U.cjs → linkcard-D6fRaZSc.cjs} +2 -2
- package/dist/{loader-D23kzlaR.cjs → loader-B5t78Yk7.cjs} +2 -2
- package/dist/{loader-CRVUJ-HU.js → loader-BS7EJqxD.js} +1 -1
- package/dist/{messagebox-CqI6_Ah7.js → messagebox-Bt0IvUlD.js} +1 -1
- package/dist/{messagebox-DP06cyqc.cjs → messagebox-DBVUz-DN.cjs} +2 -2
- package/dist/{modal-Bh0DGVfN.cjs → modal-C1g2fiUq.cjs} +2 -2
- package/dist/{modal-C7eV5vJr.js → modal-z5RzZ-fr.js} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- 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-calendar.cjs +1 -1
- package/dist/pkt-calendar.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-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.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 +28 -28
- 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-CJPuBqvH.cjs → pkt-options-controller-AFYyv3-b.cjs} +1 -1
- package/dist/{pkt-options-controller-DNDUGQno.js → pkt-options-controller-DKkmDDzT.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-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- 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/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{radiobutton-C3nmL9rA.cjs → radiobutton-BuOLykKo.cjs} +1 -1
- package/dist/{radiobutton-B2e9Vyp8.js → radiobutton-Dr5OQ0IY.js} +1 -1
- package/dist/{select-qxjHJ8bu.cjs → select-Cc7c9dRd.cjs} +2 -2
- package/dist/{select-B7TvZGIL.js → select-Cd_saUE7.js} +4 -4
- package/dist/shared-types/calendar.d.ts +67 -0
- package/dist/shared-types/index.d.ts +2 -1
- package/dist/{tabs-C_tCCdBK.js → tabs-DHvCjUi4.js} +6 -3
- package/dist/{tabs-DBanbSG1.cjs → tabs-DqzPOdi9.cjs} +3 -3
- package/dist/{tag-BDlwKjgT.cjs → tag-Cojf4jgA.cjs} +3 -3
- package/dist/{tag-CdiDs9zb.js → tag-D2Xvsy1i.js} +18 -18
- package/dist/{textarea-YL6JYsB5.js → textarea-MJvpE_yV.js} +7 -4
- package/dist/{textarea-DgFwd2LY.cjs → textarea-xTcafucE.cjs} +2 -2
- package/dist/{textinput-CIxMtaIo.cjs → textinput-B4VnZzsa.cjs} +2 -2
- package/dist/{textinput-CrJYDOHb.js → textinput-Cr7Z9ilH.js} +7 -4
- package/dist/{timepicker-avaMu1hN.cjs → timepicker-85ViMBd6.cjs} +2 -2
- package/dist/{timepicker-BHWOqlr8.js → timepicker-srjt12dI.js} +3 -3
- package/package.json +2 -2
- package/src/components/calendar/calendar.ts +8 -9
- package/src/components/checkbox/checkbox.ts +5 -4
- package/src/components/datepicker/datepicker.ts +1 -1
- package/src/components/heading/heading.ts +9 -13
- package/src/components/tabs/tabs.ts +4 -1
- package/src/components/tag/tag.ts +8 -4
- package/src/components/textarea/textarea.ts +10 -4
- package/src/components/textinput/textinput.ts +10 -4
- package/dist/heading-BAoIzzJO.cjs +0 -1
package/dist/pkt-index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { a as e, i as t, o as n, r, s as i } from "./element-e2MAMNEP.js";
|
|
2
|
-
import { n as a } from "./consent-
|
|
3
|
-
import { n as o } from "./alert-
|
|
2
|
+
import { n as a } from "./consent-Yt1MpkUy.js";
|
|
3
|
+
import { n as o } from "./alert-CayKowTW.js";
|
|
4
4
|
import { n as s } from "./icon-jEFbKTB_.js";
|
|
5
|
-
import { n as c } from "./button-
|
|
6
|
-
import { n as l, r as u } from "./accordion-
|
|
5
|
+
import { n as c } from "./button-DWMHtdWk.js";
|
|
6
|
+
import { n as l, r as u } from "./accordion-BI-Qiznz.js";
|
|
7
7
|
import { n as d } from "./backlink-BHtxOlTw.js";
|
|
8
8
|
import { t as f } from "./breadcrumbs-BlRDuZbZ.js";
|
|
9
|
-
import { n as p } from "./calendar-
|
|
10
|
-
import { n as m } from "./card-
|
|
11
|
-
import { n as h } from "./tag-
|
|
12
|
-
import { n as g } from "./combobox-
|
|
13
|
-
import { i as _, n as v, r as y, t as b } from "./header-
|
|
14
|
-
import { n as x } from "./input-wrapper-
|
|
15
|
-
import { n as S } from "./helptext-
|
|
16
|
-
import { n as C } from "./checkbox-
|
|
17
|
-
import { n as w } from "./fileupload-
|
|
18
|
-
import { n as T } from "./modal-
|
|
9
|
+
import { n as p } from "./calendar-CBghTpkZ.js";
|
|
10
|
+
import { n as m } from "./card-CwvUQj1a.js";
|
|
11
|
+
import { n as h } from "./tag-D2Xvsy1i.js";
|
|
12
|
+
import { n as g } from "./combobox-CiT2YvLb.js";
|
|
13
|
+
import { i as _, n as v, r as y, t as b } from "./header-DU10rGhU.js";
|
|
14
|
+
import { n as x } from "./input-wrapper-B4TCGGwj.js";
|
|
15
|
+
import { n as S } from "./helptext-DqdOdYRj.js";
|
|
16
|
+
import { n as C } from "./checkbox-DcvKYDU2.js";
|
|
17
|
+
import { n as w } from "./fileupload-4nTdjPKw.js";
|
|
18
|
+
import { n as T } from "./modal-z5RzZ-fr.js";
|
|
19
19
|
import { n as E } from "./progressbar-BPHLC7ce.js";
|
|
20
|
-
import { a as D, t as O } from "./datepicker-
|
|
21
|
-
import { n as k, t as A } from "./footer-
|
|
22
|
-
import { n as j } from "./link-
|
|
23
|
-
import { n as M } from "./textinput-
|
|
20
|
+
import { a as D, t as O } from "./datepicker-CqWg6K2N.js";
|
|
21
|
+
import { n as k, t as A } from "./footer-YrlXRq7e.js";
|
|
22
|
+
import { n as j } from "./link-BvjWWWlc.js";
|
|
23
|
+
import { n as M } from "./textinput-Cr7Z9ilH.js";
|
|
24
24
|
import { n as N } from "./searchinput-DrUcPajl.js";
|
|
25
|
-
import { n as P } from "./header-menu-
|
|
26
|
-
import { n as F } from "./heading-
|
|
27
|
-
import { n as I } from "./linkcard-
|
|
28
|
-
import { n as L } from "./loader-
|
|
29
|
-
import { n as R } from "./messagebox-
|
|
30
|
-
import { n as z } from "./radiobutton-
|
|
31
|
-
import { n as B, r as V } from "./tabs-
|
|
32
|
-
import { n as H } from "./textarea-
|
|
33
|
-
import { n as U } from "./select-
|
|
34
|
-
import { t as W } from "./timepicker-
|
|
25
|
+
import { n as P } from "./header-menu-DKAcUFzh.js";
|
|
26
|
+
import { n as F } from "./heading-C23xQS4l.js";
|
|
27
|
+
import { n as I } from "./linkcard-6CbGf4I_.js";
|
|
28
|
+
import { n as L } from "./loader-BS7EJqxD.js";
|
|
29
|
+
import { n as R } from "./messagebox-Bt0IvUlD.js";
|
|
30
|
+
import { n as z } from "./radiobutton-Dr5OQ0IY.js";
|
|
31
|
+
import { n as B, r as V } from "./tabs-DHvCjUi4.js";
|
|
32
|
+
import { n as H } from "./textarea-MJvpE_yV.js";
|
|
33
|
+
import { n as U } from "./select-Cd_saUE7.js";
|
|
34
|
+
import { t as W } from "./timepicker-srjt12dI.js";
|
|
35
35
|
export { u as PktAccordion, l as PktAccordionItem, o as PktAlert, d as PktBackLink, f as PktBreadcrumbs, c as PktButton, p as PktCalendar, m as PktCard, C as PktCheckbox, g as PktCombobox, a as PktConsent, D as PktDateTags, O as PktDatepicker, w as PktFileUpload, k as PktFooter, A as PktFooterSimple, b as PktHeader, v as PktHeaderGlobal, P as PktHeaderMenu, y as PktHeaderService, _ as PktHeaderUserMenu, F as PktHeading, S as PktHelptext, s as PktIcon, x as PktInputWrapper, j as PktLink, I as PktLinkCard, L as PktLoader, R as PktMessagebox, T as PktModal, E as PktProgressbar, z as PktRadioButton, z as PktRadiobutton, N as PktSearchInput, U as PktSelect, B as PktTabItem, V as PktTabs, h as PktTag, H as PktTextarea, M as PktTextinput, W as PktTimepicker, r as getPktStrings, i as pktStringsNb, t as resetPktStrings, e as setPktStrings, n as subscribePktStrings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./input-wrapper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./input-wrapper-791L3L--.cjs");exports.PktInputWrapper=e.n,exports.default=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./input-wrapper-
|
|
1
|
+
import { n as e, t } from "./input-wrapper-B4TCGGwj.js";
|
|
2
2
|
export { e as PktInputWrapper, t as default };
|
package/dist/pkt-link.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./link-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./link-BWAhHUku.cjs");exports.PktLink=e.n,exports.default=e.t;
|
package/dist/pkt-link.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./link-
|
|
1
|
+
import { n as e, t } from "./link-BvjWWWlc.js";
|
|
2
2
|
export { e as PktLink, t as default };
|
package/dist/pkt-linkcard.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./linkcard-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./linkcard-D6fRaZSc.cjs");exports.PktLinkCard=e.n,exports.default=e.t;
|
package/dist/pkt-linkcard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./linkcard-
|
|
1
|
+
import { n as e, t } from "./linkcard-6CbGf4I_.js";
|
|
2
2
|
export { e as PktLinkCard, t as default };
|
package/dist/pkt-loader.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./loader-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./loader-B5t78Yk7.cjs");exports.PktLoader=e.n,exports.default=e.t;
|
package/dist/pkt-loader.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./loader-
|
|
1
|
+
import { n as e, t } from "./loader-BS7EJqxD.js";
|
|
2
2
|
export { e as PktLoader, t as default };
|
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messagebox-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messagebox-DBVUz-DN.cjs");exports.PktMessagebox=e.n,exports.default=e.t;
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./messagebox-
|
|
1
|
+
import { n as e, t } from "./messagebox-Bt0IvUlD.js";
|
|
2
2
|
export { e as PktMessagebox, t as default };
|
package/dist/pkt-modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./modal-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./modal-C1g2fiUq.cjs");exports.PktModal=e.n,exports.default=e.t;
|
package/dist/pkt-modal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./modal-
|
|
1
|
+
import { n as e, t } from "./modal-z5RzZ-fr.js";
|
|
2
2
|
export { e as PktModal, t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-with-slot-DgtT8lCH.cjs");var t=class{constructor(e){this.nodes=[],this.options=[],this.generation=0,this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){this.nodes=[],Array.from(this.host.childNodes).forEach(e=>{(e.nodeName===`OPTION`||e.nodeName===`DATA`)&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`disabled`,`selected`,`value`],attributeOldValue:!0,characterData:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName===`OPTION`||e.nodeName===`DATA`)&&(e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-skip`)&&e.setAttribute(`data-hidden`,`true`),!e.hasAttribute(`hidden`)&&e.hasAttribute(`data-skip`)&&e.hasAttribute(`data-hidden`)&&e.removeAttribute(`data-hidden`),e.setAttribute(`class`,`pkt-hide`),e.setAttribute(`data-skip`,`true`),e.setAttribute(`hidden`,`true`),this.nodes.includes(e)||this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute(`value`)?e.getAttribute(`value`)??``:e.textContent??``,label:e.textContent||e.getAttribute(`value`)||``,selected:e.hasAttribute(`selected`),disabled:e.hasAttribute(`disabled`),hidden:e.hasAttribute(`data-hidden`)})),this.generation++,this.host.requestUpdate()}handleMutations(t){let n=!1;t.forEach(t=>{if(t.type===`childList`){if(t.target!==this.host){let r=t.target;e.i(r)&&r.parentNode===this.host&&(n=!0);return}t.addedNodes.forEach(t=>{e.i(t)&&(this.addNode(t),n=!0)}),t.removedNodes.forEach(t=>{e.i(t)&&(this.nodes=this.nodes.filter(e=>e!==t),n=!0)})}if(t.type===`attributes`){let r=t.target;if(!e.i(r)||r.parentNode!==this.host||t.attributeName&&r.getAttribute(t.attributeName)===t.oldValue)return;this.addNode(r),n=!0}if(t.type===`characterData`){let r=t.target.parentElement;r&&e.i(r)&&r.parentNode===this.host&&(n=!0)}}),n&&this.createOptions()}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
package/dist/pkt-radiobutton.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radiobutton-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radiobutton-BuOLykKo.cjs");exports.PktRadioButton=e.n,exports.default=e.t;
|
package/dist/pkt-radiobutton.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./radiobutton-
|
|
1
|
+
import { n as e, t } from "./radiobutton-Dr5OQ0IY.js";
|
|
2
2
|
export { e as PktRadioButton, t as default };
|
package/dist/pkt-select.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./select-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./select-Cc7c9dRd.cjs");exports.PktSelect=e.n,exports.default=e.t;
|
package/dist/pkt-select.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./select-
|
|
1
|
+
import { n as e, t } from "./select-Cd_saUE7.js";
|
|
2
2
|
export { e as PktSelect, t as default };
|
package/dist/pkt-tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-DqzPOdi9.cjs");exports.PktTabItem=e.n,exports.PktTabs=e.r,exports.default=e.t;
|
package/dist/pkt-tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./tabs-
|
|
1
|
+
import { n as e, r as t, t as n } from "./tabs-DHvCjUi4.js";
|
|
2
2
|
export { e as PktTabItem, t as PktTabs, n as default };
|
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag-Cojf4jgA.cjs");exports.PktTag=e.n,exports.default=e.t;
|
package/dist/pkt-tag.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./tag-
|
|
1
|
+
import { n as e, t } from "./tag-D2Xvsy1i.js";
|
|
2
2
|
export { e as PktTag, t as default };
|
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-xTcafucE.cjs");exports.PktTextarea=e.n,exports.default=e.t;
|
package/dist/pkt-textarea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./textarea-
|
|
1
|
+
import { n as e, t } from "./textarea-MJvpE_yV.js";
|
|
2
2
|
export { e as PktTextarea, t as default };
|
package/dist/pkt-textinput.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-B4VnZzsa.cjs");exports.PktTextinput=e.n,exports.default=e.t;
|
package/dist/pkt-textinput.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./textinput-
|
|
1
|
+
import { n as e, t } from "./textinput-Cr7Z9ilH.js";
|
|
2
2
|
export { e as PktTextinput, t as default };
|
package/dist/pkt-timepicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-85ViMBd6.cjs");exports.PktTimepicker=e.t;
|
package/dist/pkt-timepicker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./timepicker-
|
|
1
|
+
import { t as e } from "./timepicker-srjt12dI.js";
|
|
2
2
|
export { e as PktTimepicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./ref-BkV4Cd8U.cjs"),r=require("./input-element-
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./ref-BkV4Cd8U.cjs"),r=require("./input-element-uajHIWAO.cjs");var i=class extends r.t{constructor(...e){super(...e),this.inputRef=n.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type=`radio`,this.tagText=null,this.optionalTag=!1,this.requiredTag=!1,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let r=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),i=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),o=`pkt-tag pkt-tag--small pkt-tag--thin-text`,s=this.pktStrings.get(`forms`);return e._`
|
|
2
2
|
<div class="pkt-input-check">
|
|
3
3
|
<div class=${r}>
|
|
4
4
|
<input
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as o } from "./class-map-BL_YL_Ed.js";
|
|
3
3
|
import { n as s, t as c } from "./ref-lE1mGUOL.js";
|
|
4
|
-
import { t as l } from "./input-element-
|
|
4
|
+
import { t as l } from "./input-element-zXKo9jpe.js";
|
|
5
5
|
//#region src/components/radiobutton/radiobutton.ts
|
|
6
6
|
var u = class extends l {
|
|
7
7
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-DgtT8lCH.cjs"),r=require("./ref-BkV4Cd8U.cjs"),i=require("./input-element-uajHIWAO.cjs"),a=require("./pkt-options-controller-AFYyv3-b.cjs"),o=require("./input-wrapper-791L3L--.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.strings=${this.strings}
|
|
4
4
|
.size=${this.inputSize}
|
|
@@ -44,6 +44,6 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs")
|
|
|
44
44
|
${t.label}
|
|
45
45
|
</option>`):``}
|
|
46
46
|
</select>
|
|
47
|
-
<div class="pkt-contents" slot="helptext">${n.
|
|
47
|
+
<div class="pkt-contents" slot="helptext">${n.r(this,`helptext`)}</div>
|
|
48
48
|
</pkt-input-wrapper>
|
|
49
49
|
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.u({type:String})],c.prototype,`value`,void 0);try{e.d(`pkt-select`)(c)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as e, d as t, l as n, n as r, u as i } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as a } from "./if-defined-r8tKY4tG.js";
|
|
3
|
-
import {
|
|
3
|
+
import { r as o } from "./element-with-slot-GwTT3WRD.js";
|
|
4
4
|
import { n as s, t as c } from "./ref-lE1mGUOL.js";
|
|
5
|
-
import { t as l } from "./input-element-
|
|
6
|
-
import { t as u } from "./pkt-options-controller-
|
|
7
|
-
import { r as d } from "./input-wrapper-
|
|
5
|
+
import { t as l } from "./input-element-zXKo9jpe.js";
|
|
6
|
+
import { t as u } from "./pkt-options-controller-DKkmDDzT.js";
|
|
7
|
+
import { r as d } from "./input-wrapper-B4TCGGwj.js";
|
|
8
8
|
//#region src/base-elements/options-input-element.ts
|
|
9
9
|
var f = class extends l {
|
|
10
10
|
constructor(...e) {
|
|
@@ -5,6 +5,73 @@
|
|
|
5
5
|
* Used by both Elements and React calendar implementations
|
|
6
6
|
* and by the shared calendar helper functions.
|
|
7
7
|
*/
|
|
8
|
+
import type { IPktStringsProps } from '../shared-strings';
|
|
9
|
+
/** Calendar props shared by React and Elements. */
|
|
10
|
+
export interface IPktCalendarBase extends IPktStringsProps<'dates' | 'calendar'> {
|
|
11
|
+
id?: string;
|
|
12
|
+
currentmonth?: Date | string | null;
|
|
13
|
+
selected?: string[];
|
|
14
|
+
excludeweekdays?: string[];
|
|
15
|
+
excludedates?: Date[] | string[];
|
|
16
|
+
earliest?: string | null;
|
|
17
|
+
latest?: string | null;
|
|
18
|
+
weeknumbers?: boolean;
|
|
19
|
+
withcontrols?: boolean;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
maxMultiple?: number;
|
|
22
|
+
range?: boolean;
|
|
23
|
+
today?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export declare const CALENDAR_DEFAULTS: {
|
|
26
|
+
readonly multiple: false;
|
|
27
|
+
readonly maxMultiple: 0;
|
|
28
|
+
readonly range: false;
|
|
29
|
+
readonly earliest: any;
|
|
30
|
+
readonly latest: any;
|
|
31
|
+
readonly weeknumbers: false;
|
|
32
|
+
readonly withcontrols: false;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Documented Calendar props (subset of `IPktCalendarBase`), plus the
|
|
36
|
+
* React-only selection/close callbacks and the Elements-only deprecated
|
|
37
|
+
* per-string props that `strings` / `setPktStrings()` have superseded.
|
|
38
|
+
*/
|
|
39
|
+
export type ICalendarSpecProps = Pick<IPktCalendarBase, 'id' | 'currentmonth' | 'selected' | 'excludeweekdays' | 'excludedates' | 'earliest' | 'latest' | 'weeknumbers' | 'withcontrols' | 'multiple' | 'maxMultiple' | 'range' | 'today'> & {
|
|
40
|
+
/**
|
|
41
|
+
* React-only callback fired with the updated selection (ISO date strings).
|
|
42
|
+
* @remarks Elements-paritet: `date-selected`-eventet.
|
|
43
|
+
*/
|
|
44
|
+
onDateSelected?: (selected: string[]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* React-only callback fired when the calendar requests to close (Escape or focus-out).
|
|
47
|
+
* @remarks Elements-paritet: `close`-eventet.
|
|
48
|
+
*/
|
|
49
|
+
onClose?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Elements-only. Bruk `strings={{ dates: { daysShort: [...] } }}` eller `setPktStrings()`.
|
|
52
|
+
*/
|
|
53
|
+
dayStrings?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Elements-only. Bruk `strings={{ dates: { days: [...] } }}` eller `setPktStrings()`.
|
|
56
|
+
*/
|
|
57
|
+
dayStringsLong?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Elements-only. Bruk `strings={{ dates: { months: [...] } }}` eller `setPktStrings()`.
|
|
60
|
+
*/
|
|
61
|
+
monthStrings?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Elements-only. Bruk `strings={{ dates: { week: '...' } }}` eller `setPktStrings()`.
|
|
64
|
+
*/
|
|
65
|
+
weekString?: string;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Elements-only. Bruk `strings={{ calendar: { prevMonth: '...' } }}` eller `setPktStrings()`.
|
|
68
|
+
*/
|
|
69
|
+
prevMonthString?: string;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Elements-only. Bruk `strings={{ calendar: { nextMonth: '...' } }}` eller `setPktStrings()`.
|
|
72
|
+
*/
|
|
73
|
+
nextMonthString?: string;
|
|
74
|
+
};
|
|
8
75
|
export interface IDateConstraints {
|
|
9
76
|
earliest: string | null;
|
|
10
77
|
latest: string | null;
|
|
@@ -25,7 +25,8 @@ export type { IRenderLink, TRenderLink } from './render-link';
|
|
|
25
25
|
export type { IPktStringsProps } from '../shared-strings';
|
|
26
26
|
export type { IHelptextProps, ITagOptionalRequiredProps, IFormFieldLabelProps, IFormFieldErrorProps, IFormFieldCommonProps, TFormFieldCommonSpecKeys, } from './form-field';
|
|
27
27
|
export type { TMessageboxSkin, TCardSkin, TTagSkin } from './skin';
|
|
28
|
-
export
|
|
28
|
+
export { CALENDAR_DEFAULTS } from './calendar';
|
|
29
|
+
export type { IPktCalendarBase, ICalendarSpecProps, IDateConstraints, ICalendarGridDimensions, IGridCellPosition, TDateRangeMap, ISelectionState, ISelectionOptions, } from './calendar';
|
|
29
30
|
export type { IDatepickerStrings } from './datepicker';
|
|
30
31
|
export { defaultSingleStrings, defaultRangeStrings } from './datepicker';
|
|
31
32
|
export type { ITimepickerStrings } from './timepicker';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as e, d as t, l as n, n as r, u as i } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as a } from "./if-defined-r8tKY4tG.js";
|
|
3
|
-
import {
|
|
3
|
+
import { r as o, t as s } from "./element-with-slot-GwTT3WRD.js";
|
|
4
4
|
import { n as c, r as l, t as u } from "./consume-BDnMAp2g.js";
|
|
5
5
|
import { n as d, t as f } from "./ref-lE1mGUOL.js";
|
|
6
6
|
//#region src/components/tabs/tabs-context.ts
|
|
@@ -16,11 +16,14 @@ var p = l(Symbol("pkt-tabs-context")), m = class extends s {
|
|
|
16
16
|
get useArrowNav() {
|
|
17
17
|
return this.arrowNav && !this.disableArrowNav;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
willUpdate(e) {
|
|
20
20
|
(e.has("arrowNav") || e.has("disableArrowNav")) && (this.context = {
|
|
21
21
|
...this.context,
|
|
22
22
|
useArrowNav: this.useArrowNav
|
|
23
|
-
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
updated() {
|
|
26
|
+
this.updateComplete.then(() => this.syncSeparators());
|
|
24
27
|
}
|
|
25
28
|
syncSeparators() {
|
|
26
29
|
let e = this.querySelector(".pkt-tabs__list");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-DgtT8lCH.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-BkV4Cd8U.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=class extends n.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}willUpdate(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}updated(){this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let t=this.useArrowNav?`tablist`:`navigation`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e._`
|
|
2
2
|
<div class=${r}>
|
|
3
|
-
<div class="pkt-tabs__list" role=${t}>${n.
|
|
3
|
+
<div class="pkt-tabs__list" role=${t}>${n.r(this)}</div>
|
|
4
4
|
</div>
|
|
5
5
|
`}};e.n([e.u({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.l()],o.prototype,`tabRefs`,void 0),e.n([e.l()],o.prototype,`disabledMap`,void 0),e.n([e.l()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.l()],o.prototype,`context`,void 0);try{e.d(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends n.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e._`
|
|
6
6
|
${this.icon?e._`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
|
|
7
|
-
<span>${n.
|
|
7
|
+
<span>${n.r(this)}</span>
|
|
8
8
|
${this.tag?e._`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
|
|
9
9
|
`;return this.href?e._`
|
|
10
10
|
<a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./format-B8meU8Tm.cjs"),i=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./format-B8meU8Tm.cjs"),i=require("./element-with-slot-DgtT8lCH.cjs");require("./icon-DBFTFd-J.cjs");var a={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},o=class extends i.t{constructor(){super(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}willUpdate(e){if(super.willUpdate(e),this.closeTag&&!this.ariaLabel){let e=i.n(this).getNodes().map(e=>e.textContent??``).join(``).trim();e&&(this._ariaDescription=r.t(this.pktStrings.get(`tag`).remove,{label:e}))}}render(){let r={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"pkt-tag":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-hide":this._isClosed};return this.closeTag?e._`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
type=${this.type}
|
|
@@ -12,7 +12,7 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),
|
|
|
12
12
|
name=${this.iconName}
|
|
13
13
|
aria-hidden="true"
|
|
14
14
|
></pkt-icon>`}
|
|
15
|
-
<span>${i.
|
|
15
|
+
<span>${i.r(this)}</span>
|
|
16
16
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
17
17
|
</button>
|
|
18
18
|
`:e._`
|
|
@@ -22,6 +22,6 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),
|
|
|
22
22
|
name=${this.iconName}
|
|
23
23
|
aria-hidden="true"
|
|
24
24
|
></pkt-icon>`}
|
|
25
|
-
<span>${i.
|
|
25
|
+
<span>${i.r(this)}</span>
|
|
26
26
|
</span>
|
|
27
27
|
`}};e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`closeTag`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`size`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`skin`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`textStyle`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`iconName`,void 0),e.n([e.u({type:String})],o.prototype,`type`,void 0),e.n([e.u({type:String})],o.prototype,`ariaLabel`,void 0),e.n([e.u({type:Number,attribute:`button-tabindex`})],o.prototype,`buttonTabindex`,void 0),e.n([e.l()],o.prototype,`_isClosed`,void 0),e.n([e.l()],o.prototype,`_ariaDescription`,void 0);try{e.d(`pkt-tag`)(o)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -2,9 +2,9 @@ import { _ as e, d as t, l as n, n as r, u as i } from "./element-e2MAMNEP.js";
|
|
|
2
2
|
import { t as a } from "./class-map-BL_YL_Ed.js";
|
|
3
3
|
import { t as o } from "./if-defined-r8tKY4tG.js";
|
|
4
4
|
import { t as s } from "./format-BTeSVkED.js";
|
|
5
|
-
import { n as c,
|
|
5
|
+
import { n as c, r as l, t as u } from "./element-with-slot-GwTT3WRD.js";
|
|
6
6
|
import "./icon-jEFbKTB_.js";
|
|
7
|
-
var
|
|
7
|
+
var d = {
|
|
8
8
|
name: "pkt-tag",
|
|
9
9
|
react: "PktTag",
|
|
10
10
|
"css-class": "pkt-tag",
|
|
@@ -84,9 +84,9 @@ var u = {
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
slots: { default: { description: "Teksten til tag" } }
|
|
87
|
-
},
|
|
87
|
+
}, f = class extends u {
|
|
88
88
|
constructor() {
|
|
89
|
-
super(), this.closeTag =
|
|
89
|
+
super(), this.closeTag = d.props.closeTag.default, this.size = d.props.size.default, this.skin = d.props.skin.default, this.textStyle = null, this.iconName = void 0, this.type = d.props.type.default, this.ariaLabel = null, this.buttonTabindex = void 0, this._isClosed = !1, this._ariaDescription = null, this.close = (e) => {
|
|
90
90
|
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
|
|
91
91
|
detail: { origin: e },
|
|
92
92
|
bubbles: !1,
|
|
@@ -98,9 +98,9 @@ var u = {
|
|
|
98
98
|
}));
|
|
99
99
|
}, this._isClosed = !1;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
if (super.
|
|
103
|
-
let e = this.
|
|
101
|
+
willUpdate(e) {
|
|
102
|
+
if (super.willUpdate(e), this.closeTag && !this.ariaLabel) {
|
|
103
|
+
let e = c(this).getNodes().map((e) => e.textContent ?? "").join("").trim();
|
|
104
104
|
e && (this._ariaDescription = s(this.pktStrings.get("tag").remove, { label: e }));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -131,7 +131,7 @@ var u = {
|
|
|
131
131
|
name=${this.iconName}
|
|
132
132
|
aria-hidden="true"
|
|
133
133
|
></pkt-icon>`}
|
|
134
|
-
<span>${
|
|
134
|
+
<span>${l(this)}</span>
|
|
135
135
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
136
136
|
</button>
|
|
137
137
|
` : e`
|
|
@@ -141,7 +141,7 @@ var u = {
|
|
|
141
141
|
name=${this.iconName}
|
|
142
142
|
aria-hidden="true"
|
|
143
143
|
></pkt-icon>`}
|
|
144
|
-
<span>${
|
|
144
|
+
<span>${l(this)}</span>
|
|
145
145
|
</span>
|
|
146
146
|
`;
|
|
147
147
|
}
|
|
@@ -149,29 +149,29 @@ var u = {
|
|
|
149
149
|
r([i({
|
|
150
150
|
type: Boolean,
|
|
151
151
|
reflect: !0
|
|
152
|
-
})],
|
|
152
|
+
})], f.prototype, "closeTag", void 0), r([i({
|
|
153
153
|
type: String,
|
|
154
154
|
reflect: !0
|
|
155
|
-
})],
|
|
155
|
+
})], f.prototype, "size", void 0), r([i({
|
|
156
156
|
type: String,
|
|
157
157
|
reflect: !0
|
|
158
|
-
})],
|
|
158
|
+
})], f.prototype, "skin", void 0), r([i({
|
|
159
159
|
type: String,
|
|
160
160
|
reflect: !0
|
|
161
|
-
})],
|
|
161
|
+
})], f.prototype, "textStyle", void 0), r([i({
|
|
162
162
|
type: String,
|
|
163
163
|
reflect: !0
|
|
164
|
-
})],
|
|
164
|
+
})], f.prototype, "iconName", void 0), r([i({ type: String })], f.prototype, "type", void 0), r([i({ type: String })], f.prototype, "ariaLabel", void 0), r([i({
|
|
165
165
|
type: Number,
|
|
166
166
|
attribute: "button-tabindex"
|
|
167
|
-
})],
|
|
167
|
+
})], f.prototype, "buttonTabindex", void 0), r([n()], f.prototype, "_isClosed", void 0), r([n()], f.prototype, "_ariaDescription", void 0);
|
|
168
168
|
try {
|
|
169
|
-
t("pkt-tag")(
|
|
169
|
+
t("pkt-tag")(f);
|
|
170
170
|
} catch {
|
|
171
171
|
console.warn("Forsøker å definere <pkt-tag>, men den er allerede definert");
|
|
172
172
|
}
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region src/components/tag/index.ts
|
|
175
|
-
var
|
|
175
|
+
var p = f;
|
|
176
176
|
//#endregion
|
|
177
|
-
export {
|
|
177
|
+
export { f as n, p as t };
|
|
@@ -2,11 +2,11 @@ import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c,
|
|
|
2
2
|
import { t as u } from "./class-map-BL_YL_Ed.js";
|
|
3
3
|
import { t as d } from "./if-defined-r8tKY4tG.js";
|
|
4
4
|
import { i as f, r as p } from "./directive-helpers-CohhRNQz.js";
|
|
5
|
-
import {
|
|
5
|
+
import { r as m } from "./element-with-slot-GwTT3WRD.js";
|
|
6
6
|
import "./icon-jEFbKTB_.js";
|
|
7
7
|
import { n as h, t as g } from "./ref-lE1mGUOL.js";
|
|
8
|
-
import { t as _ } from "./input-element-
|
|
9
|
-
import { r as v } from "./input-wrapper-
|
|
8
|
+
import { t as _ } from "./input-element-zXKo9jpe.js";
|
|
9
|
+
import { r as v } from "./input-wrapper-B4TCGGwj.js";
|
|
10
10
|
//#region ../../node_modules/lit-html/directives/live.js
|
|
11
11
|
var y = n(class extends c {
|
|
12
12
|
constructor(e) {
|
|
@@ -33,8 +33,11 @@ var y = n(class extends c {
|
|
|
33
33
|
attributeChangedCallback(e, t, n) {
|
|
34
34
|
e === "value" && this.value !== t && (this.counterCurrent = n ? n.length : 0), super.attributeChangedCallback(e, t, n);
|
|
35
35
|
}
|
|
36
|
+
willUpdate(e) {
|
|
37
|
+
super.willUpdate(e), e.has("value") && (this.counterCurrent = this.value?.length || 0), e.has("id") && !this.name && this.id && (this.name = this.id);
|
|
38
|
+
}
|
|
36
39
|
updated(e) {
|
|
37
|
-
super.updated(e), this.classList.add("pkt-textinput", "pkt-textarea"), e.has("value") &&
|
|
40
|
+
super.updated(e), this.classList.add("pkt-textinput", "pkt-textarea"), e.has("value") && this.valueChanged(this.value, e.get("value"));
|
|
38
41
|
}
|
|
39
42
|
render() {
|
|
40
43
|
let t = this.effectiveCounter(this.counterMaxLength > 0), n = u({
|