@oslokommune/punkt-elements 16.18.0 → 16.19.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 +17 -0
- package/dist/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
- package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
- package/dist/{alert-D_eXGOez.js → alert-BkzC5mVu.js} +22 -22
- package/dist/{alert-NyLr62jZ.cjs → alert-D_45dWPn.cjs} +6 -6
- package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
- package/dist/async-directive-DO1QtVmf.cjs +1 -0
- package/dist/{backlink-CTu44BHn.js → backlink-BXAdgAte.js} +6 -6
- package/dist/{backlink-BsQ0Rmxj.cjs → backlink-C42-3OG3.cjs} +2 -2
- package/dist/{breadcrumbs-BNZ1L-0q.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
- package/dist/{breadcrumbs-DPnoURvl.js → breadcrumbs-Dkb9TxMp.js} +15 -15
- package/dist/{button-ZYlrRRfu.js → button-CR-KWhTT.js} +21 -21
- package/dist/{button-DsGvcLIn.cjs → button-Dwv11n6R.cjs} +7 -7
- package/dist/{calendar-CDDVoUby.cjs → calendar-Buvxe4l_.cjs} +11 -11
- package/dist/{calendar-VOqO5um6.js → calendar-DAq6iJdx.js} +50 -50
- package/dist/{card-B4oDGIRP.js → card-5PydU247.js} +43 -43
- package/dist/{card-DZuZy0ay.cjs → card-C__IlsUa.cjs} +26 -26
- package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
- package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
- package/dist/class-map-B8Ja0q7n.cjs +1 -0
- package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
- package/dist/{combobox-BDYoPZmg.js → combobox-D-DY7YcW.js} +42 -42
- package/dist/{combobox-Ct9gCFa1.cjs → combobox-x4tBGP3F.cjs} +17 -17
- package/dist/components/heading/heading.d.ts +5 -8
- package/dist/{consent-BME_rQ2w.cjs → consent-BB3g_ByO.cjs} +3 -3
- package/dist/{consent-1IUuWZAh.js → consent-Y14WZ0JS.js} +8 -8
- package/dist/{datepicker-ByqXCpCd.cjs → datepicker-BFI-3stE.cjs} +20 -20
- package/dist/{datepicker-BGpoabCM.js → datepicker-CRk7aiwH.js} +57 -57
- package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
- package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
- package/dist/element-CXAtr6Gu.cjs +2 -0
- package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
- package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
- package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
- package/dist/{fileupload-B6W7qOQT.js → fileupload-C8muj8qd.js} +149 -149
- package/dist/{fileupload-a2OL3dzG.cjs → fileupload-YtsrgQTY.cjs} +40 -40
- package/dist/{header-BZFSan0_.cjs → header-CjBip0zj.cjs} +57 -57
- package/dist/{header-BgVpJMHQ.js → header-DONTGbD9.js} +130 -130
- package/dist/{header-menu-BXzVVOHq.js → header-menu-BU-ylGrJ.js} +45 -45
- package/dist/{header-menu-BLngov1D.cjs → header-menu-CnW7nzmF.cjs} +24 -24
- package/dist/heading-3o4Dk0Wn.js +80 -0
- package/dist/heading-C40-NX0r.cjs +1 -0
- package/dist/{helptext-BeU-enix.js → helptext-C2aQBBo_.js} +12 -12
- package/dist/{helptext-DWMFqMnV.cjs → helptext-DNLg43eI.cjs} +4 -4
- package/dist/icon-Dw6I0HDV.cjs +1 -0
- package/dist/{icon-CZQkrK6B.js → icon-LaKyBKON.js} +18 -19
- package/dist/if-defined-LTjAScFG.cjs +1 -0
- package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
- package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
- package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
- package/dist/{input-wrapper-oYcbCFow.js → input-wrapper-B6WowlWG.js} +33 -33
- package/dist/{input-wrapper-Y98KV-sy.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
- package/dist/{link-BMMIjg50.cjs → link-B5ur0Rym.cjs} +4 -4
- package/dist/{link-CT0LB3S7.js → link-ClUNY__5.js} +13 -13
- package/dist/linkcard-BIcCW-qw.cjs +13 -0
- package/dist/{linkcard-Bz5zb69P.js → linkcard-DNJm5FvA.js} +15 -15
- package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
- package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
- package/dist/{loader-8T6M0FCQ.cjs → loader-Uap9qDsV.cjs} +5 -5
- package/dist/{loader-Cbrc4FFx.js → loader-gKdQpOOQ.js} +12 -12
- package/dist/{messagebox-C6LHT78_.cjs → messagebox-BqBxXK8c.cjs} +5 -5
- package/dist/{messagebox-TKKUVTo4.js → messagebox-XRFecqyS.js} +15 -15
- package/dist/{modal-BVHH8koz.js → modal-CWgeT-RP.js} +19 -19
- package/dist/{modal-CRzbtqL3.cjs → modal-CrYHKOmr.cjs} +8 -8
- 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-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 +32 -32
- 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-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
- package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +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-C-5oESiB.js → progressbar-B0P_vmGD.js} +23 -24
- package/dist/progressbar-DADdvDl5.cjs +17 -0
- package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
- package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
- package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
- package/dist/ref-CBdWMlde.cjs +1 -0
- package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
- package/dist/repeat-CRRgmzVn.cjs +1 -0
- package/dist/{searchinput-DUgZb_zm.cjs → searchinput-BrxfRzez.cjs} +13 -13
- package/dist/{searchinput-C9FP89qD.js → searchinput-fPvXHu2O.js} +31 -31
- package/dist/{select-DkKIW7zD.js → select-BIgFPp42.js} +13 -13
- package/dist/{select-DAs8kzN4.cjs → select-DzZHv6Bz.cjs} +3 -3
- package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
- package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
- package/dist/{tag-vgKH9B4k.cjs → tag-CBFz0R9N.cjs} +5 -5
- package/dist/{tag-DSZ-czu-.js → tag-CzlnHhho.js} +19 -19
- package/dist/textarea-M_S9WK7s.cjs +46 -0
- package/dist/{textarea-BfjI6d7Q.js → textarea-qHtkhelz.js} +24 -25
- package/dist/{textinput-DhoupEyI.js → textinput-CZrBM-Fj.js} +26 -26
- package/dist/{textinput-BM66vo5e.cjs → textinput-C_6kvf87.cjs} +12 -12
- package/dist/{timepicker-CtRGbypF.js → timepicker-O0iCeJyW.js} +51 -51
- package/dist/{timepicker-C4oRmmRd.cjs → timepicker-WiYLAncb.cjs} +20 -20
- package/package.json +2 -2
- package/src/components/card/card.ts +1 -1
- package/src/components/heading/heading.test.ts +79 -70
- package/src/components/heading/heading.ts +40 -78
- package/dist/async-directive-B9P1Qa0k.cjs +0 -1
- package/dist/class-map-CJ-msbHs.cjs +0 -1
- package/dist/directive-3THFsVew.js +0 -28
- package/dist/directive-CJ2giQBZ.cjs +0 -1
- package/dist/element-DjtxO-1r.cjs +0 -2
- package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
- package/dist/heading-BxvE80bb.js +0 -73
- package/dist/heading-DRJTS27k.cjs +0 -1
- package/dist/icon-PbaC9uUg.cjs +0 -1
- package/dist/if-defined-XKOD_t_V.cjs +0 -1
- package/dist/linkcard-CupEMkvj.cjs +0 -13
- package/dist/progressbar-C0g830Tk.cjs +0 -17
- package/dist/ref-BaJ0mBT_.cjs +0 -1
- package/dist/repeat-DaDFvx86.cjs +0 -1
- package/dist/textarea-C7YiheLo.cjs +0 -46
- /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
- /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
- /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
- /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
- /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
- /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
- /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
- /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
- /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
- /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
- /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
- /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
- /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
- /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
4
|
-
import "./accordion-
|
|
5
|
-
import { t as c } from "./booleanish-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as s } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import "./icon-LaKyBKON.js";
|
|
4
|
+
import "./accordion-BjYsEbSM.js";
|
|
5
|
+
import { t as c } from "./booleanish-BmcOU-43.js";
|
|
6
6
|
//#region ../../shared-types/header-menu.ts
|
|
7
7
|
var l = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", u = {
|
|
8
8
|
automat: "parking-meter",
|
|
@@ -130,33 +130,33 @@ var v = class extends o {
|
|
|
130
130
|
return g(this.effectiveData, this.locale);
|
|
131
131
|
}
|
|
132
132
|
render() {
|
|
133
|
-
if (this.loadState === "loading") return
|
|
133
|
+
if (this.loadState === "loading") return i`
|
|
134
134
|
<nav aria-busy="true">
|
|
135
135
|
<p class="pkt-header-menu__loading">Laster meny…</p>
|
|
136
136
|
</nav>
|
|
137
137
|
`;
|
|
138
|
-
if (this.loadState === "error" || !this.localeData) return
|
|
138
|
+
if (this.loadState === "error" || !this.localeData) return i`
|
|
139
139
|
<nav aria-hidden=${!this.open}>
|
|
140
140
|
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
141
141
|
</nav>
|
|
142
142
|
`;
|
|
143
|
-
let { megamenu: e, i18n:
|
|
144
|
-
return this.isMobile ?
|
|
145
|
-
<nav aria-label=${
|
|
143
|
+
let { megamenu: e, i18n: t } = this.localeData, n = t?.navAriaLabel || "Hovedmeny";
|
|
144
|
+
return this.isMobile ? i`
|
|
145
|
+
<nav aria-label=${n}>
|
|
146
146
|
${this.renderMobileAccordion(e.services, e.sections)}
|
|
147
147
|
${this.renderButtons(e.buttons, !0)}
|
|
148
148
|
${this.renderFooter(e.links, e.some)}
|
|
149
149
|
</nav>
|
|
150
|
-
` :
|
|
151
|
-
<nav aria-label=${
|
|
150
|
+
` : i`
|
|
151
|
+
<nav aria-label=${n}>
|
|
152
152
|
${this.renderServices(e.services)} ${this.renderButtons(e.buttons, !1)}
|
|
153
153
|
${this.renderSections(e.sections)}
|
|
154
154
|
${this.renderFooter(e.links, e.some)}
|
|
155
155
|
</nav>
|
|
156
156
|
`;
|
|
157
157
|
}
|
|
158
|
-
renderMobileAccordion(e,
|
|
159
|
-
return
|
|
158
|
+
renderMobileAccordion(e, t) {
|
|
159
|
+
return i`
|
|
160
160
|
<div class="pkt-header-menu__sections">
|
|
161
161
|
<pkt-accordion
|
|
162
162
|
class="pkt-header-menu__sections-inner"
|
|
@@ -171,11 +171,11 @@ var v = class extends o {
|
|
|
171
171
|
>
|
|
172
172
|
${this.renderServicesList(e)}
|
|
173
173
|
</pkt-accordion-item>
|
|
174
|
-
${
|
|
174
|
+
${t.map((e, t) => i`
|
|
175
175
|
<pkt-accordion-item
|
|
176
176
|
class="pkt-header-menu__section"
|
|
177
177
|
skin="plus-minus"
|
|
178
|
-
id=${`pkt-header-menu-section-${
|
|
178
|
+
id=${`pkt-header-menu-section-${t}`}
|
|
179
179
|
title=${e.title}
|
|
180
180
|
>
|
|
181
181
|
${this.renderSectionList(e.links)}
|
|
@@ -186,9 +186,9 @@ var v = class extends o {
|
|
|
186
186
|
`;
|
|
187
187
|
}
|
|
188
188
|
renderServicesList(e) {
|
|
189
|
-
return
|
|
189
|
+
return i`
|
|
190
190
|
<ul class="pkt-header-menu__services-list">
|
|
191
|
-
${e.links.map((e) =>
|
|
191
|
+
${e.links.map((e) => i`
|
|
192
192
|
<li class="pkt-header-menu__service">
|
|
193
193
|
<a class="pkt-header-menu__service-link" href=${e.url}>
|
|
194
194
|
<pkt-icon
|
|
@@ -204,20 +204,20 @@ var v = class extends o {
|
|
|
204
204
|
`;
|
|
205
205
|
}
|
|
206
206
|
renderServices(e) {
|
|
207
|
-
return
|
|
207
|
+
return i`
|
|
208
208
|
<div class="pkt-header-menu__services">
|
|
209
209
|
<h2 class="pkt-header-menu__services-title">${e.title}</h2>
|
|
210
210
|
${this.renderServicesList(e)}
|
|
211
211
|
</div>
|
|
212
212
|
`;
|
|
213
213
|
}
|
|
214
|
-
renderButtons(e,
|
|
215
|
-
return !e || e.length === 0 ?
|
|
214
|
+
renderButtons(e, n) {
|
|
215
|
+
return !e || e.length === 0 ? t : i`
|
|
216
216
|
<div class=${s({
|
|
217
217
|
"pkt-header-menu__buttons": !0,
|
|
218
|
-
"pkt-header-menu__buttons--mobile":
|
|
218
|
+
"pkt-header-menu__buttons--mobile": n
|
|
219
219
|
})}>
|
|
220
|
-
${e.map((e) =>
|
|
220
|
+
${e.map((e) => i`
|
|
221
221
|
<a
|
|
222
222
|
class="pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small"
|
|
223
223
|
href=${e.url}
|
|
@@ -234,10 +234,10 @@ var v = class extends o {
|
|
|
234
234
|
`;
|
|
235
235
|
}
|
|
236
236
|
renderSections(e) {
|
|
237
|
-
return !e || e.length === 0 ?
|
|
237
|
+
return !e || e.length === 0 ? t : i`
|
|
238
238
|
<div class="pkt-header-menu__sections">
|
|
239
239
|
<div class="pkt-header-menu__sections-inner">
|
|
240
|
-
${e.map((e) =>
|
|
240
|
+
${e.map((e) => i`
|
|
241
241
|
<div class="pkt-header-menu__section">
|
|
242
242
|
<h2 class="pkt-header-menu__section-title">${e.title}</h2>
|
|
243
243
|
${this.renderSectionList(e.links)}
|
|
@@ -248,9 +248,9 @@ var v = class extends o {
|
|
|
248
248
|
`;
|
|
249
249
|
}
|
|
250
250
|
renderSectionList(e) {
|
|
251
|
-
return
|
|
251
|
+
return i`
|
|
252
252
|
<ul class="pkt-header-menu__section-list">
|
|
253
|
-
${e.map((e) =>
|
|
253
|
+
${e.map((e) => i`
|
|
254
254
|
<li>
|
|
255
255
|
<a class="pkt-header-menu__section-link" href=${e.url}>${e.text}</a>
|
|
256
256
|
</li>
|
|
@@ -258,57 +258,57 @@ var v = class extends o {
|
|
|
258
258
|
</ul>
|
|
259
259
|
`;
|
|
260
260
|
}
|
|
261
|
-
renderFooter(e,
|
|
262
|
-
return (!e || e.length === 0) && (!
|
|
261
|
+
renderFooter(e, n) {
|
|
262
|
+
return (!e || e.length === 0) && (!n || n.length === 0) ? t : i`
|
|
263
263
|
<div class="pkt-header-menu__footer">
|
|
264
|
-
${e && e.length > 0 ?
|
|
264
|
+
${e && e.length > 0 ? i`
|
|
265
265
|
<ul class="pkt-header-menu__footer-list">
|
|
266
|
-
${e.map((e) =>
|
|
266
|
+
${e.map((e) => i`
|
|
267
267
|
<li>
|
|
268
268
|
<a class="pkt-header-menu__footer-link" href=${e.url}>${e.text}</a>
|
|
269
269
|
</li>
|
|
270
270
|
`)}
|
|
271
271
|
</ul>
|
|
272
|
-
` :
|
|
273
|
-
${
|
|
272
|
+
` : t}
|
|
273
|
+
${n && n.length > 0 ? i`
|
|
274
274
|
<ul class="pkt-header-menu__footer-list pkt-header-menu__footer-list--social">
|
|
275
|
-
${
|
|
275
|
+
${n.map((e) => this.renderSocialLink(e))}
|
|
276
276
|
</ul>
|
|
277
|
-
` :
|
|
277
|
+
` : t}
|
|
278
278
|
</div>
|
|
279
279
|
`;
|
|
280
280
|
}
|
|
281
281
|
renderSocialLink(e) {
|
|
282
|
-
let
|
|
283
|
-
return
|
|
282
|
+
let t = m(e.url, e.text);
|
|
283
|
+
return i`
|
|
284
284
|
<li>
|
|
285
285
|
<a class="pkt-header-menu__social-link" href=${e.url} aria-label=${e.text}>
|
|
286
|
-
${
|
|
286
|
+
${t ? i`<pkt-icon name=${t} aria-hidden="true"></pkt-icon>` : i`<span>${e.text}</span>`}
|
|
287
287
|
</a>
|
|
288
288
|
</li>
|
|
289
289
|
`;
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
-
|
|
292
|
+
n([r({
|
|
293
293
|
type: String,
|
|
294
294
|
attribute: "data-url"
|
|
295
|
-
})], v.prototype, "dataUrl", void 0),
|
|
295
|
+
})], v.prototype, "dataUrl", void 0), n([r({
|
|
296
296
|
type: Object,
|
|
297
297
|
attribute: !1
|
|
298
|
-
})], v.prototype, "data", void 0),
|
|
298
|
+
})], v.prototype, "data", void 0), n([r({ type: String })], v.prototype, "locale", void 0), n([r({
|
|
299
299
|
type: Boolean,
|
|
300
300
|
reflect: !0,
|
|
301
301
|
converter: c
|
|
302
|
-
})], v.prototype, "open", void 0),
|
|
302
|
+
})], v.prototype, "open", void 0), n([r({
|
|
303
303
|
type: String,
|
|
304
304
|
attribute: "aria-labelledby",
|
|
305
305
|
reflect: !0
|
|
306
|
-
})], v.prototype, "ariaLabelledBy", void 0),
|
|
306
|
+
})], v.prototype, "ariaLabelledBy", void 0), n([r({
|
|
307
307
|
type: Number,
|
|
308
308
|
attribute: "mobile-breakpoint"
|
|
309
|
-
})], v.prototype, "mobileBreakpoint", void 0),
|
|
309
|
+
})], v.prototype, "mobileBreakpoint", void 0), n([e()], v.prototype, "loadState", void 0), n([e()], v.prototype, "fetchedData", void 0), n([e()], v.prototype, "isMobile", void 0);
|
|
310
310
|
try {
|
|
311
|
-
|
|
311
|
+
a("pkt-header-menu")(v);
|
|
312
312
|
} catch {
|
|
313
313
|
console.warn("Forsøker å definere <pkt-header-menu>, men den er allerede definert");
|
|
314
314
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`),require(`./accordion-DaeWPWod.cjs`);const n=require(`./booleanish-jJLlnr6-.cjs`);var r=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,i={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function a(e){return e&&(i[e]??e)}var o={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function s(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function c(e,t){if(e)try{let t=o[s(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=a(e);if(t)return t}}}var l=`nb-NO`;function u(e,t=l){if(e)return e[t]??e[l]}async function d(e=r,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let i=await n.json();if(!i||typeof i!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return i}var f=class extends e.t{constructor(...e){super(...e),this.dataUrl=r,this.locale=`nb-NO`,this.open=!1,this.ariaLabelledBy=``,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.handleMediaChange=e=>{this.isMobile=e.matches}}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.setupMediaQuery(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.teardownMediaQuery()}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.setupMediaQuery(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}setupMediaQuery(){this.teardownMediaQuery(),!(typeof window>`u`||typeof window.matchMedia!=`function`)&&(this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mediaQuery.matches,this.mediaQuery.addEventListener(`change`,this.handleMediaChange))}teardownMediaQuery(){this.mediaQuery?.removeEventListener(`change`,this.handleMediaChange),this.mediaQuery=void 0}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await d(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return u(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e.p`
|
|
2
2
|
<nav aria-busy="true">
|
|
3
3
|
<p class="pkt-header-menu__loading">Laster meny…</p>
|
|
4
4
|
</nav>
|
|
5
|
-
`;if(this.loadState===`error`||!this.localeData)return e.
|
|
5
|
+
`;if(this.loadState===`error`||!this.localeData)return e.p`
|
|
6
6
|
<nav aria-hidden=${!this.open}>
|
|
7
7
|
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
8
8
|
</nav>
|
|
9
|
-
`;let{megamenu:t,i18n:n}=this.localeData,r=n?.navAriaLabel||`Hovedmeny`;return this.isMobile?e.
|
|
9
|
+
`;let{megamenu:t,i18n:n}=this.localeData,r=n?.navAriaLabel||`Hovedmeny`;return this.isMobile?e.p`
|
|
10
10
|
<nav aria-label=${r}>
|
|
11
11
|
${this.renderMobileAccordion(t.services,t.sections)}
|
|
12
12
|
${this.renderButtons(t.buttons,!0)}
|
|
13
13
|
${this.renderFooter(t.links,t.some)}
|
|
14
14
|
</nav>
|
|
15
|
-
`:e.
|
|
15
|
+
`:e.p`
|
|
16
16
|
<nav aria-label=${r}>
|
|
17
17
|
${this.renderServices(t.services)} ${this.renderButtons(t.buttons,!1)}
|
|
18
18
|
${this.renderSections(t.sections)}
|
|
19
19
|
${this.renderFooter(t.links,t.some)}
|
|
20
20
|
</nav>
|
|
21
|
-
`}renderMobileAccordion(t,n){return e.
|
|
21
|
+
`}renderMobileAccordion(t,n){return e.p`
|
|
22
22
|
<div class="pkt-header-menu__sections">
|
|
23
23
|
<pkt-accordion
|
|
24
24
|
class="pkt-header-menu__sections-inner"
|
|
@@ -33,7 +33,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
33
33
|
>
|
|
34
34
|
${this.renderServicesList(t)}
|
|
35
35
|
</pkt-accordion-item>
|
|
36
|
-
${n.map((t,n)=>e.
|
|
36
|
+
${n.map((t,n)=>e.p`
|
|
37
37
|
<pkt-accordion-item
|
|
38
38
|
class="pkt-header-menu__section"
|
|
39
39
|
skin="plus-minus"
|
|
@@ -45,9 +45,9 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
45
45
|
`)}
|
|
46
46
|
</pkt-accordion>
|
|
47
47
|
</div>
|
|
48
|
-
`}renderServicesList(t){return e.
|
|
48
|
+
`}renderServicesList(t){return e.p`
|
|
49
49
|
<ul class="pkt-header-menu__services-list">
|
|
50
|
-
${t.links.map(t=>e.
|
|
50
|
+
${t.links.map(t=>e.p`
|
|
51
51
|
<li class="pkt-header-menu__service">
|
|
52
52
|
<a class="pkt-header-menu__service-link" href=${t.url}>
|
|
53
53
|
<pkt-icon
|
|
@@ -60,14 +60,14 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
60
60
|
</li>
|
|
61
61
|
`)}
|
|
62
62
|
</ul>
|
|
63
|
-
`}renderServices(t){return e.
|
|
63
|
+
`}renderServices(t){return e.p`
|
|
64
64
|
<div class="pkt-header-menu__services">
|
|
65
65
|
<h2 class="pkt-header-menu__services-title">${t.title}</h2>
|
|
66
66
|
${this.renderServicesList(t)}
|
|
67
67
|
</div>
|
|
68
|
-
`}renderButtons(n,r){return!n||n.length===0?e.
|
|
68
|
+
`}renderButtons(n,r){return!n||n.length===0?e.d:e.p`
|
|
69
69
|
<div class=${t.t({"pkt-header-menu__buttons":!0,"pkt-header-menu__buttons--mobile":r})}>
|
|
70
|
-
${n.map(t=>e.
|
|
70
|
+
${n.map(t=>e.p`
|
|
71
71
|
<a
|
|
72
72
|
class="pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small"
|
|
73
73
|
href=${t.url}
|
|
@@ -81,10 +81,10 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
81
81
|
</a>
|
|
82
82
|
`)}
|
|
83
83
|
</div>
|
|
84
|
-
`}renderSections(t){return!t||t.length===0?e.
|
|
84
|
+
`}renderSections(t){return!t||t.length===0?e.d:e.p`
|
|
85
85
|
<div class="pkt-header-menu__sections">
|
|
86
86
|
<div class="pkt-header-menu__sections-inner">
|
|
87
|
-
${t.map(t=>e.
|
|
87
|
+
${t.map(t=>e.p`
|
|
88
88
|
<div class="pkt-header-menu__section">
|
|
89
89
|
<h2 class="pkt-header-menu__section-title">${t.title}</h2>
|
|
90
90
|
${this.renderSectionList(t.links)}
|
|
@@ -92,35 +92,35 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
92
92
|
`)}
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
|
-
`}renderSectionList(t){return e.
|
|
95
|
+
`}renderSectionList(t){return e.p`
|
|
96
96
|
<ul class="pkt-header-menu__section-list">
|
|
97
|
-
${t.map(t=>e.
|
|
97
|
+
${t.map(t=>e.p`
|
|
98
98
|
<li>
|
|
99
99
|
<a class="pkt-header-menu__section-link" href=${t.url}>${t.text}</a>
|
|
100
100
|
</li>
|
|
101
101
|
`)}
|
|
102
102
|
</ul>
|
|
103
|
-
`}renderFooter(t,n){return(!t||t.length===0)&&(!n||n.length===0)?e.
|
|
103
|
+
`}renderFooter(t,n){return(!t||t.length===0)&&(!n||n.length===0)?e.d:e.p`
|
|
104
104
|
<div class="pkt-header-menu__footer">
|
|
105
|
-
${t&&t.length>0?e.
|
|
105
|
+
${t&&t.length>0?e.p`
|
|
106
106
|
<ul class="pkt-header-menu__footer-list">
|
|
107
|
-
${t.map(t=>e.
|
|
107
|
+
${t.map(t=>e.p`
|
|
108
108
|
<li>
|
|
109
109
|
<a class="pkt-header-menu__footer-link" href=${t.url}>${t.text}</a>
|
|
110
110
|
</li>
|
|
111
111
|
`)}
|
|
112
112
|
</ul>
|
|
113
|
-
`:e.
|
|
114
|
-
${n&&n.length>0?e.
|
|
113
|
+
`:e.d}
|
|
114
|
+
${n&&n.length>0?e.p`
|
|
115
115
|
<ul class="pkt-header-menu__footer-list pkt-header-menu__footer-list--social">
|
|
116
116
|
${n.map(e=>this.renderSocialLink(e))}
|
|
117
117
|
</ul>
|
|
118
|
-
`:e.
|
|
118
|
+
`:e.d}
|
|
119
119
|
</div>
|
|
120
|
-
`}renderSocialLink(t){let n=c(t.url,t.text);return e.
|
|
120
|
+
`}renderSocialLink(t){let n=c(t.url,t.text);return e.p`
|
|
121
121
|
<li>
|
|
122
122
|
<a class="pkt-header-menu__social-link" href=${t.url} aria-label=${t.text}>
|
|
123
|
-
${n?e.
|
|
123
|
+
${n?e.p`<pkt-icon name=${n} aria-hidden="true"></pkt-icon>`:e.p`<span>${t.text}</span>`}
|
|
124
124
|
</a>
|
|
125
125
|
</li>
|
|
126
|
-
`}};e.
|
|
126
|
+
`}};e.n([e.o({type:String,attribute:`data-url`})],f.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],f.prototype,`data`,void 0),e.n([e.o({type:String})],f.prototype,`locale`,void 0),e.n([e.o({type:Boolean,reflect:!0,converter:n.t})],f.prototype,`open`,void 0),e.n([e.o({type:String,attribute:`aria-labelledby`,reflect:!0})],f.prototype,`ariaLabelledBy`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.n([e.a()],f.prototype,`loadState`,void 0),e.n([e.a()],f.prototype,`fetchedData`,void 0),e.n([e.a()],f.prototype,`isMobile`,void 0);try{e.s(`pkt-header-menu`)(f)}catch{console.warn(`Forsøker å definere <pkt-header-menu>, men den er allerede definert`)}var p=f;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { n as e, o as t, p as n, s as r } from "./element-CduG0XyF.js";
|
|
2
|
+
import { n as i, t as a } from "./element-with-slot-BVj9MXzi.js";
|
|
3
|
+
//#region src/components/heading/heading.ts
|
|
4
|
+
var o = class extends a {
|
|
5
|
+
constructor(...e) {
|
|
6
|
+
super(...e), this.size = void 0, this.level = 2, this.weight = void 0, this.visuallyHidden = !1, this.align = void 0;
|
|
7
|
+
}
|
|
8
|
+
updated(e) {
|
|
9
|
+
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);
|
|
10
|
+
}
|
|
11
|
+
get defaultSizeForLevel() {
|
|
12
|
+
switch (this.level) {
|
|
13
|
+
case 1: return "xlarge";
|
|
14
|
+
case 2: return "large";
|
|
15
|
+
case 3: return "medium";
|
|
16
|
+
case 4: return "small";
|
|
17
|
+
case 5:
|
|
18
|
+
case 6: return "xsmall";
|
|
19
|
+
default: return "medium";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
get defaultWeightForLevel() {
|
|
23
|
+
switch (this.level) {
|
|
24
|
+
case 1:
|
|
25
|
+
case 2: return "regular";
|
|
26
|
+
case 3:
|
|
27
|
+
case 4:
|
|
28
|
+
case 5:
|
|
29
|
+
case 6: return "medium";
|
|
30
|
+
default: return "medium";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
get headingClasses() {
|
|
34
|
+
return [
|
|
35
|
+
"pkt-heading",
|
|
36
|
+
this.size && `pkt-heading--${this.size}`,
|
|
37
|
+
this.weight && `pkt-heading--fw-${this.weight}`,
|
|
38
|
+
this.visuallyHidden && "pkt-sr-only",
|
|
39
|
+
this.align && `pkt-heading--${this.align}`
|
|
40
|
+
].filter(Boolean).join(" ");
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
let e = this.headingClasses, t = i(this);
|
|
44
|
+
switch (this.level >= 1 && this.level <= 6 ? this.level : 2) {
|
|
45
|
+
case 1: return n`<h1 class=${e}>${t}</h1>`;
|
|
46
|
+
case 2: return n`<h2 class=${e}>${t}</h2>`;
|
|
47
|
+
case 3: return n`<h3 class=${e}>${t}</h3>`;
|
|
48
|
+
case 4: return n`<h4 class=${e}>${t}</h4>`;
|
|
49
|
+
case 5: return n`<h5 class=${e}>${t}</h5>`;
|
|
50
|
+
case 6: return n`<h6 class=${e}>${t}</h6>`;
|
|
51
|
+
default: return n`<h2 class=${e}>${t}</h2>`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
e([t({
|
|
56
|
+
type: String,
|
|
57
|
+
reflect: !0
|
|
58
|
+
})], o.prototype, "size", void 0), e([t({
|
|
59
|
+
type: Number,
|
|
60
|
+
reflect: !0
|
|
61
|
+
})], o.prototype, "level", void 0), e([t({
|
|
62
|
+
type: String,
|
|
63
|
+
reflect: !0
|
|
64
|
+
})], o.prototype, "weight", void 0), e([t({
|
|
65
|
+
type: Boolean,
|
|
66
|
+
reflect: !0
|
|
67
|
+
})], o.prototype, "visuallyHidden", void 0), e([t({
|
|
68
|
+
type: String,
|
|
69
|
+
reflect: !0
|
|
70
|
+
})], o.prototype, "align", void 0);
|
|
71
|
+
try {
|
|
72
|
+
r("pkt-heading")(o);
|
|
73
|
+
} catch {
|
|
74
|
+
console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/heading/index.ts
|
|
78
|
+
var s = o;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { o as n, s as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.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.p`<h1 class=${n}>${r}</h1>`;case 2:return e.p`<h2 class=${n}>${r}</h2>`;case 3:return e.p`<h3 class=${n}>${r}</h3>`;case 4:return e.p`<h4 class=${n}>${r}</h4>`;case 5:return e.p`<h5 class=${n}>${r}</h5>`;case 6:return e.p`<h6 class=${n}>${r}</h6>`;default:return e.p`<h2 class=${n}>${r}</h2>`}}};e.n([e.o({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.o({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.o({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.s(`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,16 +1,16 @@
|
|
|
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-
|
|
5
|
-
import { n as u } from "./utils-
|
|
6
|
-
import { t as d } from "./input-wrapper-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as o } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import { n as s, t as c } from "./element-with-slot-BVj9MXzi.js";
|
|
4
|
+
import { r as l } from "./icon-LaKyBKON.js";
|
|
5
|
+
import { n as u } from "./utils-CUqCKGvp.js";
|
|
6
|
+
import { t as d } from "./input-wrapper-kw2y6Jp_.js";
|
|
7
7
|
//#region src/components/helptext/helptext.ts
|
|
8
8
|
var f = class extends c {
|
|
9
9
|
constructor(...e) {
|
|
10
10
|
super(...e), this.forId = u(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = d.props.helptextDropdownButton.default, this.isHelpTextOpen = !1;
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return
|
|
13
|
+
return i`${i`<div class="${o({
|
|
14
14
|
"pkt-inputwrapper__helptext-container": !0,
|
|
15
15
|
"pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.hasSlotContent()
|
|
16
16
|
})}">
|
|
@@ -18,7 +18,7 @@ var f = class extends c {
|
|
|
18
18
|
<div class="pkt-contents" name="helptext">${s(this)}</div>
|
|
19
19
|
${this.helptext && l(this.helptext)}
|
|
20
20
|
</div>
|
|
21
|
-
${this.helptextDropdown ?
|
|
21
|
+
${this.helptextDropdown ? i`<div class="pkt-inputwrapper__helptext-expandable">
|
|
22
22
|
<button
|
|
23
23
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
24
24
|
type="button"
|
|
@@ -45,16 +45,16 @@ var f = class extends c {
|
|
|
45
45
|
>
|
|
46
46
|
${l(this.helptextDropdown)}
|
|
47
47
|
</div>
|
|
48
|
-
</div>` :
|
|
48
|
+
</div>` : t}
|
|
49
49
|
</div>`}`;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
n([r({
|
|
53
53
|
type: String,
|
|
54
54
|
reflect: !0
|
|
55
|
-
})], f.prototype, "forId", void 0),
|
|
55
|
+
})], f.prototype, "forId", void 0), n([r({ type: String })], f.prototype, "helptext", void 0), n([r({ type: String })], f.prototype, "helptextDropdown", void 0), n([r({ type: String })], f.prototype, "helptextDropdownButton", void 0), n([e()], f.prototype, "isHelpTextOpen", void 0);
|
|
56
56
|
try {
|
|
57
|
-
|
|
57
|
+
a("pkt-helptext")(f);
|
|
58
58
|
} catch {
|
|
59
59
|
console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert");
|
|
60
60
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`),r=require(`./icon-Dw6I0HDV.cjs`),i=require(`./utils-CjAbIttF.cjs`),a=require(`./input-wrapper-CYCCx8MP.cjs`);var o=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=a.t.props.helptextDropdownButton.default,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.p`${e.p`<div class="${a}">
|
|
2
2
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
3
3
|
<div class="pkt-contents" name="helptext">${n.n(this)}</div>
|
|
4
4
|
${this.helptext&&r.r(this.helptext)}
|
|
5
5
|
</div>
|
|
6
|
-
${this.helptextDropdown?e.
|
|
6
|
+
${this.helptextDropdown?e.p`<div class="pkt-inputwrapper__helptext-expandable">
|
|
7
7
|
<button
|
|
8
8
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
9
9
|
type="button"
|
|
@@ -20,5 +20,5 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
|
|
|
20
20
|
>
|
|
21
21
|
${r.r(this.helptextDropdown)}
|
|
22
22
|
</div>
|
|
23
|
-
</div>`:e.
|
|
24
|
-
</div>`}`}};e.
|
|
23
|
+
</div>`:e.d}
|
|
24
|
+
</div>`}`}};e.n([e.o({type:String,reflect:!0})],o.prototype,`forId`,void 0),e.n([e.o({type:String})],o.prototype,`helptext`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdown`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdownButton`,void 0),e.n([e.a()],o.prototype,`isHelpTextOpen`,void 0);try{e.s(`pkt-helptext`)(o)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`);var t=class extends e.l{constructor(t){if(super(t),this.it=e.d,t.type!==e.u.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.d||t==null)return this._t=void 0,this.it=t;if(t===e.f)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.c(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.c(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.p`${this.name&&this.icon}`}};e.n([e.o({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.o({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.o({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.o({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.o({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.s(`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,28 +1,27 @@
|
|
|
1
|
-
import { c as e, d as t,
|
|
2
|
-
import { n as s, r as c, t as l } from "./directive-3THFsVew.js";
|
|
1
|
+
import { c as e, d as t, f as n, l as r, n as i, o as a, p as o, s, t as c, u as l } from "./element-CduG0XyF.js";
|
|
3
2
|
//#region ../../node_modules/lit-html/directives/unsafe-html.js
|
|
4
|
-
var u = class extends
|
|
3
|
+
var u = class extends r {
|
|
5
4
|
constructor(e) {
|
|
6
|
-
if (super(e), this.it =
|
|
5
|
+
if (super(e), this.it = t, e.type !== l.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
7
6
|
}
|
|
8
7
|
render(e) {
|
|
9
|
-
if (e ===
|
|
10
|
-
if (e ===
|
|
8
|
+
if (e === t || e == null) return this._t = void 0, this.it = e;
|
|
9
|
+
if (e === n) return e;
|
|
11
10
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
12
11
|
if (e === this.it) return this._t;
|
|
13
12
|
this.it = e;
|
|
14
|
-
let
|
|
15
|
-
return
|
|
13
|
+
let r = [e];
|
|
14
|
+
return r.raw = r, this._t = {
|
|
16
15
|
_$litType$: this.constructor.resultType,
|
|
17
|
-
strings:
|
|
16
|
+
strings: r,
|
|
18
17
|
values: []
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
u.directiveName = "unsafeHTML", u.resultType = 1;
|
|
23
|
-
var d =
|
|
22
|
+
var d = e(u), f = class extends u {};
|
|
24
23
|
f.directiveName = "unsafeSVG", f.resultType = 2;
|
|
25
|
-
var p =
|
|
24
|
+
var p = e(f), m = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
|
|
26
25
|
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || m);
|
|
27
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) => {
|
|
28
27
|
if (!t.ok) throw Error("Missing icon: " + e);
|
|
@@ -36,7 +35,7 @@ var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
|
|
|
36
35
|
}, S = async (e, t) => {
|
|
37
36
|
let n = t + e + ".svg";
|
|
38
37
|
return y && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in g ? g[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (g[n] = x(n).then((e) => (e !== h && y && sessionStorage.setItem(n, e), delete g[n], e)), g[n]) : h;
|
|
39
|
-
}, C = class extends
|
|
38
|
+
}, C = class extends c {
|
|
40
39
|
constructor(...e) {
|
|
41
40
|
super(...e), this.path = typeof window < "u" ? window.pktIconPath : m, this.name = "", this.ariaHidden = null, this.ariaLabel = null, this.icon = p(h), this._updatedProps = [];
|
|
42
41
|
}
|
|
@@ -74,29 +73,29 @@ var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
|
|
|
74
73
|
} else this._updatedProps.includes(e) || this._updatedProps.push(e);
|
|
75
74
|
}
|
|
76
75
|
render() {
|
|
77
|
-
return
|
|
76
|
+
return o`${this.name && this.icon}`;
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
|
-
|
|
79
|
+
i([a({
|
|
81
80
|
type: String,
|
|
82
81
|
reflect: !1
|
|
83
|
-
})], C.prototype, "path", void 0),
|
|
82
|
+
})], C.prototype, "path", void 0), i([a({
|
|
84
83
|
type: String,
|
|
85
84
|
reflect: !0
|
|
86
|
-
})], C.prototype, "name", void 0),
|
|
85
|
+
})], C.prototype, "name", void 0), i([a({
|
|
87
86
|
type: String,
|
|
88
87
|
attribute: "aria-hidden",
|
|
89
88
|
reflect: !0
|
|
90
|
-
})], C.prototype, "ariaHidden", void 0),
|
|
89
|
+
})], C.prototype, "ariaHidden", void 0), i([a({
|
|
91
90
|
type: String,
|
|
92
91
|
attribute: "aria-label",
|
|
93
92
|
reflect: !0
|
|
94
|
-
})], C.prototype, "ariaLabel", void 0),
|
|
93
|
+
})], C.prototype, "ariaLabel", void 0), i([a({ type: SVGElement })], C.prototype, "icon", void 0), i([a({
|
|
95
94
|
type: Array,
|
|
96
95
|
noAccessor: !0
|
|
97
96
|
})], C.prototype, "_updatedProps", void 0);
|
|
98
97
|
try {
|
|
99
|
-
|
|
98
|
+
s("pkt-icon")(C);
|
|
100
99
|
} catch {
|
|
101
100
|
console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
|
|
102
101
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`);var t=t=>t??e.d;Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|