@oslokommune/punkt-elements 19.9.0 → 19.10.1
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 +43 -0
- package/dist/{accordion-CMCCpxtz.cjs → accordion-BFKmnCDh.cjs} +1 -1
- package/dist/{accordion-Cp2o6wTY.js → accordion-BhCmUDoS.js} +1 -1
- package/dist/{alert-QfloIr-o.cjs → alert-BJPi5ylH.cjs} +1 -1
- package/dist/{alert-CAPiwi4F.js → alert-CUH_2zb2.js} +2 -2
- package/dist/{button-Dh97H-58.cjs → button-CWHqXdSG.cjs} +1 -1
- package/dist/{button-CeRr7oIn.js → button-DQ8rH8hx.js} +1 -1
- package/dist/{card-_PlgXmgZ.js → card-DfVOJCWA.js} +2 -2
- package/dist/{card--NuWdTbG.cjs → card-pJ0CDH2Y.cjs} +1 -1
- package/dist/{checkbox-QIcdn09A.cjs → checkbox-3z2uH8rd.cjs} +1 -1
- package/dist/{checkbox-G8k3vg85.js → checkbox-BEBBPgYW.js} +1 -1
- package/dist/{checkbox-group-DoueGGi5.js → checkbox-group-BiPX1EhY.js} +2 -2
- package/dist/{checkbox-group-nLazAkcg.cjs → checkbox-group-DRQmSHyN.cjs} +1 -1
- package/dist/{combobox-ClXhKwR9.cjs → combobox-C_SMnNsj.cjs} +1 -1
- package/dist/{combobox-Cz_rq7Mm.js → combobox-CdmzQtCh.js} +5 -5
- package/dist/components/index.d.ts +1 -0
- package/dist/components/radiobutton/index.d.ts +1 -0
- package/dist/components/radiobutton/radiobutton.d.ts +7 -2
- package/dist/{consent-DimzcQxt.cjs → consent-CkK9BZ7t.cjs} +1 -1
- package/dist/{consent-CZMxUavj.js → consent-eTXt052m.js} +1 -1
- package/dist/{datepicker-usIF9WY7.cjs → datepicker-BrQhahYy.cjs} +1 -1
- package/dist/{datepicker-C7ABsx7H.js → datepicker-DILpPWCY.js} +4 -4
- package/dist/directives/slot-content.d.ts +24 -11
- package/dist/element-with-slot-DOt8HbXA.cjs +1 -0
- package/dist/element-with-slot-U981OZM_.js +353 -0
- package/dist/{fileupload-BR9H6fET.js → fileupload-BZjZh8Mp.js} +3 -3
- package/dist/{fileupload-2uTFjd81.cjs → fileupload-l1d9UQf9.cjs} +1 -1
- package/dist/{footer-CyxRYvT-.cjs → footer-C8Zh-eUU.cjs} +1 -1
- package/dist/{footer-B3DMvo8-.js → footer-X5MBVUoo.js} +1 -1
- package/dist/{header-BKeSkfB7.js → header-DLH6Xx97.js} +5 -5
- package/dist/{header-Drj3lTrv.cjs → header-EvwDJXP-.cjs} +1 -1
- package/dist/{header-menu-buYE90FU.js → header-menu-0UtMd2_H.js} +1 -1
- package/dist/{header-menu-B_5hCNUl.cjs → header-menu-BqFpYI-V.cjs} +1 -1
- package/dist/{heading-DUYOvlxs.cjs → heading-DMHbL3xs.cjs} +1 -1
- package/dist/{heading-WBB5MO9i.js → heading-tWSLaRPD.js} +1 -1
- package/dist/{helptext-C7cyihnu.cjs → helptext-CGa1p-yd.cjs} +1 -1
- package/dist/{helptext-DadLkcoO.js → helptext-Dy2Ehs9W.js} +1 -1
- package/dist/{input-element-BBygBEei.js → input-element-BGbT4ICl.js} +1 -1
- package/dist/{input-element-C4SelHLD.cjs → input-element-kIrd5ABs.cjs} +1 -1
- package/dist/{input-wrapper-BT6B3Kco.cjs → input-wrapper-EvzyXMw-.cjs} +1 -1
- package/dist/{input-wrapper-DrSCuw6U.js → input-wrapper-Uks0spRR.js} +3 -3
- package/dist/{link-CVnIn74-.js → link-C0yBFscy.js} +1 -1
- package/dist/{link-CEP7w1et.cjs → link-CLdiz-ly.cjs} +1 -1
- package/dist/{linkcard-IWiVvRKy.js → linkcard-B5-p-YC4.js} +1 -1
- package/dist/{linkcard-D8vitdrQ.cjs → linkcard-v9UsV9Os.cjs} +1 -1
- package/dist/{loader-B0hFoBtF.cjs → loader-C4UfUu2u.cjs} +1 -1
- package/dist/{loader-CAsUPHjl.js → loader-DWvjIMsT.js} +1 -1
- package/dist/{messagebox-6_iNN5F3.js → messagebox-CJTqxfu3.js} +1 -1
- package/dist/{messagebox-C19L2Duq.cjs → messagebox-clOimkn7.cjs} +1 -1
- package/dist/{modal-CoEPzt4p.cjs → modal-BPweteoS.cjs} +1 -1
- package/dist/{modal-D7MolBXb.js → modal-Bm1daKaW.js} +1 -1
- package/dist/{option-group-element-BYS7s-is.cjs → option-group-element-2A4TBcp-.cjs} +1 -1
- package/dist/{option-group-element-BIuotbRu.js → option-group-element-Ber7NAlg.js} +2 -2
- 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-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.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 +36 -36
- 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-B3vVKnAG.cjs → pkt-options-controller-Ck_549wx.cjs} +1 -1
- package/dist/{pkt-options-controller-ClFrUWZK.js → pkt-options-controller-DTOlYR9b.js} +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.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/{radio-group-kOzlGn8T.cjs → radio-group-9Szx2XyM.cjs} +1 -1
- package/dist/{radio-group-lhymYEZX.js → radio-group-CMtx_GRV.js} +9 -9
- package/dist/{radiobutton-CFd8TgV9.js → radiobutton-CYbvJ9y8.js} +20 -13
- package/dist/radiobutton-Dq2qkfi0.cjs +38 -0
- package/dist/{select-BowvpCNa.cjs → select-1nm17iN8.cjs} +1 -1
- package/dist/{select-B6CN2Ymq.js → select-DlgOxHIl.js} +4 -4
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/radiobutton.d.ts +46 -0
- package/dist/{tabs-Dm8xcPRs.cjs → tabs-8Y5PlmLl.cjs} +1 -1
- package/dist/{tabs-DZvtVA0y.js → tabs-D3pPS9us.js} +1 -1
- package/dist/{tag-DyVZrqOQ.cjs → tag-DOUsW7nS.cjs} +1 -1
- package/dist/{tag-C33BPIOm.js → tag-qHYIycl8.js} +1 -1
- package/dist/{textarea-hW0kV5gj.js → textarea-B3qIDyEQ.js} +3 -3
- package/dist/{textarea-DoH3Il8v.cjs → textarea-DkeCQKmM.cjs} +1 -1
- package/dist/{textinput-B6G4dVuL.js → textinput-CwvVRNsP.js} +3 -3
- package/dist/{textinput-CQknclmV.cjs → textinput-DibZCHh_.cjs} +1 -1
- package/dist/{timepicker-DB3gor6g.cjs → timepicker-CZ_1HVlF.cjs} +1 -1
- package/dist/{timepicker-Cd2QI6ua.js → timepicker-C_oG9W9Y.js} +3 -3
- package/package.json +2 -2
- package/src/components/heading/heading.test.ts +24 -0
- package/src/components/helptext/helptext-association.test.ts +36 -0
- package/src/components/index.ts +1 -0
- package/src/components/radiobutton/index.ts +1 -0
- package/src/components/radiobutton/radiobutton.ts +15 -6
- package/dist/element-with-slot-DDLS-aLw.js +0 -227
- package/dist/element-with-slot-DhiAuSjM.cjs +0 -1
- package/dist/radiobutton-BgHCcDJv.cjs +0 -38
package/dist/pkt-index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { a as e, i as t, o as n, r, s as i } from "./element-DBugHPKM.js";
|
|
2
|
-
import { n as a } from "./consent-
|
|
3
|
-
import { n as o } from "./alert-
|
|
4
|
-
import { i as s, n as c, r as l, t as u } from "./header-
|
|
5
|
-
import { n as d } from "./card-
|
|
6
|
-
import { n as f } from "./checkbox-
|
|
7
|
-
import { n as p } from "./
|
|
8
|
-
import { n as m } from "./
|
|
9
|
-
import { n as h } from "./
|
|
10
|
-
import { n as g } from "./
|
|
11
|
-
import { n as _ } from "./
|
|
12
|
-
import { n as v
|
|
13
|
-
import { n as b } from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { n as C } from "./
|
|
17
|
-
import { n as w } from "./
|
|
18
|
-
import { n as T } from "./
|
|
19
|
-
import { n as E } from "./
|
|
20
|
-
import { n as D } from "./
|
|
21
|
-
import { n as O } from "./
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { n as N } from "./
|
|
25
|
-
import { n as P } from "./
|
|
26
|
-
import { n as F } from "./
|
|
27
|
-
import { n as I } from "./
|
|
28
|
-
import { n as L } from "./
|
|
29
|
-
import { n as R } from "./
|
|
30
|
-
import { n as z } from "./
|
|
31
|
-
import { n as B } from "./
|
|
32
|
-
import { n as V } from "./radio-group-
|
|
33
|
-
import { n as H, r as U } from "./tabs-
|
|
34
|
-
import { n as W } from "./textarea-
|
|
35
|
-
import { n as G } from "./select-
|
|
36
|
-
import { t as K } from "./timepicker-
|
|
37
|
-
export {
|
|
2
|
+
import { n as a } from "./consent-eTXt052m.js";
|
|
3
|
+
import { n as o } from "./alert-CUH_2zb2.js";
|
|
4
|
+
import { i as s, n as c, r as l, t as u } from "./header-DLH6Xx97.js";
|
|
5
|
+
import { n as d } from "./card-DfVOJCWA.js";
|
|
6
|
+
import { n as f } from "./checkbox-BEBBPgYW.js";
|
|
7
|
+
import { n as p } from "./radiobutton-CYbvJ9y8.js";
|
|
8
|
+
import { n as m } from "./icon-Bao96Zb8.js";
|
|
9
|
+
import { n as h } from "./messagebox-CJTqxfu3.js";
|
|
10
|
+
import { n as g } from "./calendar-D9w8M99G.js";
|
|
11
|
+
import { n as _ } from "./combobox-CdmzQtCh.js";
|
|
12
|
+
import { n as v } from "./button-DQ8rH8hx.js";
|
|
13
|
+
import { n as y, r as b } from "./accordion-BhCmUDoS.js";
|
|
14
|
+
import { n as x } from "./backlink-ogvv493Y.js";
|
|
15
|
+
import { t as S } from "./breadcrumbs-53QVnTFP.js";
|
|
16
|
+
import { n as C } from "./tag-qHYIycl8.js";
|
|
17
|
+
import { n as w } from "./input-wrapper-Uks0spRR.js";
|
|
18
|
+
import { n as T } from "./helptext-Dy2Ehs9W.js";
|
|
19
|
+
import { n as E } from "./checkbox-group-BiPX1EhY.js";
|
|
20
|
+
import { n as D } from "./fileupload-BZjZh8Mp.js";
|
|
21
|
+
import { n as O } from "./modal-Bm1daKaW.js";
|
|
22
|
+
import { n as k } from "./progressbar-DZHiq7B0.js";
|
|
23
|
+
import { a as A, t as j } from "./datepicker-DILpPWCY.js";
|
|
24
|
+
import { n as M, t as N } from "./footer-X5MBVUoo.js";
|
|
25
|
+
import { n as P } from "./link-C0yBFscy.js";
|
|
26
|
+
import { n as F } from "./textinput-CwvVRNsP.js";
|
|
27
|
+
import { n as I } from "./searchinput-Bkcr3Fby.js";
|
|
28
|
+
import { n as L } from "./header-menu-0UtMd2_H.js";
|
|
29
|
+
import { n as R } from "./heading-tWSLaRPD.js";
|
|
30
|
+
import { n as z } from "./linkcard-B5-p-YC4.js";
|
|
31
|
+
import { n as B } from "./loader-DWvjIMsT.js";
|
|
32
|
+
import { n as V } from "./radio-group-CMtx_GRV.js";
|
|
33
|
+
import { n as H, r as U } from "./tabs-D3pPS9us.js";
|
|
34
|
+
import { n as W } from "./textarea-B3qIDyEQ.js";
|
|
35
|
+
import { n as G } from "./select-DlgOxHIl.js";
|
|
36
|
+
import { t as K } from "./timepicker-C_oG9W9Y.js";
|
|
37
|
+
export { b as PktAccordion, y as PktAccordionItem, o as PktAlert, x as PktBackLink, S as PktBreadcrumbs, v as PktButton, g as PktCalendar, d as PktCard, f as PktCheckbox, E as PktCheckboxGroup, _ as PktCombobox, a as PktConsent, A as PktDateTags, j as PktDatepicker, D as PktFileUpload, M as PktFooter, N as PktFooterSimple, u as PktHeader, c as PktHeaderGlobal, L as PktHeaderMenu, l as PktHeaderService, s as PktHeaderUserMenu, R as PktHeading, T as PktHelptext, m as PktIcon, w as PktInputWrapper, P as PktLink, z as PktLinkCard, B as PktLoader, h as PktMessagebox, O as PktModal, k as PktProgressbar, p as PktRadioButton, p as PktRadiobutton, V as PktRadioGroup, I as PktSearchInput, G as PktSelect, H as PktTabItem, U as PktTabs, C as PktTag, W as PktTextarea, F as PktTextinput, K 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-EvzyXMw-.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-Uks0spRR.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-CLdiz-ly.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-C0yBFscy.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-v9UsV9Os.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-B5-p-YC4.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-C4UfUu2u.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-DWvjIMsT.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-clOimkn7.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-CJTqxfu3.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-BPweteoS.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-Bm1daKaW.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-DOt8HbXA.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.a(r)&&r.parentNode===this.host&&(n=!0);return}t.addedNodes.forEach(t=>{e.a(t)&&(this.addNode(t),n=!0)}),t.removedNodes.forEach(t=>{e.a(t)&&(this.nodes=this.nodes.filter(e=>e!==t),n=!0)})}if(t.type===`attributes`){let r=t.target;if(!e.a(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.a(r)&&r.parentNode===this.host&&(n=!0)}}),n&&this.createOptions()}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
package/dist/pkt-radio-group.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radio-group-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radio-group-9Szx2XyM.cjs");exports.PktRadioGroup=e.n,exports.default=e.t;
|
package/dist/pkt-radio-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./radio-group-
|
|
1
|
+
import { n as e, t } from "./radio-group-CMtx_GRV.js";
|
|
2
2
|
export { e as PktRadioGroup, t as default };
|
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-Dq2qkfi0.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-CYbvJ9y8.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-1nm17iN8.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-DlgOxHIl.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-8Y5PlmLl.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-D3pPS9us.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-DOUsW7nS.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-qHYIycl8.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-DkeCQKmM.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-B3qIDyEQ.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-DibZCHh_.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-CwvVRNsP.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-CZ_1HVlF.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-C_oG9W9Y.js";
|
|
2
2
|
export { e as PktTimepicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./radiobutton-Dq2qkfi0.cjs"),n=require("./option-group-element-2A4TBcp-.cjs"),r=require("./provide-Cz18sYug.cjs");var i=class extends n.t{constructor(...e){super(...e),this.optionSelector=`pkt-radiobutton`,this.groupContext={name:``,hasTile:!1,hasError:!1,required:!1},this.storedValue=null}get value(){let e=this.options().find(n.n);return e?n.i(e):``}set value(e){let t=this.value;this.storedValue=e??``,this.applyStoredValue(this.options()),this.requestUpdate(`value`,t)}get hasStoredValue(){return this.storedValue!==null}storeCurrentValue(){this.storedValue=this.value}applyStoredValue(e){e.forEach(e=>{let t=this.storedValue!==``&&n.i(e)===this.storedValue;n.n(e)!==t&&(e.checked=t)})}createGroupContext(){return{...super.createGroupContext(),required:this.required}}};e.n([r.t({context:t.r}),e.l()],i.prototype,`groupContext`,void 0),e.n([e.u({type:String})],i.prototype,`value`,null);try{e.d(`pkt-radio-group`)(i)}catch{console.warn(`Forsøker å definere <pkt-radio-group>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as e, l as t, n, u as r } from "./element-DBugHPKM.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as s } from "./
|
|
4
|
-
import {
|
|
2
|
+
import { r as i } from "./radiobutton-CYbvJ9y8.js";
|
|
3
|
+
import { i as a, n as o, t as s } from "./option-group-element-Ber7NAlg.js";
|
|
4
|
+
import { t as c } from "./provide-_MnlMGnw.js";
|
|
5
5
|
//#region src/components/radio-group/radio-group.ts
|
|
6
|
-
var l = class extends
|
|
6
|
+
var l = class extends s {
|
|
7
7
|
constructor(...e) {
|
|
8
8
|
super(...e), this.optionSelector = "pkt-radiobutton", this.groupContext = {
|
|
9
9
|
name: "",
|
|
@@ -13,8 +13,8 @@ var l = class extends o {
|
|
|
13
13
|
}, this.storedValue = null;
|
|
14
14
|
}
|
|
15
15
|
get value() {
|
|
16
|
-
let e = this.options().find(
|
|
17
|
-
return e ?
|
|
16
|
+
let e = this.options().find(o);
|
|
17
|
+
return e ? a(e) : "";
|
|
18
18
|
}
|
|
19
19
|
set value(e) {
|
|
20
20
|
let t = this.value;
|
|
@@ -28,8 +28,8 @@ var l = class extends o {
|
|
|
28
28
|
}
|
|
29
29
|
applyStoredValue(e) {
|
|
30
30
|
e.forEach((e) => {
|
|
31
|
-
let t = this.storedValue !== "" &&
|
|
32
|
-
|
|
31
|
+
let t = this.storedValue !== "" && a(e) === this.storedValue;
|
|
32
|
+
o(e) !== t && (e.checked = t);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
createGroupContext() {
|
|
@@ -39,7 +39,7 @@ var l = class extends o {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
n([
|
|
42
|
+
n([c({ context: i }), t()], l.prototype, "groupContext", void 0), n([r({ type: String })], l.prototype, "value", null);
|
|
43
43
|
try {
|
|
44
44
|
e("pkt-radio-group")(l);
|
|
45
45
|
} catch {
|
|
@@ -2,11 +2,18 @@ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DBugHP
|
|
|
2
2
|
import { t as o } from "./class-map-Bf-QzUpN.js";
|
|
3
3
|
import { n as s, t as c } from "./consume-Bp12si68.js";
|
|
4
4
|
import { n as l, t as u } from "./ref-y_5qv9vU.js";
|
|
5
|
-
import { t as d } from "./input-element-
|
|
6
|
-
//#region
|
|
7
|
-
var f =
|
|
5
|
+
import { t as d } from "./input-element-BGbT4ICl.js";
|
|
6
|
+
//#region ../../shared-types/radiobutton.ts
|
|
7
|
+
var f = {
|
|
8
|
+
defaultChecked: !1,
|
|
9
|
+
hasTile: !1,
|
|
10
|
+
disabled: !1,
|
|
11
|
+
hasError: !1,
|
|
12
|
+
requiredTag: !1,
|
|
13
|
+
optionalTag: !1
|
|
14
|
+
}, p = s(Symbol("pkt-radio-group-context")), m = class extends d {
|
|
8
15
|
constructor(...e) {
|
|
9
|
-
super(...e), this.inputRef = u(), this.value = "", this.checkHelptext = null, this.defaultChecked =
|
|
16
|
+
super(...e), this.inputRef = u(), this.value = "", this.checkHelptext = null, this.defaultChecked = f.defaultChecked, this.hasTile = f.hasTile, this.checked = null, this.type = "radio", this.inputSize = void 0, this.tagText = null, this.optionalTag = f.optionalTag, this.requiredTag = f.requiredTag, this._checked = !1;
|
|
10
17
|
}
|
|
11
18
|
connectedCallback() {
|
|
12
19
|
super.connectedCallback();
|
|
@@ -76,26 +83,26 @@ var f = s(Symbol("pkt-radio-group-context")), p = class extends d {
|
|
|
76
83
|
i([a({
|
|
77
84
|
type: String,
|
|
78
85
|
reflect: !0
|
|
79
|
-
})],
|
|
86
|
+
})], m.prototype, "value", void 0), i([a({ type: String })], m.prototype, "checkHelptext", void 0), i([a({ type: Boolean })], m.prototype, "defaultChecked", void 0), i([a({ type: Boolean })], m.prototype, "hasTile", void 0), i([a({
|
|
80
87
|
type: Boolean,
|
|
81
88
|
reflect: !0
|
|
82
|
-
})],
|
|
89
|
+
})], m.prototype, "checked", void 0), i([a({
|
|
83
90
|
type: String,
|
|
84
91
|
reflect: !0
|
|
85
|
-
})],
|
|
92
|
+
})], m.prototype, "type", void 0), i([a({
|
|
86
93
|
type: String,
|
|
87
94
|
attribute: "input-size"
|
|
88
|
-
})],
|
|
89
|
-
context:
|
|
95
|
+
})], m.prototype, "inputSize", void 0), i([a({ type: String })], m.prototype, "tagText", void 0), i([a({ type: Boolean })], m.prototype, "optionalTag", void 0), i([a({ type: String })], m.prototype, "optionalText", void 0), i([a({ type: Boolean })], m.prototype, "requiredTag", void 0), i([a({ type: String })], m.prototype, "requiredText", void 0), i([r()], m.prototype, "_checked", void 0), i([c({
|
|
96
|
+
context: p,
|
|
90
97
|
subscribe: !0
|
|
91
|
-
}), r()],
|
|
98
|
+
}), r()], m.prototype, "groupContext", void 0);
|
|
92
99
|
try {
|
|
93
|
-
t("pkt-radiobutton")(
|
|
100
|
+
t("pkt-radiobutton")(m);
|
|
94
101
|
} catch {
|
|
95
102
|
console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert");
|
|
96
103
|
}
|
|
97
104
|
//#endregion
|
|
98
105
|
//#region src/components/radiobutton/index.ts
|
|
99
|
-
var
|
|
106
|
+
var h = m;
|
|
100
107
|
//#endregion
|
|
101
|
-
export {
|
|
108
|
+
export { m as n, p as r, h as t };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./consume-kEjgTrAp.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-kIrd5ABs.cjs");var a={defaultChecked:!1,hasTile:!1,disabled:!1,hasError:!1,requiredTag:!1,optionalTag:!1},o=n.n(Symbol(`pkt-radio-group-context`)),s=class extends i.t{constructor(...e){super(...e),this.inputRef=r.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=a.defaultChecked,this.hasTile=a.hasTile,this.checked=null,this.type=`radio`,this.inputSize=void 0,this.tagText=null,this.optionalTag=a.optionalTag,this.requiredTag=a.requiredTag,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let n=this.hasTile||!!this.groupContext?.hasTile,i=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":n,"pkt-input-check__input--tile-disabled":this.isDisabled&&n}),a=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError||!!this.groupContext?.hasError}),o=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.isDisabled,"pkt-sr-only":this.hideLabel}),s=`pkt-tag pkt-tag--small pkt-tag--thin-text`,c=this.pktStrings.get(`forms`),l=()=>e._`
|
|
2
|
+
${this.tagText?e._`<span class=${s+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
|
|
3
|
+
${this.optionalTag?e._`<span class=${s+` pkt-tag--blue-light`}
|
|
4
|
+
>${this.optionalText??c.optional}</span
|
|
5
|
+
>`:e.h}
|
|
6
|
+
${this.requiredTag?e._`<span class=${s+` pkt-tag--beige`}
|
|
7
|
+
>${this.requiredText??c.required}</span
|
|
8
|
+
>`:e.h}
|
|
9
|
+
`,u=this.id+`-check-label`,d=this.id+`-check-helptext`;return e._`
|
|
10
|
+
<div class="pkt-input-check${this.inputSize?` pkt-input-check--${this.inputSize}`:``}">
|
|
11
|
+
<div class=${i}>
|
|
12
|
+
<input
|
|
13
|
+
id=${this.id+`-internal`}
|
|
14
|
+
class=${a}
|
|
15
|
+
type="radio"
|
|
16
|
+
?disabled=${this.isDisabled}
|
|
17
|
+
form=""
|
|
18
|
+
name=${this.internalName}
|
|
19
|
+
${r.n(this.inputRef)}
|
|
20
|
+
@change=${this.toggleChecked}
|
|
21
|
+
@input=${this.handleInput}
|
|
22
|
+
@blur=${this.onBlur}
|
|
23
|
+
@focus=${this.onFocus}
|
|
24
|
+
?checked=${this.checked}
|
|
25
|
+
aria-labelledby=${this.label?u:e.h}
|
|
26
|
+
aria-describedby=${this.checkHelptext?d:e.h}
|
|
27
|
+
/>
|
|
28
|
+
${e._`
|
|
29
|
+
<label class=${o} for=${this.id+`-internal`}>
|
|
30
|
+
<span id=${u}>${this.label} ${l()}</span>
|
|
31
|
+
${this.checkHelptext?e._`<div id=${d} class="pkt-input-check__input-helptext">
|
|
32
|
+
${this.checkHelptext}
|
|
33
|
+
</div>`:e.h}
|
|
34
|
+
</label>
|
|
35
|
+
`}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`}handleInput(e){e.stopImmediatePropagation()}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};e.n([e.u({type:String,reflect:!0})],s.prototype,`value`,void 0),e.n([e.u({type:String})],s.prototype,`checkHelptext`,void 0),e.n([e.u({type:Boolean})],s.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],s.prototype,`hasTile`,void 0),e.n([e.u({type:Boolean,reflect:!0})],s.prototype,`checked`,void 0),e.n([e.u({type:String,reflect:!0})],s.prototype,`type`,void 0),e.n([e.u({type:String,attribute:`input-size`})],s.prototype,`inputSize`,void 0),e.n([e.u({type:String})],s.prototype,`tagText`,void 0),e.n([e.u({type:Boolean})],s.prototype,`optionalTag`,void 0),e.n([e.u({type:String})],s.prototype,`optionalText`,void 0),e.n([e.u({type:Boolean})],s.prototype,`requiredTag`,void 0),e.n([e.u({type:String})],s.prototype,`requiredText`,void 0),e.n([e.l()],s.prototype,`_checked`,void 0),e.n([n.t({context:o,subscribe:!0}),e.l()],s.prototype,`groupContext`,void 0);try{e.d(`pkt-radiobutton`)(s)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-DOt8HbXA.cjs"),n=require("./if-defined-CiML3MTM.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-kIrd5ABs.cjs"),a=require("./pkt-options-controller-Ck_549wx.cjs"),o=require("./input-wrapper-EvzyXMw-.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
|
${t.n(this,[`helptext`])}
|
|
4
4
|
.strings=${this.strings}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as e, d as t, l as n, n as r, u as i } from "./element-DBugHPKM.js";
|
|
2
|
-
import { n as a } from "./element-with-slot-
|
|
2
|
+
import { n as a } from "./element-with-slot-U981OZM_.js";
|
|
3
3
|
import { t as o } from "./if-defined-O59_I-e-.js";
|
|
4
4
|
import { n as s, t as c } from "./ref-y_5qv9vU.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-BGbT4ICl.js";
|
|
6
|
+
import { t as u } from "./pkt-options-controller-DTOlYR9b.js";
|
|
7
|
+
import { r as d } from "./input-wrapper-Uks0spRR.js";
|
|
8
8
|
//#region src/base-elements/options-input-element.ts
|
|
9
9
|
var f = class extends l {
|
|
10
10
|
constructor(...e) {
|
|
@@ -13,6 +13,8 @@ export { CARD_SKINS, CARD_PADDINGS, CARD_IMAGE_SHAPES, CARD_IMAGE_ASPECTS, CARD_
|
|
|
13
13
|
export type { TCardSkin, TCardPadding, TCardImageShape, TCardImageAspect, TCardTagPosition, ICardTag, ICardImage, IPktCardBase, ICardSpecProps, } from './card';
|
|
14
14
|
export { CHECKBOX_LABEL_POSITIONS, CHECKBOX_DEFAULTS } from './checkbox';
|
|
15
15
|
export type { TCheckboxLabelPosition, IPktCheckboxBase, ICheckboxSpecProps } from './checkbox';
|
|
16
|
+
export { RADIOBUTTON_DEFAULTS } from './radiobutton';
|
|
17
|
+
export type { IPktRadioButtonBase, IRadioButtonSpecProps } from './radiobutton';
|
|
16
18
|
export { OPTION_GROUP_DEFAULTS } from './option-group';
|
|
17
19
|
export type { IPktOptionGroupBase, IPktRadioGroupBase, IPktCheckboxGroupBase, IRadioGroupSpecProps, ICheckboxGroupSpecProps, } from './option-group';
|
|
18
20
|
export { CONSENT_TRIGGER_TYPES, CONSENT_TRIGGER_TYPE_OPTIONS, CONSENT_DEFAULTS } from './consent';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* radiobutton.ts
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for pkt-radiobutton.
|
|
5
|
+
* Used by React, Elements, and typed component specs.
|
|
6
|
+
*/
|
|
7
|
+
import type { IPktStringsProps } from '../shared-strings';
|
|
8
|
+
import type { IFormFieldErrorProps, IFormFieldLabelProps, ITagOptionalRequiredProps } from './form-field';
|
|
9
|
+
import type { TPktInputSize } from './size';
|
|
10
|
+
/**
|
|
11
|
+
* Radio button props shared by React and Elements.
|
|
12
|
+
*
|
|
13
|
+
* @remarks React requires `id`, `name` and `label`, and widens `checkHelptext` to `ReactNode`.
|
|
14
|
+
* Elements widens `label` and `checkHelptext` to `| null` (Lit uses `null` for an unset
|
|
15
|
+
* attribute), accepts booleanish strings for `checked`, and omits `form`, which is a getter
|
|
16
|
+
* returning the associated `HTMLFormElement`, not the form id.
|
|
17
|
+
*/
|
|
18
|
+
export interface IPktRadioButtonBase extends IFormFieldLabelProps, Pick<IFormFieldErrorProps, 'disabled' | 'hasError'>, ITagOptionalRequiredProps, IPktStringsProps<'forms'> {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
form?: string;
|
|
22
|
+
value?: string;
|
|
23
|
+
checkHelptext?: string;
|
|
24
|
+
defaultChecked?: boolean;
|
|
25
|
+
checked?: boolean;
|
|
26
|
+
hasTile?: boolean;
|
|
27
|
+
inputSize?: TPktInputSize;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Documented RadioButton props (subset of `IPktRadioButtonBase`).
|
|
31
|
+
* Used for typed component specs in documentation.
|
|
32
|
+
*/
|
|
33
|
+
export type IRadioButtonSpecProps = Pick<IPktRadioButtonBase, 'id' | 'name' | 'form' | 'label' | 'checked' | 'defaultChecked' | 'hasTile' | 'inputSize' | 'disabled' | 'checkHelptext' | 'value' | 'hasError' | 'requiredTag' | 'requiredText' | 'optionalTag' | 'optionalText' | 'tagText'>;
|
|
34
|
+
/**
|
|
35
|
+
* Default values for pkt-radiobutton. Single source of truth for both frameworks.
|
|
36
|
+
* `checked` is intentionally absent — React must keep it `undefined` to stay uncontrolled.
|
|
37
|
+
* `inputSize` is intentionally absent — unset inherits the size from the surrounding input-wrapper.
|
|
38
|
+
*/
|
|
39
|
+
export declare const RADIOBUTTON_DEFAULTS: {
|
|
40
|
+
readonly defaultChecked: false;
|
|
41
|
+
readonly hasTile: false;
|
|
42
|
+
readonly disabled: false;
|
|
43
|
+
readonly hasError: false;
|
|
44
|
+
readonly requiredTag: false;
|
|
45
|
+
readonly optionalTag: false;
|
|
46
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-DOt8HbXA.cjs"),n=require("./if-defined-CiML3MTM.cjs"),r=require("./consume-kEjgTrAp.cjs"),i=require("./provide-Cz18sYug.cjs"),a=require("./ref-CB7e9nMY.cjs");var o=r.n(Symbol(`pkt-tabs-context`)),s=class extends t.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 n=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
3
|
<div class="pkt-tabs__list" role=${n}>${t.i(this)}</div>
|
|
4
4
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as e, d as t, l as n, n as r, u as i } from "./element-DBugHPKM.js";
|
|
2
|
-
import { i as a, t as o } from "./element-with-slot-
|
|
2
|
+
import { i as a, t as o } from "./element-with-slot-U981OZM_.js";
|
|
3
3
|
import { t as s } from "./if-defined-O59_I-e-.js";
|
|
4
4
|
import { n as c, t as l } from "./consume-Bp12si68.js";
|
|
5
5
|
import { t as u } from "./provide-_MnlMGnw.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-DOt8HbXA.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./if-defined-CiML3MTM.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 r.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=r.r(this).getNodes().map(e=>e.textContent??``).join(``).trim();e&&(this._ariaDescription=n.t(this.pktStrings.get(`tag`).remove,{label:e}))}}render(){let n={"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}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, d as t, l as n, n as r, u as i } from "./element-DBugHPKM.js";
|
|
2
2
|
import { t as a } from "./class-map-Bf-QzUpN.js";
|
|
3
3
|
import { t as o } from "./format-BTeSVkED.js";
|
|
4
|
-
import { i as s, r as c, t as l } from "./element-with-slot-
|
|
4
|
+
import { i as s, r as c, t as l } from "./element-with-slot-U981OZM_.js";
|
|
5
5
|
import "./icon-Bao96Zb8.js";
|
|
6
6
|
import { t as u } from "./if-defined-O59_I-e-.js";
|
|
7
7
|
var d = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
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, u as l } from "./element-DBugHPKM.js";
|
|
2
2
|
import { t as u } from "./class-map-Bf-QzUpN.js";
|
|
3
3
|
import { i as d, r as f } from "./directive-helpers-CwxFepWh.js";
|
|
4
|
-
import { n as p } from "./element-with-slot-
|
|
4
|
+
import { n as p } from "./element-with-slot-U981OZM_.js";
|
|
5
5
|
import "./icon-Bao96Zb8.js";
|
|
6
6
|
import { t as m } from "./if-defined-O59_I-e-.js";
|
|
7
7
|
import { n as h, t as g } from "./ref-y_5qv9vU.js";
|
|
8
|
-
import { t as _ } from "./input-element-
|
|
9
|
-
import { r as v } from "./input-wrapper-
|
|
8
|
+
import { t as _ } from "./input-element-BGbT4ICl.js";
|
|
9
|
+
import { r as v } from "./input-wrapper-Uks0spRR.js";
|
|
10
10
|
//#region ../../node_modules/lit-html/directives/live.js
|
|
11
11
|
var y = n(class extends c {
|
|
12
12
|
constructor(e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DOt8HbXA.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./if-defined-CiML3MTM.cjs"),a=require("./ref-CB7e9nMY.cjs"),o=require("./input-element-kIrd5ABs.cjs"),s=require("./input-wrapper-EvzyXMw-.cjs");var c=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),l=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.cols=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),e.has(`value`)&&this.valueChanged(this.value,e.get(`value`))}render(){let n=this.effectiveCounter(this.counterMaxLength>0),o=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":n&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),l=this.ariaLabelledby||`${this.id}-input-label`;return e._`<pkt-input-wrapper
|
|
2
2
|
${r.n(this,[`helptext`])}
|
|
3
3
|
.strings=${this.strings}
|
|
4
4
|
label=${this.label}
|