@oslokommune/punkt-elements 20.0.3 → 20.1.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 +13 -0
- package/dist/{accordion-5N_ptxrN.cjs → accordion-CSSp30G1.cjs} +1 -1
- package/dist/{accordion-C5cu1xXT.js → accordion-DIjltHSH.js} +11 -14
- package/dist/{alert-DkyTTo7S.cjs → alert-0a5lX0pL.cjs} +12 -12
- package/dist/{alert-CA1fDbyc.js → alert-ZrB-P881.js} +36 -38
- package/dist/{async-directive-DCLIOGR8.cjs → async-directive-Bn7zgxUy.cjs} +1 -1
- package/dist/{async-directive-BcS8rfeC.js → async-directive-Ct3Mrb1M.js} +10 -11
- package/dist/{backlink-CXOxMeyt.cjs → backlink-BAvqdPlG.cjs} +1 -1
- package/dist/{backlink-CDBRcaAu.js → backlink-MBTAhQuD.js} +5 -7
- package/dist/{booleanish-OQJTYSrw.js → booleanish-CBa3Cr2h.js} +1 -2
- package/dist/{breadcrumbs-5oUaCef3.js → breadcrumbs-DtEt1-wn.js} +3 -4
- package/dist/{button-Bswo1C0M.js → button-CJzu0l5A.js} +45 -35
- package/dist/button-DHVRpzpS.cjs +32 -0
- package/dist/{calendar-BOd-9PDd.js → calendar-CkAAgviq.js} +66 -76
- package/dist/calendar-xYEsKilS.cjs +85 -0
- package/dist/{card-CKStAH0Q.js → card-CsEfBJcP.js} +10 -12
- package/dist/{card-BbV4OBqb.cjs → card-XznwedEG.cjs} +1 -1
- package/dist/{checkbox-iMOdzpJ_.cjs → checkbox-Cg7wnn8U.cjs} +1 -1
- package/dist/{checkbox-DIJbuqWm.js → checkbox-XvlUQmg5.js} +8 -10
- package/dist/{checkbox-group-Kua6HuRE.cjs → checkbox-group-BF29zyLd.cjs} +1 -1
- package/dist/{checkbox-group-DLLbWgQb.js → checkbox-group-CRIV5CX0.js} +8 -10
- package/dist/{class-map-BDwVSgLb.js → class-map-C9n5CNC8.js} +2 -3
- package/dist/{classutils-DcYnSgfc.js → classutils-C4jETHHk.js} +1 -2
- package/dist/{combobox-Pxa80TeZ.js → combobox-CDJcIkNJ.js} +63 -66
- package/dist/combobox-DuXavWEY.cjs +139 -0
- package/dist/{consent-UkinU27V.cjs → consent-BOSXNt4Y.cjs} +1 -1
- package/dist/{consent-p-0n2b9x.js → consent-DwppvYBR.js} +5 -7
- package/dist/{consume-Bp12si68.js → consume-C6aWEFx-.js} +4 -8
- package/dist/{converters-CW6SN0TT.cjs → converters-Dp64-kF1.cjs} +1 -1
- package/dist/{converters-CYgQrWVm.js → converters-v_GK06o3.js} +36 -72
- package/dist/{datepicker-Cpiu_Nrf.cjs → datepicker-Cnrbqm62.cjs} +53 -53
- package/dist/{datepicker-BpxUWiIC.js → datepicker-DHdFA8Dx.js} +82 -88
- package/dist/define-component-spec-wHP10r2x.js +5 -0
- package/dist/{dialog-polyfill.esm-D39dWbRt.js → dialog-polyfill.esm-BGBREnq_.js} +2 -3
- package/dist/dialog-polyfill.esm-BPk0-8XP.cjs +1 -0
- package/dist/{directive-helpers-BoDzpPID.js → directive-helpers-KMRvtO9j.js} +2 -3
- package/dist/{element-DLgZkx5L.js → element-Bwc-likm.js} +9 -18
- package/dist/{element-with-slot-mG-h7Sjw.js → element-with-slot-47quDZRt.js} +4 -6
- package/dist/{element-with-slot-CeKuRE3_.cjs → element-with-slot-D_8fAzCW.cjs} +1 -1
- package/dist/{fetch-header-footer-data-Pc32etrk.js → fetch-header-footer-data-CPVt_P8s.js} +3 -6
- package/dist/{fileupload-vPDmtXiM.js → fileupload-BQw5nlzQ.js} +25 -36
- package/dist/{fileupload-DXJtAagE.cjs → fileupload-Cjde62AR.cjs} +1 -1
- package/dist/{focus-modality-controller-Dc2S-KqR.js → focus-modality-controller-DVsT6GeR.js} +1 -2
- package/dist/focus-trap-C-PcFOw6.js +42 -0
- package/dist/focus-trap-C9tsr-xL.cjs +1 -0
- package/dist/{footer-CpE05IW2.cjs → footer-NQaQc2DH.cjs} +9 -9
- package/dist/{footer-D8t0PCPC.js → footer-SbOYv50e.js} +20 -24
- package/dist/{format-BTeSVkED.js → format-DwjTfa9h.js} +1 -2
- package/dist/{header-ChT1hHNA.js → header-CZnKVVt4.js} +22 -26
- package/dist/{header-CiwHNHKD.cjs → header-YbbGgmsD.cjs} +2 -2
- package/dist/{header-menu-Dq9lwNr1.cjs → header-menu-BJMMwrCR.cjs} +1 -1
- package/dist/{header-menu-BrjsNjBH.js → header-menu-k2ACrfOv.js} +9 -11
- package/dist/{heading-DAkjw2Am.cjs → heading-BNlor2MU.cjs} +1 -1
- package/dist/{heading-CMZmPEL9.js → heading-SYKHysr8.js} +19 -21
- package/dist/{helptext-Bse1LpRd.cjs → helptext-CQaNvbiv.cjs} +9 -9
- package/dist/{helptext-BFQzrOw4.js → helptext-kKmVQkwo.js} +20 -22
- package/dist/{icon-C1oCGwEe.js → icon-CZDw42U7.js} +5 -8
- package/dist/if-defined-B3pYog2C.js +4 -0
- package/dist/{input-element-2LHxo0em.cjs → input-element-CfZIyfon.cjs} +1 -1
- package/dist/{input-element-De40zUox.js → input-element-DE0FzjgP.js} +19 -25
- package/dist/{input-wrapper-C_Rzwxx7.cjs → input-wrapper-CbYMk21W.cjs} +1 -1
- package/dist/{input-wrapper-DkpJS1hR.js → input-wrapper-DYg1VHPv.js} +13 -15
- package/dist/{link-DLPpwjq4.js → link-Bc4zf-Dj.js} +19 -22
- package/dist/link-lPrxhYq0.cjs +7 -0
- package/dist/{linkcard-DIG6VYpl.cjs → linkcard-Bih7HS2t.cjs} +1 -1
- package/dist/{linkcard-Dr-r8jBO.js → linkcard-LCFAdVsG.js} +7 -9
- package/dist/{listbox-HrH4JonS.cjs → listbox-Du8llYth.cjs} +10 -10
- package/dist/{listbox-DAvIBH4P.js → listbox-df8gHweY.js} +17 -19
- package/dist/{loader-CFidlqSG.js → loader-C-2b3bGK.js} +9 -12
- package/dist/{loader-DTIrOtTo.cjs → loader-DiQSwWpb.cjs} +1 -1
- package/dist/{messagebox-BLYx3AL7.cjs → messagebox-BiG-fJX9.cjs} +1 -1
- package/dist/{messagebox-B_07P0QA.js → messagebox-CH3bKoJO.js} +9 -11
- package/dist/modal-B3rnE83a.cjs +37 -0
- package/dist/{modal-CA_M2Ix6.js → modal-SBJ8aGvM.js} +33 -35
- package/dist/{option-group-element-DzM8YznZ.js → option-group-element-DtSw52Dr.js} +7 -8
- package/dist/{option-group-element-CVNaBIlP.cjs → option-group-element-dN0ntPZk.cjs} +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-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.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-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 +2 -3
- 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-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- 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-listbox.cjs +1 -1
- package/dist/pkt-listbox.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-CzvBlEPD.js → pkt-options-controller-Dz7DP0wC.js} +2 -3
- package/dist/{pkt-options-controller-9zoH1OBW.cjs → pkt-options-controller-WsHVdPJA.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.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-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.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/{progressbar-CfCc2zhp.js → progressbar-DlbkKRgP.js} +9 -11
- package/dist/{progressbar-BdqIhC1Z.cjs → progressbar-Wyq_Q1Ur.cjs} +1 -1
- package/dist/{provide-_MnlMGnw.js → provide-DFu2tSv_.js} +3 -5
- package/dist/{radio-group-BRY_74od.js → radio-group-bRF8fnPW.js} +8 -10
- package/dist/{radio-group-CsUgnEv0.cjs → radio-group-u1IH7g-4.cjs} +1 -1
- package/dist/{radiobutton-CQhuG2lj.cjs → radiobutton-86ZvvDmJ.cjs} +1 -1
- package/dist/{radiobutton-lHnq8wX_.js → radiobutton-Bf6aFfYt.js} +8 -10
- package/dist/{ref-B6p6mQkO.cjs → ref-C6VUWwmF.cjs} +1 -1
- package/dist/{ref-BAegS9BR.js → ref-qE1RBrI7.js} +3 -4
- package/dist/{repeat-Cy1M16Di.js → repeat-c2P6osbb.js} +3 -4
- package/dist/{scroll-lock-CR-g54ai.js → scroll-lock-C9jzbJ4E.js} +1 -2
- package/dist/{searchinput-TAqMUJ0B.cjs → searchinput-D5l64Mkb.cjs} +7 -7
- package/dist/{searchinput-BLGaXkP6.js → searchinput-DN8kDZQ1.js} +18 -20
- package/dist/{select-Dle67Uwv.cjs → select-C7kAlSxs.cjs} +15 -15
- package/dist/{select-BvtUxW0Q.js → select-CXIEM2qY.js} +15 -18
- package/dist/shared-types/button.d.ts +13 -0
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types-BvRk9kiK.js +0 -0
- package/dist/{tabs-BmmTUKuC.js → tabs-Cg16Sl3u.js} +57 -60
- package/dist/tabs-n7hQWwyI.cjs +40 -0
- package/dist/{tag-BZdC0voc.cjs → tag-BAikRN2Y.cjs} +1 -1
- package/dist/{tag-Cam7ISOF.js → tag-HXcXopyA.js} +9 -11
- package/dist/{textarea-Djp5L2Zd.js → textarea-12le8b4I.js} +12 -14
- package/dist/{textarea-DSX3jMlI.cjs → textarea-CRcSfWgX.cjs} +1 -1
- package/dist/{textinput-CBrOZcvL.js → textinput-CC0zxUBT.js} +11 -13
- package/dist/{textinput-CN2F3Q3H.cjs → textinput-Dooq2n8W.cjs} +1 -1
- package/dist/{timepicker-CkaJkIGn.cjs → timepicker-BM4I5w-i.cjs} +20 -20
- package/dist/{timepicker-CT4wfrgQ.js → timepicker-Cz81VQu3.js} +27 -28
- package/dist/{utils-BwF4QSrq.js → utils-Dn5ykFtS.js} +1 -2
- package/package.json +10 -10
- package/src/components/button/button.ts +14 -14
- package/dist/button-bVWAX98x.cjs +0 -32
- package/dist/calendar-CDTCgTJn.cjs +0 -85
- package/dist/combobox-CWL8T3UK.cjs +0 -139
- package/dist/define-component-spec-BYOSeplU.js +0 -6
- package/dist/dialog-polyfill.esm-CW51hN2p.cjs +0 -1
- package/dist/focus-trap-DG3pEuyJ.js +0 -60
- package/dist/focus-trap-DSv4Ifqm.cjs +0 -1
- package/dist/if-defined-DiYi2v_Q.js +0 -5
- package/dist/link-pkFJ11Zd.cjs +0 -7
- package/dist/modal-BvTfLfFq.cjs +0 -37
- package/dist/shared-types-A6iGIX-f.js +0 -1
- package/dist/tabs-B96Orh6O.cjs +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [20.1.0](https://github.com/oslokommune/punkt/compare/20.0.5...20.1.0) (2026-11-09)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
* Button - bruk felles standardverdier (#3820).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [20.0.5](https://github.com/oslokommune/punkt/compare/20.0.4...20.0.5) (2026-11-09)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
|
|
8
21
|
## [20.1.0](https://github.com/oslokommune/punkt/compare/20.0.2...20.1.0) (2026-11-06)
|
|
9
22
|
|
|
10
23
|
### Bug Fixes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./if-defined-Ci4ZQsgL.cjs"),i=require("./consume-kEjgTrAp.cjs"),a=require("./provide-Cz18sYug.cjs"),o=require("./ref-C6VUWwmF.cjs");var s=[`beige`,`blue`],c=i.n(Symbol(`pkt-accordion-context`)),l=class extends e.c{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``,this.context={skin:this.skin}}willUpdate(e){e.has(`skin`)&&(this.context={...this.context,skin:this.skin})}updated(e){e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){let n={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e._`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
4
|
class=${t.t(n)}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { i as s, t as c } from "./element-with-slot-
|
|
4
|
-
import "./shared-types-
|
|
5
|
-
import { t as l } from "./if-defined-
|
|
6
|
-
import { n as u, t as d } from "./consume-
|
|
7
|
-
import { t as f } from "./provide-
|
|
8
|
-
import { n as p, t as m } from "./ref-
|
|
9
|
-
|
|
1
|
+
import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-Bwc-likm.js";
|
|
2
|
+
import { t as o } from "./class-map-C9n5CNC8.js";
|
|
3
|
+
import { i as s, t as c } from "./element-with-slot-47quDZRt.js";
|
|
4
|
+
import "./shared-types-BvRk9kiK.js";
|
|
5
|
+
import { t as l } from "./if-defined-B3pYog2C.js";
|
|
6
|
+
import { n as u, t as d } from "./consume-C6aWEFx-.js";
|
|
7
|
+
import { t as f } from "./provide-DFu2tSv_.js";
|
|
8
|
+
import { n as p, t as m } from "./ref-qE1RBrI7.js";
|
|
9
|
+
// ../../shared-types/accordion.ts
|
|
10
10
|
var h = ["beige", "blue"], g = u(Symbol("pkt-accordion-context")), _ = class extends t {
|
|
11
11
|
constructor(...e) {
|
|
12
12
|
super(...e), this.ariaLabelledBy = "", this.compact = !1, this.skin = "borderless", this.name = "", this.context = { skin: this.skin };
|
|
@@ -74,8 +74,7 @@ try {
|
|
|
74
74
|
} catch {
|
|
75
75
|
console.warn("Forsøker å definere <pkt-accordion>, men den er allerede definert");
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
//#region src/components/accordion/accordionitem.ts
|
|
77
|
+
// src/components/accordion/accordionitem.ts
|
|
79
78
|
var v = class extends c {
|
|
80
79
|
constructor() {
|
|
81
80
|
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = m();
|
|
@@ -151,8 +150,6 @@ try {
|
|
|
151
150
|
} catch {
|
|
152
151
|
console.warn("Forsøker å definere <pkt-accordion-item>, men den er allerede definert");
|
|
153
152
|
}
|
|
154
|
-
|
|
155
|
-
//#region src/components/accordion/index.ts
|
|
153
|
+
// src/components/accordion/index.ts
|
|
156
154
|
var y = _;
|
|
157
|
-
//#endregion
|
|
158
155
|
export { v as n, _ as r, y as t };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./class-map-C82GtM1w.cjs"),t=require("./element-CEarCnHH.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./classutils-CbklAJDe.cjs"),i=require("./format-B8meU8Tm.cjs"),a=require("./define-component-spec-DBNd2FJY.cjs");require("./icon-5A378_yh.cjs"),require("./button-DHVRpzpS.cjs");var o=[`off`,`polite`,`assertive`],s=[`info`,`success`,`warning`,`error`],c=[`medium`,`small`,`xsmall`],l={compact:!1},u=a.t({name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{reactOnly:!0,description:`React: Klikk-event for 'Lukk'-knappen`},close:{elementsOnly:!0,description:`Elements: Klikk-event for 'Lukk'-knappen`},"on-close":{elementsOnly:!0,description:`Elements: Samme event som <code>close</code>, beholdt for eldre Vue-oppsett.`,deprecated:`Bruk <code>close</code>. <code>on-close</code> fjernes i en senere hovedversjon.`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[...s],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[...o],default:`polite`,category:`accessibility`},size:{name:`Størrelse`,description:`Endrer størrelsen på ulike elementer i alerten.`,type:[...c],default:`medium`,category:`ui`},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`},compact:{name:`Kompakt`,description:`Kompakt visning av alerten.`,deprecated:"Bruk `size` i stedet; uten eksplisitt `size` gir compact størrelsen 'small'.",type:`boolean`,category:`ui`,default:l.compact}},slots:{default:{description:`Innholdet i meldingen`}}}),d=class extends n.t{constructor(){super(),this.compact=l.compact,this.title=``,this.skin=u.props.skin.default,this.ariaLive=u.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=u.props.closeAlert.default,this.date=null,this.role=`status`,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&e.get(`ariaLive`)!==void 0&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let r=this.size??(this.compact?`small`:`medium`),a={"pkt-alert":!0,[`pkt-alert--${r}`]:!0,[`pkt-alert--${this.skin}`]:!0,"pkt-hide":this._isClosed},o={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return t._`
|
|
2
2
|
<div
|
|
3
|
-
class=${
|
|
3
|
+
class=${e.t(a)}
|
|
4
4
|
aria-live=${this.ariaLiveAttr}
|
|
5
5
|
role=${this.role}
|
|
6
6
|
>
|
|
7
|
-
<div class=${
|
|
7
|
+
<div class=${e.t(o)}>
|
|
8
8
|
<pkt-icon
|
|
9
9
|
class="pkt-alert__icon"
|
|
10
10
|
aria-hidden="true"
|
|
11
11
|
name=${this.skin===`info`?`alert-information`:`alert-${this.skin}`}
|
|
12
12
|
></pkt-icon>
|
|
13
13
|
|
|
14
|
-
${this.closeAlert?
|
|
14
|
+
${this.closeAlert?t._`
|
|
15
15
|
<div class="pkt-alert__close">
|
|
16
16
|
<pkt-button
|
|
17
17
|
tabindex="0"
|
|
18
18
|
aria-label=${this.pktStrings.get(`generic`).close}
|
|
19
|
-
size=${
|
|
19
|
+
size=${r}
|
|
20
20
|
type="button"
|
|
21
21
|
skin="tertiary"
|
|
22
22
|
iconName="close"
|
|
@@ -26,14 +26,14 @@ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),
|
|
|
26
26
|
<span class="sr-only">${this.pktStrings.get(`generic`).close}</span>
|
|
27
27
|
</pkt-button>
|
|
28
28
|
</div>
|
|
29
|
-
`:
|
|
30
|
-
${this.title?
|
|
29
|
+
`:t.h}
|
|
30
|
+
${this.title?t._`<div class="pkt-alert__title">${this.title}</div>`:t.h}
|
|
31
31
|
|
|
32
|
-
<div class="pkt-alert__text">${
|
|
32
|
+
<div class="pkt-alert__text">${n.i(this)}</div>
|
|
33
33
|
|
|
34
|
-
${this.date?
|
|
35
|
-
${
|
|
36
|
-
</div>`:
|
|
34
|
+
${this.date?t._`<div class="pkt-alert__date">
|
|
35
|
+
${i.t(this.pktStrings.get(`alert`).lastUpdated,{date:this.date})}
|
|
36
|
+
</div>`:t.h}
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
|
-
`}};
|
|
39
|
+
`}};t.n([t.u({type:Boolean,reflect:!1})],d.prototype,`compact`,void 0),t.n([t.u({type:String,reflect:!0})],d.prototype,`title`,void 0),t.n([t.u({type:String,reflect:!0})],d.prototype,`skin`,void 0),t.n([t.u({type:String})],d.prototype,`ariaLive`,void 0),t.n([t.u({type:String,reflect:!0,attribute:`aria-live`})],d.prototype,`ariaLiveAttr`,void 0),t.n([t.u({type:Boolean,reflect:!0})],d.prototype,`closeAlert`,void 0),t.n([t.u({type:String,reflect:!0})],d.prototype,`date`,void 0),t.n([t.u({type:String})],d.prototype,`role`,void 0),t.n([t.u({type:String,attribute:`size`})],d.prototype,`size`,void 0),t.n([t.l()],d.prototype,`_isClosed`,void 0);try{t.d(`pkt-alert`)(d)}catch{console.warn(`Forsøker å definere <pkt-alert>, men den er allerede definert`)}var f=d;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { t as
|
|
8
|
-
import
|
|
9
|
-
import "./button-
|
|
10
|
-
|
|
1
|
+
import { t as e } from "./class-map-C9n5CNC8.js";
|
|
2
|
+
import { _ as t, d as n, h as r, l as i, n as a, u as o } from "./element-Bwc-likm.js";
|
|
3
|
+
import { i as s, t as c } from "./element-with-slot-47quDZRt.js";
|
|
4
|
+
import "./shared-types-BvRk9kiK.js";
|
|
5
|
+
import { t as l } from "./classutils-C4jETHHk.js";
|
|
6
|
+
import { t as u } from "./format-DwjTfa9h.js";
|
|
7
|
+
import { t as d } from "./define-component-spec-wHP10r2x.js";
|
|
8
|
+
import "./icon-CZDw42U7.js";
|
|
9
|
+
import "./button-CJzu0l5A.js";
|
|
10
|
+
// ../../shared-types/aria.ts
|
|
11
11
|
var f = [
|
|
12
12
|
"off",
|
|
13
13
|
"polite",
|
|
@@ -94,7 +94,7 @@ var f = [
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
slots: { default: { description: "Innholdet i meldingen" } }
|
|
97
|
-
}), _ = class extends
|
|
97
|
+
}), _ = class extends c {
|
|
98
98
|
constructor() {
|
|
99
99
|
super(), this.compact = h.compact, this.title = "", this.skin = g.props.skin.default, this.ariaLive = g.props.ariaLive.default, this.ariaLiveAttr = null, this.closeAlert = g.props.closeAlert.default, this.date = null, this.role = "status", this._isClosed = !1, this.close = (e) => {
|
|
100
100
|
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
|
|
@@ -115,38 +115,38 @@ var f = [
|
|
|
115
115
|
e === "ariaLive" && (this.ariaLiveAttr = n), super.attributeChangedCallback(e, t, n);
|
|
116
116
|
}
|
|
117
117
|
updated(e) {
|
|
118
|
-
super.updated(e), e.has("ariaLive") && e.get("ariaLive") !== void 0 && (this.ariaLiveAttr = this.ariaLive), e.has("_isClosed") &&
|
|
118
|
+
super.updated(e), e.has("ariaLive") && e.get("ariaLive") !== void 0 && (this.ariaLiveAttr = this.ariaLive), e.has("_isClosed") && l(this, "pkt-hide", this._isClosed);
|
|
119
119
|
}
|
|
120
120
|
render() {
|
|
121
|
-
let
|
|
121
|
+
let n = this.size ?? (this.compact ? "small" : "medium"), i = {
|
|
122
122
|
"pkt-alert": !0,
|
|
123
|
-
[`pkt-alert--${
|
|
123
|
+
[`pkt-alert--${n}`]: !0,
|
|
124
124
|
[`pkt-alert--${this.skin}`]: !0,
|
|
125
125
|
"pkt-hide": this._isClosed
|
|
126
|
-
},
|
|
126
|
+
}, a = {
|
|
127
127
|
"pkt-alert__grid": !0,
|
|
128
128
|
"pkt-alert__noTitle": !this.title,
|
|
129
129
|
"pkt-alert__noDate": !this.date
|
|
130
130
|
};
|
|
131
|
-
return
|
|
131
|
+
return t`
|
|
132
132
|
<div
|
|
133
|
-
class=${
|
|
133
|
+
class=${e(i)}
|
|
134
134
|
aria-live=${this.ariaLiveAttr}
|
|
135
135
|
role=${this.role}
|
|
136
136
|
>
|
|
137
|
-
<div class=${
|
|
137
|
+
<div class=${e(a)}>
|
|
138
138
|
<pkt-icon
|
|
139
139
|
class="pkt-alert__icon"
|
|
140
140
|
aria-hidden="true"
|
|
141
141
|
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
142
142
|
></pkt-icon>
|
|
143
143
|
|
|
144
|
-
${this.closeAlert ?
|
|
144
|
+
${this.closeAlert ? t`
|
|
145
145
|
<div class="pkt-alert__close">
|
|
146
146
|
<pkt-button
|
|
147
147
|
tabindex="0"
|
|
148
148
|
aria-label=${this.pktStrings.get("generic").close}
|
|
149
|
-
size=${
|
|
149
|
+
size=${n}
|
|
150
150
|
type="button"
|
|
151
151
|
skin="tertiary"
|
|
152
152
|
iconName="close"
|
|
@@ -156,49 +156,47 @@ var f = [
|
|
|
156
156
|
<span class="sr-only">${this.pktStrings.get("generic").close}</span>
|
|
157
157
|
</pkt-button>
|
|
158
158
|
</div>
|
|
159
|
-
` :
|
|
160
|
-
${this.title ?
|
|
159
|
+
` : r}
|
|
160
|
+
${this.title ? t`<div class="pkt-alert__title">${this.title}</div>` : r}
|
|
161
161
|
|
|
162
|
-
<div class="pkt-alert__text">${
|
|
162
|
+
<div class="pkt-alert__text">${s(this)}</div>
|
|
163
163
|
|
|
164
|
-
${this.date ?
|
|
165
|
-
${
|
|
166
|
-
</div>` :
|
|
164
|
+
${this.date ? t`<div class="pkt-alert__date">
|
|
165
|
+
${u(this.pktStrings.get("alert").lastUpdated, { date: this.date })}
|
|
166
|
+
</div>` : r}
|
|
167
167
|
</div>
|
|
168
168
|
</div>
|
|
169
169
|
`;
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
a([o({
|
|
173
173
|
type: Boolean,
|
|
174
174
|
reflect: !1
|
|
175
|
-
})], _.prototype, "compact", void 0),
|
|
175
|
+
})], _.prototype, "compact", void 0), a([o({
|
|
176
176
|
type: String,
|
|
177
177
|
reflect: !0
|
|
178
|
-
})], _.prototype, "title", void 0),
|
|
178
|
+
})], _.prototype, "title", void 0), a([o({
|
|
179
179
|
type: String,
|
|
180
180
|
reflect: !0
|
|
181
|
-
})], _.prototype, "skin", void 0),
|
|
181
|
+
})], _.prototype, "skin", void 0), a([o({ type: String })], _.prototype, "ariaLive", void 0), a([o({
|
|
182
182
|
type: String,
|
|
183
183
|
reflect: !0,
|
|
184
184
|
attribute: "aria-live"
|
|
185
|
-
})], _.prototype, "ariaLiveAttr", void 0),
|
|
185
|
+
})], _.prototype, "ariaLiveAttr", void 0), a([o({
|
|
186
186
|
type: Boolean,
|
|
187
187
|
reflect: !0
|
|
188
|
-
})], _.prototype, "closeAlert", void 0),
|
|
188
|
+
})], _.prototype, "closeAlert", void 0), a([o({
|
|
189
189
|
type: String,
|
|
190
190
|
reflect: !0
|
|
191
|
-
})], _.prototype, "date", void 0),
|
|
191
|
+
})], _.prototype, "date", void 0), a([o({ type: String })], _.prototype, "role", void 0), a([o({
|
|
192
192
|
type: String,
|
|
193
193
|
attribute: "size"
|
|
194
|
-
})], _.prototype, "size", void 0),
|
|
194
|
+
})], _.prototype, "size", void 0), a([i()], _.prototype, "_isClosed", void 0);
|
|
195
195
|
try {
|
|
196
|
-
|
|
196
|
+
n("pkt-alert")(_);
|
|
197
197
|
} catch {
|
|
198
198
|
console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert");
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
//#region src/components/alert/index.ts
|
|
200
|
+
// src/components/alert/index.ts
|
|
202
201
|
var v = _;
|
|
203
|
-
//#endregion
|
|
204
202
|
export { _ as n, v as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./directive-helpers-r7akb6wX.cjs"),t=require("./element-CEarCnHH.cjs");var n=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let e of r)e._$AO?.(t,!1),n(e,t);return!0},r=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},i=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),s(t)}};function a(e){this._$AN===void 0?this._$AM=e:(r(this),this._$AM=e,i(this))}function o(e,t=!1,i=0){let a=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0){if(t){if(Array.isArray(a))for(let e=i;e<a.length;e++)n(a[e],!1),r(a[e]);else a!=null&&(n(a,!1),r(a))}else n(this,e)}}var s=e=>{e.type==t.m.CHILD&&(e._$AP??=o,e._$AQ??=a)},c=class extends t.p{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),i(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(n(this,e),r(this))}setValue(t){if(e.i(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { i as e } from "./directive-helpers-KMRvtO9j.js";
|
|
2
|
+
import { m as t, p as n } from "./element-Bwc-likm.js";
|
|
3
|
+
// ../../node_modules/lit-html/async-directive.js
|
|
4
4
|
var r = (e, t) => {
|
|
5
5
|
let n = e._$AN;
|
|
6
6
|
if (n === void 0) return !1;
|
|
@@ -32,9 +32,9 @@ function s(e, t = !1, n = 0) {
|
|
|
32
32
|
} else r(this, e);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
var c = (
|
|
36
|
-
|
|
37
|
-
}, l = class extends
|
|
35
|
+
var c = (e) => {
|
|
36
|
+
e.type == t.CHILD && (e._$AP ??= s, e._$AQ ??= o);
|
|
37
|
+
}, l = class extends n {
|
|
38
38
|
constructor() {
|
|
39
39
|
super(...arguments), this._$AN = void 0;
|
|
40
40
|
}
|
|
@@ -44,15 +44,14 @@ var c = (t) => {
|
|
|
44
44
|
_$AO(e, t = !0) {
|
|
45
45
|
e !== this.isConnected && (this.isConnected = e, e ? this.reconnected?.() : this.disconnected?.()), t && (r(this, e), i(this));
|
|
46
46
|
}
|
|
47
|
-
setValue(
|
|
48
|
-
if (
|
|
47
|
+
setValue(t) {
|
|
48
|
+
if (e(this._$Ct)) this._$Ct._$AI(t, this);
|
|
49
49
|
else {
|
|
50
|
-
let
|
|
51
|
-
|
|
50
|
+
let e = [...this._$Ct._$AH];
|
|
51
|
+
e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
disconnected() {}
|
|
55
55
|
reconnected() {}
|
|
56
56
|
};
|
|
57
|
-
//#endregion
|
|
58
57
|
export { l as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs")
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./if-defined-Ci4ZQsgL.cjs");require("./icon-5A378_yh.cjs");var n=class extends e.t{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=null}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return e._`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||this.pktStrings.get(`backlink`).label}
|
|
4
4
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e, d as t, n, t as r, u as i } from "./element-
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { _ as e, d as t, n, t as r, u as i } from "./element-Bwc-likm.js";
|
|
2
|
+
import { t as a } from "./if-defined-B3pYog2C.js";
|
|
3
|
+
import "./icon-CZDw42U7.js";
|
|
4
|
+
// src/components/backlink/backlink.ts
|
|
5
5
|
var o = class extends r {
|
|
6
6
|
constructor(...e) {
|
|
7
7
|
super(...e), this.href = "", this.text = "Forsiden", this.ariaLabel = null;
|
|
@@ -31,8 +31,6 @@ try {
|
|
|
31
31
|
} catch {
|
|
32
32
|
console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert");
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
//#region src/components/backlink/index.ts
|
|
34
|
+
// src/components/backlink/index.ts
|
|
36
35
|
var s = o;
|
|
37
|
-
//#endregion
|
|
38
36
|
export { o as n, s as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/booleanish.ts
|
|
2
2
|
var e = {
|
|
3
3
|
fromAttribute(e) {
|
|
4
4
|
return e == null ? !1 : e === "" || e === "true" || e === !0 ? !0 : e === "false" || e === !1 ? !1 : !!e;
|
|
@@ -14,5 +14,4 @@ var e = {
|
|
|
14
14
|
return e == null ? null : e ? "true" : "false";
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { t as n, e as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, n as r, t as i, u as a } from "./element-
|
|
2
|
-
import "./icon-
|
|
3
|
-
|
|
1
|
+
import { _ as e, d as t, h as n, n as r, t as i, u as a } from "./element-Bwc-likm.js";
|
|
2
|
+
import "./icon-CZDw42U7.js";
|
|
3
|
+
// src/components/breadcrumbs/breadcrumbs.ts
|
|
4
4
|
var o = class extends i {
|
|
5
5
|
constructor(...e) {
|
|
6
6
|
super(...e), this.breadcrumbs = [];
|
|
@@ -72,5 +72,4 @@ try {
|
|
|
72
72
|
} catch {
|
|
73
73
|
console.warn("Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert");
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { o as t };
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { i as s, t as c } from "./element-with-slot-
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-Bwc-likm.js";
|
|
2
|
+
import { t as o } from "./class-map-C9n5CNC8.js";
|
|
3
|
+
import { i as s, t as c } from "./element-with-slot-47quDZRt.js";
|
|
4
|
+
import "./shared-types-BvRk9kiK.js";
|
|
5
|
+
import { i as l } from "./icon-CZDw42U7.js";
|
|
6
|
+
import { t as u } from "./if-defined-B3pYog2C.js";
|
|
7
|
+
// ../../shared-types/button.ts
|
|
8
|
+
var d = {
|
|
9
|
+
iconName: "user",
|
|
10
|
+
secondIconName: "user",
|
|
11
|
+
size: "medium",
|
|
12
|
+
fullWidth: !1,
|
|
13
|
+
fullWidthOnMobile: !1,
|
|
14
|
+
skin: "primary",
|
|
15
|
+
type: "button",
|
|
16
|
+
variant: "label-only",
|
|
17
|
+
isLoading: !1,
|
|
18
|
+
disabled: !1
|
|
19
|
+
}, f;
|
|
20
|
+
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
|
|
21
|
+
var p = class t extends c {
|
|
10
22
|
constructor(...e) {
|
|
11
|
-
super(...e), this.iconName =
|
|
23
|
+
super(...e), this.iconName = d.iconName, this.secondIconName = d.secondIconName, this.size = d.size, this.fullWidth = d.fullWidth, this.fullWidthOnMobile = d.fullWidthOnMobile, this.skin = d.skin, this.variant = d.variant, this.state = void 0, this.type = d.type, this.form = void 0, this.isLoading = d.isLoading, this.disabled = d.disabled, this.loadingAnimationPath = typeof window < "u" ? window.pktAnimationPath : l, this.relocatedAria = {};
|
|
12
24
|
}
|
|
13
25
|
connectedCallback() {
|
|
14
26
|
super.connectedCallback(), this.addEventListener("click", (e) => {
|
|
@@ -49,67 +61,65 @@ var f = class t extends c {
|
|
|
49
61
|
class=${o(r)}
|
|
50
62
|
type=${this.type}
|
|
51
63
|
?disabled=${!!this.disabled}
|
|
52
|
-
aria-busy=${
|
|
53
|
-
aria-disabled=${
|
|
54
|
-
aria-haspopup=${
|
|
55
|
-
aria-expanded=${
|
|
56
|
-
aria-controls=${
|
|
57
|
-
aria-label=${
|
|
58
|
-
tabindex=${
|
|
59
|
-
form=${
|
|
64
|
+
aria-busy=${u(this.isLoading ? "true" : void 0)}
|
|
65
|
+
aria-disabled=${u(this.disabled || this.isLoading ? "true" : void 0)}
|
|
66
|
+
aria-haspopup=${u(this.relocatedAria["aria-haspopup"])}
|
|
67
|
+
aria-expanded=${u(this.relocatedAria["aria-expanded"])}
|
|
68
|
+
aria-controls=${u(this.relocatedAria["aria-controls"])}
|
|
69
|
+
aria-label=${u(this.relocatedAria["aria-label"])}
|
|
70
|
+
tabindex=${u(this.relocatedAria.tabindex)}
|
|
71
|
+
form=${u(t)}
|
|
60
72
|
>
|
|
61
73
|
${this.isLoading ? e`<pkt-icon
|
|
62
74
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
63
75
|
name="spinner-blue"
|
|
64
|
-
path=${
|
|
76
|
+
path=${u(this.loadingAnimationPath)}
|
|
65
77
|
></pkt-icon>` : n}
|
|
66
78
|
${this.variant === "label-only" ? n : e`<pkt-icon
|
|
67
79
|
class="pkt-btn__icon pkt-icon"
|
|
68
80
|
name=${this.iconName}
|
|
69
|
-
path=${
|
|
81
|
+
path=${u(this.iconPath)}
|
|
70
82
|
></pkt-icon>`}
|
|
71
83
|
<span class="pkt-btn__text">${s(this)}</span>
|
|
72
84
|
${this.variant === "icons-right-and-left" ? e`<pkt-icon
|
|
73
85
|
class="pkt-btn__icon"
|
|
74
86
|
name=${this.secondIconName}
|
|
75
|
-
path=${
|
|
87
|
+
path=${u(this.secondIconPath)}
|
|
76
88
|
></pkt-icon>` : n}
|
|
77
89
|
</button>
|
|
78
90
|
`;
|
|
79
91
|
}
|
|
80
92
|
};
|
|
81
|
-
|
|
93
|
+
f = p, f.relocatedAriaAttributes = [
|
|
82
94
|
"aria-haspopup",
|
|
83
95
|
"aria-expanded",
|
|
84
96
|
"aria-controls",
|
|
85
97
|
"aria-label",
|
|
86
98
|
"tabindex"
|
|
87
|
-
], i([a({ type: String })],
|
|
99
|
+
], i([a({ type: String })], p.prototype, "iconName", void 0), i([a({ type: String })], p.prototype, "secondIconName", void 0), i([a({ type: String })], p.prototype, "iconPath", void 0), i([a({ type: String })], p.prototype, "secondIconPath", void 0), i([a({ type: String })], p.prototype, "size", void 0), i([a({
|
|
88
100
|
type: Boolean,
|
|
89
101
|
attribute: "full-width"
|
|
90
|
-
})],
|
|
102
|
+
})], p.prototype, "fullWidth", void 0), i([a({
|
|
91
103
|
type: Boolean,
|
|
92
104
|
attribute: "full-width-on-mobile"
|
|
93
|
-
})],
|
|
105
|
+
})], p.prototype, "fullWidthOnMobile", void 0), i([a({ type: String })], p.prototype, "color", void 0), i([a({ type: String })], p.prototype, "skin", void 0), i([a({ type: String })], p.prototype, "variant", void 0), i([a({
|
|
94
106
|
type: String,
|
|
95
107
|
reflect: !0
|
|
96
|
-
})],
|
|
108
|
+
})], p.prototype, "state", void 0), i([a({
|
|
97
109
|
type: String,
|
|
98
110
|
reflect: !0
|
|
99
|
-
})],
|
|
111
|
+
})], p.prototype, "type", void 0), i([a({ type: String })], p.prototype, "form", void 0), i([a({
|
|
100
112
|
type: Boolean,
|
|
101
113
|
reflect: !0
|
|
102
|
-
})],
|
|
114
|
+
})], p.prototype, "isLoading", void 0), i([a({
|
|
103
115
|
type: Boolean,
|
|
104
116
|
reflect: !0
|
|
105
|
-
})],
|
|
117
|
+
})], p.prototype, "disabled", void 0), i([a({ type: String })], p.prototype, "loadingAnimationPath", void 0), i([r()], p.prototype, "relocatedAria", void 0);
|
|
106
118
|
try {
|
|
107
|
-
t("pkt-button")(
|
|
119
|
+
t("pkt-button")(p);
|
|
108
120
|
} catch {
|
|
109
121
|
console.warn("Forsøker å definere <pkt-button>, men den er allerede definert");
|
|
110
122
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//#endregion
|
|
115
|
-
export { f as n, p as t };
|
|
123
|
+
// src/components/button/index.ts
|
|
124
|
+
var m = p;
|
|
125
|
+
export { p as n, m as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./icon-5A378_yh.cjs"),i=require("./if-defined-Ci4ZQsgL.cjs");var a={iconName:`user`,secondIconName:`user`,size:`medium`,fullWidth:!1,fullWidthOnMobile:!1,skin:`primary`,type:`button`,variant:`label-only`,isLoading:!1,disabled:!1},o;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`);var s=class o extends n.t{constructor(...e){super(...e),this.iconName=a.iconName,this.secondIconName=a.secondIconName,this.size=a.size,this.fullWidth=a.fullWidth,this.fullWidthOnMobile=a.fullWidthOnMobile,this.skin=a.skin,this.variant=a.variant,this.state=void 0,this.type=a.type,this.form=void 0,this.isLoading=a.isLoading,this.disabled=a.disabled,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:r.i,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of o.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let r=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
|
|
2
|
+
<button
|
|
3
|
+
class=${t.t(a)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
?disabled=${!!this.disabled}
|
|
6
|
+
aria-busy=${i.t(this.isLoading?`true`:void 0)}
|
|
7
|
+
aria-disabled=${i.t(this.disabled||this.isLoading?`true`:void 0)}
|
|
8
|
+
aria-haspopup=${i.t(this.relocatedAria[`aria-haspopup`])}
|
|
9
|
+
aria-expanded=${i.t(this.relocatedAria[`aria-expanded`])}
|
|
10
|
+
aria-controls=${i.t(this.relocatedAria[`aria-controls`])}
|
|
11
|
+
aria-label=${i.t(this.relocatedAria[`aria-label`])}
|
|
12
|
+
tabindex=${i.t(this.relocatedAria.tabindex)}
|
|
13
|
+
form=${i.t(r)}
|
|
14
|
+
>
|
|
15
|
+
${this.isLoading?e._`<pkt-icon
|
|
16
|
+
class="pkt-btn__icon pkt-btn__spinner"
|
|
17
|
+
name="spinner-blue"
|
|
18
|
+
path=${i.t(this.loadingAnimationPath)}
|
|
19
|
+
></pkt-icon>`:e.h}
|
|
20
|
+
${this.variant===`label-only`?e.h:e._`<pkt-icon
|
|
21
|
+
class="pkt-btn__icon pkt-icon"
|
|
22
|
+
name=${this.iconName}
|
|
23
|
+
path=${i.t(this.iconPath)}
|
|
24
|
+
></pkt-icon>`}
|
|
25
|
+
<span class="pkt-btn__text">${n.i(this)}</span>
|
|
26
|
+
${this.variant===`icons-right-and-left`?e._`<pkt-icon
|
|
27
|
+
class="pkt-btn__icon"
|
|
28
|
+
name=${this.secondIconName}
|
|
29
|
+
path=${i.t(this.secondIconPath)}
|
|
30
|
+
></pkt-icon>`:e.h}
|
|
31
|
+
</button>
|
|
32
|
+
`}};o=s,o.relocatedAriaAttributes=[`aria-haspopup`,`aria-expanded`,`aria-controls`,`aria-label`,`tabindex`],e.n([e.u({type:String})],s.prototype,`iconName`,void 0),e.n([e.u({type:String})],s.prototype,`secondIconName`,void 0),e.n([e.u({type:String})],s.prototype,`iconPath`,void 0),e.n([e.u({type:String})],s.prototype,`secondIconPath`,void 0),e.n([e.u({type:String})],s.prototype,`size`,void 0),e.n([e.u({type:Boolean,attribute:`full-width`})],s.prototype,`fullWidth`,void 0),e.n([e.u({type:Boolean,attribute:`full-width-on-mobile`})],s.prototype,`fullWidthOnMobile`,void 0),e.n([e.u({type:String})],s.prototype,`color`,void 0),e.n([e.u({type:String})],s.prototype,`skin`,void 0),e.n([e.u({type:String})],s.prototype,`variant`,void 0),e.n([e.u({type:String,reflect:!0})],s.prototype,`state`,void 0),e.n([e.u({type:String,reflect:!0})],s.prototype,`type`,void 0),e.n([e.u({type:String})],s.prototype,`form`,void 0),e.n([e.u({type:Boolean,reflect:!0})],s.prototype,`isLoading`,void 0),e.n([e.u({type:Boolean,reflect:!0})],s.prototype,`disabled`,void 0),e.n([e.u({type:String})],s.prototype,`loadingAnimationPath`,void 0),e.n([e.l()],s.prototype,`relocatedAria`,void 0);try{e.d(`pkt-button`)(s)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|