@oslokommune/punkt-elements 17.1.3 → 18.0.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 +18 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
- package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
- package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
- package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
- package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
- package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
- package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
- package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
- package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
- package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +3 -2
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
- package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
- package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-B8OGznK0.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
- package/dist/fileupload-D05VSbEP.cjs +402 -0
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
- package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
- package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
- package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
- package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
- package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
- package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
- package/dist/helptext-DYFdcylX.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
- package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
- package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
- package/dist/if-defined-CVYApOgK.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
- package/dist/input-element-DumGj_oJ.cjs +1 -0
- package/dist/input-wrapper-Cci_wTvD.js +308 -0
- package/dist/input-wrapper-DDfapoRX.cjs +58 -0
- package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
- package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
- package/dist/linkcard-DNYsVlV6.cjs +13 -0
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -20
- 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.cjs +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.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-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +35 -34
- 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-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.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-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
- package/dist/searchinput-CPgMEAZZ.cjs +60 -0
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
- package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
- package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +118 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +29 -0
- package/dist/shared-types/fileupload.d.ts +0 -27
- package/dist/shared-types/index.d.ts +1 -2
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
- package/dist/tag-BxYulmZn.cjs +27 -0
- package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
- package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
- package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
- package/dist/timepicker-AfgJipo6.cjs +196 -0
- package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
- package/package.json +3 -3
- package/src/components/backlink/backlink.ts +1 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +25 -16
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +9 -0
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs"),t=require("./element-with-slot-DTxILHVv.cjs");var n=class extends t.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}updated(e){super.updated(e),e.has(`level`)&&((this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.hasAttribute(`size`)||(this.size=this.defaultSizeForLevel),this.hasAttribute(`weight`)||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute(`size`)&&this.size===void 0&&(this.size=this.defaultSizeForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=t.n(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return e._`<h1 class=${n}>${r}</h1>`;case 2:return e._`<h2 class=${n}>${r}</h2>`;case 3:return e._`<h3 class=${n}>${r}</h3>`;case 4:return e._`<h4 class=${n}>${r}</h4>`;case 5:return e._`<h5 class=${n}>${r}</h5>`;case 6:return e._`<h6 class=${n}>${r}</h6>`;default:return e._`<h2 class=${n}>${r}</h2>`}}};e.n([e.u({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.u({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.u({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.d(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as i, t as a } from "./element-with-slot-
|
|
1
|
+
import { _ as e, d as t, n, u as r } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { n as i, t as a } from "./element-with-slot-YUAUFRqw.js";
|
|
3
3
|
//#region src/components/heading/heading.ts
|
|
4
4
|
var o = class extends a {
|
|
5
5
|
constructor(...e) {
|
|
@@ -40,36 +40,36 @@ var o = class extends a {
|
|
|
40
40
|
].filter(Boolean).join(" ");
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
let
|
|
43
|
+
let t = this.headingClasses, n = i(this);
|
|
44
44
|
switch (this.level >= 1 && this.level <= 6 ? this.level : 2) {
|
|
45
|
-
case 1: return
|
|
46
|
-
case 2: return
|
|
47
|
-
case 3: return
|
|
48
|
-
case 4: return
|
|
49
|
-
case 5: return
|
|
50
|
-
case 6: return
|
|
51
|
-
default: return
|
|
45
|
+
case 1: return e`<h1 class=${t}>${n}</h1>`;
|
|
46
|
+
case 2: return e`<h2 class=${t}>${n}</h2>`;
|
|
47
|
+
case 3: return e`<h3 class=${t}>${n}</h3>`;
|
|
48
|
+
case 4: return e`<h4 class=${t}>${n}</h4>`;
|
|
49
|
+
case 5: return e`<h5 class=${t}>${n}</h5>`;
|
|
50
|
+
case 6: return e`<h6 class=${t}>${n}</h6>`;
|
|
51
|
+
default: return e`<h2 class=${t}>${n}</h2>`;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
n([r({
|
|
56
56
|
type: String,
|
|
57
57
|
reflect: !0
|
|
58
|
-
})], o.prototype, "size", void 0),
|
|
58
|
+
})], o.prototype, "size", void 0), n([r({
|
|
59
59
|
type: Number,
|
|
60
60
|
reflect: !0
|
|
61
|
-
})], o.prototype, "level", void 0),
|
|
61
|
+
})], o.prototype, "level", void 0), n([r({
|
|
62
62
|
type: String,
|
|
63
63
|
reflect: !0
|
|
64
|
-
})], o.prototype, "weight", void 0),
|
|
64
|
+
})], o.prototype, "weight", void 0), n([r({
|
|
65
65
|
type: Boolean,
|
|
66
66
|
reflect: !0
|
|
67
|
-
})], o.prototype, "visuallyHidden", void 0),
|
|
67
|
+
})], o.prototype, "visuallyHidden", void 0), n([r({
|
|
68
68
|
type: String,
|
|
69
69
|
reflect: !0
|
|
70
70
|
})], o.prototype, "align", void 0);
|
|
71
71
|
try {
|
|
72
|
-
|
|
72
|
+
t("pkt-heading")(o);
|
|
73
73
|
} catch {
|
|
74
74
|
console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
|
|
75
75
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs"),t=require("./class-map-CzCE5pqG.cjs"),n=require("./element-with-slot-DTxILHVv.cjs"),r=require("./icon-BmMC09mi.cjs"),i=require("./utils-63cRpWut.cjs");var a=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e._`${e._`<div class="${a}">
|
|
2
|
+
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
3
|
+
<div class="pkt-contents" name="helptext">${n.n(this)}</div>
|
|
4
|
+
${this.helptext&&r.r(this.helptext)}
|
|
5
|
+
</div>
|
|
6
|
+
${this.helptextDropdown?e._`<div class="pkt-inputwrapper__helptext-expandable">
|
|
7
|
+
<button
|
|
8
|
+
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
9
|
+
type="button"
|
|
10
|
+
aria-expanded=${this.isHelpTextOpen?`true`:`false`}
|
|
11
|
+
aria-controls="${this.forId}-helptext-expandable"
|
|
12
|
+
@click=${i}
|
|
13
|
+
>
|
|
14
|
+
<pkt-icon
|
|
15
|
+
class="pkt-btn__icon"
|
|
16
|
+
name="${this.isHelpTextOpen?`chevron-thin-up`:`chevron-thin-down`}"
|
|
17
|
+
></pkt-icon>
|
|
18
|
+
<span class="pkt-btn__text">${r.r(this.helptextDropdownButton??this.pktStrings.get(`forms`).readMore)}</span>
|
|
19
|
+
</button>
|
|
20
|
+
<div
|
|
21
|
+
id="${this.forId}-helptext-expandable"
|
|
22
|
+
class="${t.t({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
23
|
+
>
|
|
24
|
+
${r.r(this.helptextDropdown)}
|
|
25
|
+
</div>
|
|
26
|
+
</div>`:e.h}
|
|
27
|
+
</div>`}`}};e.n([e.u({type:String,reflect:!0})],a.prototype,`forId`,void 0),e.n([e.u({type:String})],a.prototype,`helptext`,void 0),e.n([e.u({type:String})],a.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String})],a.prototype,`helptextDropdownButton`,void 0),e.n([e.l()],a.prototype,`isHelpTextOpen`,void 0);try{e.d(`pkt-helptext`)(a)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { n as s, t as c } from "./element-with-slot-
|
|
4
|
-
import { r as l } from "./icon-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { t as o } from "./class-map-F1DJHyb7.js";
|
|
3
|
+
import { n as s, t as c } from "./element-with-slot-YUAUFRqw.js";
|
|
4
|
+
import { r as l } from "./icon-HYU1f54x.js";
|
|
5
5
|
import { n as u } from "./utils-BwF4QSrq.js";
|
|
6
|
-
import { t as d } from "./input-wrapper-D-fPaTbY.js";
|
|
7
6
|
//#region src/components/helptext/helptext.ts
|
|
8
|
-
var
|
|
7
|
+
var d = class extends c {
|
|
9
8
|
constructor(...e) {
|
|
10
|
-
super(...e), this.forId = u(), this.helptext = "", this.helptextDropdown = "", this.
|
|
9
|
+
super(...e), this.forId = u(), this.helptext = "", this.helptextDropdown = "", this.isHelpTextOpen = !1;
|
|
11
10
|
}
|
|
12
11
|
render() {
|
|
13
|
-
let
|
|
12
|
+
let t = () => {
|
|
14
13
|
let e = !this.isHelpTextOpen;
|
|
15
14
|
this.isHelpTextOpen = e, this.dispatchEvent(new CustomEvent("toggleHelpText", {
|
|
16
15
|
bubbles: !0,
|
|
17
16
|
detail: { isOpen: e }
|
|
18
17
|
}));
|
|
19
|
-
},
|
|
18
|
+
}, r = o({
|
|
20
19
|
"pkt-inputwrapper__helptext-container": !0,
|
|
21
20
|
"pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.hasSlotContent()
|
|
22
21
|
});
|
|
23
|
-
return
|
|
22
|
+
return e`${e`<div class="${r}">
|
|
24
23
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
25
24
|
<div class="pkt-contents" name="helptext">${s(this)}</div>
|
|
26
25
|
${this.helptext && l(this.helptext)}
|
|
27
26
|
</div>
|
|
28
|
-
${this.helptextDropdown ?
|
|
27
|
+
${this.helptextDropdown ? e`<div class="pkt-inputwrapper__helptext-expandable">
|
|
29
28
|
<button
|
|
30
29
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
31
30
|
type="button"
|
|
32
31
|
aria-expanded=${this.isHelpTextOpen ? "true" : "false"}
|
|
33
32
|
aria-controls="${this.forId}-helptext-expandable"
|
|
34
|
-
@click=${
|
|
33
|
+
@click=${t}
|
|
35
34
|
>
|
|
36
35
|
<pkt-icon
|
|
37
36
|
class="pkt-btn__icon"
|
|
38
37
|
name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
|
|
39
38
|
></pkt-icon>
|
|
40
|
-
<span class="pkt-btn__text">${l(this.helptextDropdownButton)}</span>
|
|
39
|
+
<span class="pkt-btn__text">${l(this.helptextDropdownButton ?? this.pktStrings.get("forms").readMore)}</span>
|
|
41
40
|
</button>
|
|
42
41
|
<div
|
|
43
42
|
id="${this.forId}-helptext-expandable"
|
|
@@ -49,21 +48,21 @@ var f = class extends c {
|
|
|
49
48
|
>
|
|
50
49
|
${l(this.helptextDropdown)}
|
|
51
50
|
</div>
|
|
52
|
-
</div>` :
|
|
51
|
+
</div>` : n}
|
|
53
52
|
</div>`}`;
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
|
-
|
|
55
|
+
i([a({
|
|
57
56
|
type: String,
|
|
58
57
|
reflect: !0
|
|
59
|
-
})],
|
|
58
|
+
})], d.prototype, "forId", void 0), i([a({ type: String })], d.prototype, "helptext", void 0), i([a({ type: String })], d.prototype, "helptextDropdown", void 0), i([a({ type: String })], d.prototype, "helptextDropdownButton", void 0), i([r()], d.prototype, "isHelpTextOpen", void 0);
|
|
60
59
|
try {
|
|
61
|
-
|
|
60
|
+
t("pkt-helptext")(d);
|
|
62
61
|
} catch {
|
|
63
62
|
console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert");
|
|
64
63
|
}
|
|
65
64
|
//#endregion
|
|
66
65
|
//#region src/components/helptext/index.ts
|
|
67
|
-
var
|
|
66
|
+
var f = d;
|
|
68
67
|
//#endregion
|
|
69
|
-
export {
|
|
68
|
+
export { d as n, f as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs");var t=class extends e.p{constructor(t){if(super(t),this.it=e.h,t.type!==e.m.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.h||t==null)return this._t=void 0,this.it=t;if(t===e.g)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};t.directiveName=`unsafeHTML`,t.resultType=1;var n=e.f(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.f(r),a=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||a);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:a,this.name=``,this.ariaHidden=null,this.ariaLabel=null,this.icon=i(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:a;try{this.icon=i(await p(this.name||``,this.path))}catch{this.icon=i(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e._`${this.name&&this.icon}`}};e.n([e.u({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.u({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.u({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.u({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.u({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.u({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.d(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as e, d as t, f as n, g as r, h as i, m as a, n as o, p as s, t as c, u as l } from "./element-BKSPVgs2.js";
|
|
2
2
|
//#region ../../node_modules/lit-html/directives/unsafe-html.js
|
|
3
|
-
var u = class extends
|
|
3
|
+
var u = class extends s {
|
|
4
4
|
constructor(e) {
|
|
5
|
-
if (super(e), this.it =
|
|
5
|
+
if (super(e), this.it = i, e.type !== a.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
6
6
|
}
|
|
7
7
|
render(e) {
|
|
8
|
-
if (e ===
|
|
9
|
-
if (e ===
|
|
8
|
+
if (e === i || e == null) return this._t = void 0, this.it = e;
|
|
9
|
+
if (e === r) return e;
|
|
10
10
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
11
11
|
if (e === this.it) return this._t;
|
|
12
12
|
this.it = e;
|
|
13
|
-
let
|
|
14
|
-
return
|
|
13
|
+
let t = [e];
|
|
14
|
+
return t.raw = t, this._t = {
|
|
15
15
|
_$litType$: this.constructor.resultType,
|
|
16
|
-
strings:
|
|
16
|
+
strings: t,
|
|
17
17
|
values: []
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
u.directiveName = "unsafeHTML", u.resultType = 1;
|
|
22
|
-
var d =
|
|
22
|
+
var d = n(u), f = class extends u {};
|
|
23
23
|
f.directiveName = "unsafeSVG", f.resultType = 2;
|
|
24
|
-
var p =
|
|
24
|
+
var p = n(f), m = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
|
|
25
25
|
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || m);
|
|
26
26
|
var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", g = {}, _ = 2, v = 1500, y = typeof Storage < "u" && typeof sessionStorage < "u", b = (e) => window.pktFetch(e).then((t) => {
|
|
27
27
|
if (!t.ok) throw Error("Missing icon: " + e);
|
|
@@ -73,29 +73,29 @@ var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
|
|
|
73
73
|
} else this._updatedProps.includes(e) || this._updatedProps.push(e);
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
|
-
return
|
|
76
|
+
return e`${this.name && this.icon}`;
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
o([l({
|
|
80
80
|
type: String,
|
|
81
81
|
reflect: !1
|
|
82
|
-
})], C.prototype, "path", void 0),
|
|
82
|
+
})], C.prototype, "path", void 0), o([l({
|
|
83
83
|
type: String,
|
|
84
84
|
reflect: !0
|
|
85
|
-
})], C.prototype, "name", void 0),
|
|
85
|
+
})], C.prototype, "name", void 0), o([l({
|
|
86
86
|
type: String,
|
|
87
87
|
attribute: "aria-hidden",
|
|
88
88
|
reflect: !0
|
|
89
|
-
})], C.prototype, "ariaHidden", void 0),
|
|
89
|
+
})], C.prototype, "ariaHidden", void 0), o([l({
|
|
90
90
|
type: String,
|
|
91
91
|
attribute: "aria-label",
|
|
92
92
|
reflect: !0
|
|
93
|
-
})], C.prototype, "ariaLabel", void 0),
|
|
93
|
+
})], C.prototype, "ariaLabel", void 0), o([l({ type: SVGElement })], C.prototype, "icon", void 0), o([l({
|
|
94
94
|
type: Array,
|
|
95
95
|
noAccessor: !0
|
|
96
96
|
})], C.prototype, "_updatedProps", void 0);
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
t("pkt-icon")(C);
|
|
99
99
|
} catch {
|
|
100
100
|
console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
|
|
101
101
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs");var t=t=>t??e.h;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|