@oslokommune/punkt-elements 17.1.2 → 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 +35 -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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { t as s } from "./class-map-F1DJHyb7.js";
|
|
3
|
+
import "./icon-HYU1f54x.js";
|
|
4
4
|
import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-CkjLSYpa.js";
|
|
5
5
|
//#region ../../node_modules/date-fns/addDays.js
|
|
6
6
|
function x(e, t, n) {
|
|
@@ -282,9 +282,20 @@ function U(e) {
|
|
|
282
282
|
}
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region src/components/calendar/calendar.ts
|
|
285
|
-
var W = class extends
|
|
285
|
+
var W = class extends a {
|
|
286
286
|
constructor(...e) {
|
|
287
|
-
super(...e), this.selected = [], this.multiple = T.props.multiple.default, this.maxMultiple = T.props.maxMultiple.default, this.range = T.props.range.default, this.earliest = T.props.earliest.default, this.latest = T.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = T.props.weeknumbers.default, this.withcontrols = T.props.withcontrols.default, this.currentmonth = null, this.today = null, this.
|
|
287
|
+
super(...e), this.selected = [], this.multiple = T.props.multiple.default, this.maxMultiple = T.props.maxMultiple.default, this.range = T.props.range.default, this.earliest = T.props.earliest.default, this.latest = T.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = T.props.weeknumbers.default, this.withcontrols = T.props.withcontrols.default, this.currentmonth = null, this.today = null, this._selected = [], this.inRange = {}, this.rangeHovered = null, this.year = 0, this.month = 0, this.week = 0, this.currentmonthtouched = !1, this.focusedDate = null, this.selectableDates = [], this.tabIndexSet = 0;
|
|
288
|
+
}
|
|
289
|
+
get calendarStrings() {
|
|
290
|
+
let e = this.pktStrings.get("dates"), t = this.pktStrings.get("calendar");
|
|
291
|
+
return {
|
|
292
|
+
daysShort: this.dayStrings ?? e.daysShort,
|
|
293
|
+
days: this.dayStringsLong ?? e.days,
|
|
294
|
+
months: this.monthStrings ?? e.months,
|
|
295
|
+
week: this.weekString ?? e.week,
|
|
296
|
+
prevMonth: this.prevMonthString ?? t.prevMonth,
|
|
297
|
+
nextMonth: this.nextMonthString ?? t.nextMonth
|
|
298
|
+
};
|
|
288
299
|
}
|
|
289
300
|
get todayDate() {
|
|
290
301
|
return this.today ? h(this.today) : p();
|
|
@@ -326,7 +337,7 @@ var W = class extends o {
|
|
|
326
337
|
}
|
|
327
338
|
}
|
|
328
339
|
render() {
|
|
329
|
-
return
|
|
340
|
+
return e`
|
|
330
341
|
<div
|
|
331
342
|
class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : ""}"
|
|
332
343
|
@focusout=${this.closeEvent}
|
|
@@ -335,8 +346,7 @@ var W = class extends o {
|
|
|
335
346
|
}}
|
|
336
347
|
>
|
|
337
348
|
<nav class="pkt-cal-month-nav">
|
|
338
|
-
${this.renderMonthNavButton("prev")}
|
|
339
|
-
${this.renderMonthNav()}
|
|
349
|
+
${this.renderMonthNavButton("prev")} ${this.renderMonthNav()}
|
|
340
350
|
${this.renderMonthNavButton("next")}
|
|
341
351
|
</nav>
|
|
342
352
|
<table
|
|
@@ -354,41 +364,43 @@ var W = class extends o {
|
|
|
354
364
|
</div>
|
|
355
365
|
`;
|
|
356
366
|
}
|
|
357
|
-
renderMonthNavButton(
|
|
358
|
-
let
|
|
359
|
-
return
|
|
367
|
+
renderMonthNavButton(t) {
|
|
368
|
+
let r = t === "prev", i = r ? this.isPrevMonthAllowed() : this.isNextMonthAllowed(), { prevMonth: a, nextMonth: o } = this.calendarStrings, s = r ? a : o, c = r ? "chevron-thin-left" : "chevron-thin-right", l = r ? "pkt-calendar__prev-month" : "pkt-calendar__next-month", u = r ? () => this.prevMonth() : () => this.nextMonth();
|
|
369
|
+
return e`<div>
|
|
360
370
|
<button
|
|
361
371
|
type="button"
|
|
362
|
-
aria-label="${
|
|
363
|
-
@click=${() =>
|
|
372
|
+
aria-label="${s}"
|
|
373
|
+
@click=${() => i && u()}
|
|
364
374
|
@keydown=${(e) => {
|
|
365
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
375
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i && u());
|
|
366
376
|
}}
|
|
367
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${
|
|
368
|
-
.data-disabled=${
|
|
369
|
-
?aria-disabled=${!
|
|
370
|
-
tabindex=${
|
|
377
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${l} ${i ? "" : "pkt-invisible"}"
|
|
378
|
+
.data-disabled=${i ? n : "disabled"}
|
|
379
|
+
?aria-disabled=${!i}
|
|
380
|
+
tabindex=${i ? "0" : "-1"}
|
|
371
381
|
>
|
|
372
|
-
<pkt-icon class="pkt-btn__icon" name="${
|
|
373
|
-
<span class="pkt-btn__text">${
|
|
382
|
+
<pkt-icon class="pkt-btn__icon" name="${c}"></pkt-icon>
|
|
383
|
+
<span class="pkt-btn__text">${s}</span>
|
|
374
384
|
</button>
|
|
375
385
|
</div>`;
|
|
376
386
|
}
|
|
377
387
|
renderDayNames() {
|
|
378
|
-
let
|
|
379
|
-
this.weeknumbers &&
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
</div>
|
|
388
|
+
let t = [];
|
|
389
|
+
this.weeknumbers && t.push(e`<th><div class="pkt-calendar__week-number">${this.calendarStrings.week}</div></th>`);
|
|
390
|
+
let { days: n, daysShort: r } = this.calendarStrings;
|
|
391
|
+
for (let i = 0; i < r.length; i++) t.push(e`<th>
|
|
392
|
+
<div class="pkt-calendar__day-name" aria-label="${n[i]}">${r[i]}</div>
|
|
384
393
|
</th>`);
|
|
385
|
-
return
|
|
394
|
+
return e`<tr class="pkt-cal-week-row">
|
|
395
|
+
${t}
|
|
396
|
+
</tr>`;
|
|
386
397
|
}
|
|
387
398
|
renderMonthNav() {
|
|
388
|
-
|
|
389
|
-
|
|
399
|
+
let t = this.pktStrings.get("dates");
|
|
400
|
+
return this.withcontrols ? e`<div class="pkt-cal-month-picker">
|
|
401
|
+
<label for="${this.id}-monthnav" class="pkt-hide">${t.month}</label>
|
|
390
402
|
<select
|
|
391
|
-
aria-label="${
|
|
403
|
+
aria-label="${t.month}"
|
|
392
404
|
class="pkt-input pkt-input-compact"
|
|
393
405
|
id="${this.id}-monthnav"
|
|
394
406
|
@change=${(e) => {
|
|
@@ -397,11 +409,11 @@ var W = class extends o {
|
|
|
397
409
|
this.changeMonth(this.year, parseInt(t.value));
|
|
398
410
|
}}
|
|
399
411
|
>
|
|
400
|
-
${this.
|
|
412
|
+
${this.calendarStrings.months.map((t, n) => e`<option value=${n} ?selected=${this.month === n}>${t}</option>`)}
|
|
401
413
|
</select>
|
|
402
|
-
<label for="${this.id}-yearnav" class="pkt-hide">${
|
|
414
|
+
<label for="${this.id}-yearnav" class="pkt-hide">${t.year}</label>
|
|
403
415
|
<input
|
|
404
|
-
aria-label="${
|
|
416
|
+
aria-label="${t.year}"
|
|
405
417
|
class="pkt-input pkt-cal-input-year pkt-input-compact"
|
|
406
418
|
id="${this.id}-yearnav"
|
|
407
419
|
type="number"
|
|
@@ -414,8 +426,8 @@ var W = class extends o {
|
|
|
414
426
|
}}
|
|
415
427
|
.value=${this.year}
|
|
416
428
|
/>
|
|
417
|
-
</div>` :
|
|
418
|
-
${this.
|
|
429
|
+
</div>` : e`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
430
|
+
${this.calendarStrings.months[this.month]} ${this.year}
|
|
419
431
|
</div>`;
|
|
420
432
|
}
|
|
421
433
|
getDayViewData(e, t) {
|
|
@@ -476,15 +488,15 @@ var W = class extends o {
|
|
|
476
488
|
handleDayFocus(e, t) {
|
|
477
489
|
this.range && !this.isExcluded(e) && this.handleRangeHover(e), this.focusedDate = t;
|
|
478
490
|
}
|
|
479
|
-
renderDayView(
|
|
480
|
-
let
|
|
491
|
+
renderDayView(t, r) {
|
|
492
|
+
let i = this.getDayViewData(t, r), { currentDate: a, currentDateISO: o, isSelected: c, isDisabled: l, ariaLabel: u, tabindex: d } = i;
|
|
481
493
|
this.selectableDates.push({
|
|
482
494
|
currentDateISO: o,
|
|
483
495
|
isDisabled: l,
|
|
484
496
|
tabindex: d
|
|
485
497
|
});
|
|
486
|
-
let f = this.getDayCellClasses(
|
|
487
|
-
return
|
|
498
|
+
let f = this.getDayCellClasses(i), p = this.getDayButtonClasses(i);
|
|
499
|
+
return e`<td class=${s(f)}>
|
|
488
500
|
<button
|
|
489
501
|
type="button"
|
|
490
502
|
aria-pressed=${c ? "true" : "false"}
|
|
@@ -494,7 +506,7 @@ var W = class extends o {
|
|
|
494
506
|
@focus=${() => this.handleDayFocus(a, o)}
|
|
495
507
|
aria-label="${u}"
|
|
496
508
|
tabindex=${d}
|
|
497
|
-
data-disabled=${l ? "disabled" :
|
|
509
|
+
data-disabled=${l ? "disabled" : n}
|
|
498
510
|
data-date=${o}
|
|
499
511
|
@keydown=${(e) => {
|
|
500
512
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleDateSelect(a));
|
|
@@ -503,43 +515,45 @@ var W = class extends o {
|
|
|
503
515
|
l || (e.preventDefault(), this.handleDateSelect(a));
|
|
504
516
|
}}
|
|
505
517
|
>
|
|
506
|
-
<span class="pkt-btn__text pkt-txt-14-light">${
|
|
518
|
+
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
507
519
|
</button>
|
|
508
520
|
</td>`;
|
|
509
521
|
}
|
|
510
|
-
renderEmptyDayCell(
|
|
511
|
-
return
|
|
522
|
+
renderEmptyDayCell(t) {
|
|
523
|
+
return e`<td class="pkt-cal-other">
|
|
512
524
|
<div
|
|
513
525
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
514
526
|
data-disabled="disabled"
|
|
515
527
|
>
|
|
516
|
-
<span class="pkt-btn__text pkt-txt-14-light">${
|
|
528
|
+
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
517
529
|
</div>
|
|
518
530
|
</td>`;
|
|
519
531
|
}
|
|
520
|
-
renderWeekRow(
|
|
521
|
-
return
|
|
532
|
+
renderWeekRow(t) {
|
|
533
|
+
return e`<tr class="pkt-cal-week-row" role="row">
|
|
534
|
+
${t}
|
|
535
|
+
</tr>`;
|
|
522
536
|
}
|
|
523
537
|
renderCalendarBody() {
|
|
524
|
-
let
|
|
538
|
+
let t = this.todayDate, n = A(this.year, this.month);
|
|
525
539
|
this.selectableDates = [], this.tabIndexSet = 0;
|
|
526
|
-
let
|
|
527
|
-
this.week =
|
|
528
|
-
let
|
|
529
|
-
for (let a = 0; a <
|
|
540
|
+
let r = 1;
|
|
541
|
+
this.week = n.initialWeek;
|
|
542
|
+
let i = [];
|
|
543
|
+
for (let a = 0; a < n.numRows; a++) {
|
|
530
544
|
let o = [];
|
|
531
|
-
this.weeknumbers && o.push(
|
|
532
|
-
for (let
|
|
533
|
-
let i = j(a, r, n
|
|
534
|
-
if (i === "current-month") o.push(this.renderDayView(
|
|
545
|
+
this.weeknumbers && o.push(e`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
|
|
546
|
+
for (let e = 0; e < 7; e++) {
|
|
547
|
+
let i = j(a, e, r, n);
|
|
548
|
+
if (i === "current-month") o.push(this.renderDayView(r, t)), r++;
|
|
535
549
|
else {
|
|
536
|
-
let
|
|
537
|
-
o.push(this.renderEmptyDayCell(
|
|
550
|
+
let t = M(i, e, r, n);
|
|
551
|
+
o.push(this.renderEmptyDayCell(t)), i === "next-month" && r++;
|
|
538
552
|
}
|
|
539
553
|
}
|
|
540
|
-
|
|
554
|
+
i.push(this.renderWeekRow(o));
|
|
541
555
|
}
|
|
542
|
-
return
|
|
556
|
+
return i;
|
|
543
557
|
}
|
|
544
558
|
isExcluded(e) {
|
|
545
559
|
return E(e, this.getDateConstraints());
|
|
@@ -623,30 +637,30 @@ var W = class extends o {
|
|
|
623
637
|
}));
|
|
624
638
|
}
|
|
625
639
|
};
|
|
626
|
-
|
|
640
|
+
i([o({ converter: v.csvToArray })], W.prototype, "selected", void 0), i([o({ type: Boolean })], W.prototype, "multiple", void 0), i([o({
|
|
627
641
|
type: Number,
|
|
628
642
|
attribute: "max-multiple"
|
|
629
|
-
})], W.prototype, "maxMultiple", void 0),
|
|
643
|
+
})], W.prototype, "maxMultiple", void 0), i([o({ type: Boolean })], W.prototype, "range", void 0), i([o({ type: String })], W.prototype, "earliest", void 0), i([o({ type: String })], W.prototype, "latest", void 0), i([o({ converter: v.stringsToDate })], W.prototype, "excludedates", void 0), i([o({ converter: v.csvToArray })], W.prototype, "excludeweekdays", void 0), i([o({ type: Boolean })], W.prototype, "weeknumbers", void 0), i([o({ type: Boolean })], W.prototype, "withcontrols", void 0), i([o({ converter: v.stringToDate })], W.prototype, "currentmonth", void 0), i([o({ type: String })], W.prototype, "today", void 0), i([o({
|
|
630
644
|
type: Array,
|
|
631
645
|
attribute: "day-strings"
|
|
632
|
-
})], W.prototype, "dayStrings", void 0),
|
|
646
|
+
})], W.prototype, "dayStrings", void 0), i([o({
|
|
633
647
|
type: Array,
|
|
634
648
|
attribute: "day-strings-long"
|
|
635
|
-
})], W.prototype, "dayStringsLong", void 0),
|
|
649
|
+
})], W.prototype, "dayStringsLong", void 0), i([o({
|
|
636
650
|
type: Array,
|
|
637
651
|
attribute: "month-strings"
|
|
638
|
-
})], W.prototype, "monthStrings", void 0),
|
|
652
|
+
})], W.prototype, "monthStrings", void 0), i([o({
|
|
639
653
|
type: String,
|
|
640
654
|
attribute: "week-string"
|
|
641
|
-
})], W.prototype, "weekString", void 0),
|
|
655
|
+
})], W.prototype, "weekString", void 0), i([o({
|
|
642
656
|
type: String,
|
|
643
657
|
attribute: "prev-month-string"
|
|
644
|
-
})], W.prototype, "prevMonthString", void 0),
|
|
658
|
+
})], W.prototype, "prevMonthString", void 0), i([o({
|
|
645
659
|
type: String,
|
|
646
660
|
attribute: "next-month-string"
|
|
647
|
-
})], W.prototype, "nextMonthString", void 0),
|
|
661
|
+
})], W.prototype, "nextMonthString", void 0), i([o({ type: Array })], W.prototype, "_selected", void 0), i([r()], W.prototype, "inRange", void 0), i([o({ type: Date })], W.prototype, "rangeHovered", void 0), i([o({ type: Number })], W.prototype, "year", void 0), i([o({ type: Number })], W.prototype, "month", void 0), i([o({ type: Number })], W.prototype, "week", void 0), i([r()], W.prototype, "currentmonthtouched", void 0), i([r()], W.prototype, "focusedDate", void 0);
|
|
648
662
|
try {
|
|
649
|
-
|
|
663
|
+
t("pkt-calendar")(W);
|
|
650
664
|
} catch {
|
|
651
665
|
console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert");
|
|
652
666
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as a } from "./class-map-
|
|
3
|
-
import { n as o, t as s } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as c } from "./if-defined-
|
|
6
|
-
import "./tag-
|
|
7
|
-
import "./heading-
|
|
1
|
+
import { _ as e, d as t, h as n, n as r, u as i } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { t as a } from "./class-map-F1DJHyb7.js";
|
|
3
|
+
import { n as o, t as s } from "./element-with-slot-YUAUFRqw.js";
|
|
4
|
+
import "./icon-HYU1f54x.js";
|
|
5
|
+
import { t as c } from "./if-defined-BF8XcDi5.js";
|
|
6
|
+
import "./tag-DK5SgKry.js";
|
|
7
|
+
import "./heading-rx_oSCqe.js";
|
|
8
8
|
var l = {
|
|
9
9
|
name: "pkt-card",
|
|
10
10
|
react: "PktCard",
|
|
@@ -192,39 +192,39 @@ var l = {
|
|
|
192
192
|
[`pkt-card--${this.layout}`]: this.layout,
|
|
193
193
|
[`pkt-card--padding-${this.padding}`]: this.padding,
|
|
194
194
|
"pkt-card--border-on-hover": this.borderOnHover
|
|
195
|
-
},
|
|
196
|
-
return
|
|
195
|
+
}, r = this.ariaLabel?.trim() || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), i = this.ariaLabel?.trim() || (this.heading ? this.heading : "kort");
|
|
196
|
+
return e`
|
|
197
197
|
<article
|
|
198
198
|
class=${a(t)}
|
|
199
|
-
aria-label=${c(this.clickCardLink ?
|
|
199
|
+
aria-label=${c(this.clickCardLink ? r : i)}
|
|
200
200
|
>
|
|
201
201
|
${this.renderImage()}
|
|
202
202
|
<div class="pkt-card__wrapper">
|
|
203
|
-
${this.tagPosition === "top" ? this.renderTags() :
|
|
203
|
+
${this.tagPosition === "top" ? this.renderTags() : n}
|
|
204
204
|
${this.renderHeader()}
|
|
205
205
|
${this.renderSlot()}
|
|
206
|
-
${this.tagPosition === "bottom" ? this.renderTags() :
|
|
206
|
+
${this.tagPosition === "bottom" ? this.renderTags() : n}
|
|
207
207
|
${this.renderMetadata()}
|
|
208
208
|
</div>
|
|
209
209
|
</article>
|
|
210
210
|
`;
|
|
211
211
|
}
|
|
212
212
|
renderImage() {
|
|
213
|
-
let
|
|
213
|
+
let t = {
|
|
214
214
|
"pkt-card__image": !0,
|
|
215
215
|
[`pkt-card__image-${this.imageShape}`]: this.imageShape
|
|
216
216
|
};
|
|
217
|
-
return
|
|
218
|
-
${this.image.src &&
|
|
219
|
-
<div class=${a(
|
|
217
|
+
return e`
|
|
218
|
+
${this.image.src && e`
|
|
219
|
+
<div class=${a(t)}>
|
|
220
220
|
<img src=${this.image.src} alt=${this.image.alt || ""} />
|
|
221
221
|
</div>
|
|
222
222
|
`}
|
|
223
223
|
`;
|
|
224
224
|
}
|
|
225
225
|
renderHeading() {
|
|
226
|
-
return
|
|
227
|
-
${this.heading && !this.clickCardLink ?
|
|
226
|
+
return e`
|
|
227
|
+
${this.heading && !this.clickCardLink ? e`
|
|
228
228
|
<pkt-heading
|
|
229
229
|
class="pkt-card__heading"
|
|
230
230
|
.level=${this.headinglevel || 3}
|
|
@@ -234,12 +234,12 @@ var l = {
|
|
|
234
234
|
>
|
|
235
235
|
${this.heading}
|
|
236
236
|
</pkt-heading>
|
|
237
|
-
` :
|
|
237
|
+
` : n}
|
|
238
238
|
`;
|
|
239
239
|
}
|
|
240
240
|
renderLinkHeading() {
|
|
241
|
-
return
|
|
242
|
-
${this.clickCardLink ?
|
|
241
|
+
return e`
|
|
242
|
+
${this.clickCardLink ? e`
|
|
243
243
|
<pkt-heading
|
|
244
244
|
class="pkt-card__link-heading pkt-card__heading"
|
|
245
245
|
.level=${this.headinglevel || 3}
|
|
@@ -254,24 +254,24 @@ var l = {
|
|
|
254
254
|
>${this.heading}</a
|
|
255
255
|
>
|
|
256
256
|
</pkt-heading>
|
|
257
|
-
` :
|
|
257
|
+
` : n}
|
|
258
258
|
`;
|
|
259
259
|
}
|
|
260
260
|
renderSubheading() {
|
|
261
|
-
return
|
|
262
|
-
${this.subheading ?
|
|
261
|
+
return e`
|
|
262
|
+
${this.subheading ? e` <p class="pkt-card__subheading ">${this.subheading}</p> ` : n}
|
|
263
263
|
`;
|
|
264
264
|
}
|
|
265
265
|
renderHeader() {
|
|
266
266
|
let t = !!this.heading || !!this.subheading;
|
|
267
|
-
return
|
|
268
|
-
${t ?
|
|
267
|
+
return e`
|
|
268
|
+
${t ? e`
|
|
269
269
|
<header class="pkt-card__header">
|
|
270
270
|
${this.renderHeading()}
|
|
271
271
|
${this.renderLinkHeading()}
|
|
272
272
|
${this.renderSubheading()}
|
|
273
273
|
</header>
|
|
274
|
-
` :
|
|
274
|
+
` : n}
|
|
275
275
|
`;
|
|
276
276
|
}
|
|
277
277
|
renderTags() {
|
|
@@ -279,46 +279,46 @@ var l = {
|
|
|
279
279
|
"pkt-card__tags": !0,
|
|
280
280
|
[`pkt-card__tags-${this.tagPosition}`]: this.tagPosition
|
|
281
281
|
};
|
|
282
|
-
return
|
|
283
|
-
${this.tags.length > 0 ?
|
|
282
|
+
return e`
|
|
283
|
+
${this.tags.length > 0 ? e`
|
|
284
284
|
<div
|
|
285
285
|
class=${a(t)}
|
|
286
286
|
role="list"
|
|
287
287
|
aria-label=${this.tags.length > 1 ? "merkelapper" : "merkelapp"}
|
|
288
288
|
>
|
|
289
|
-
${this.tags.map((
|
|
289
|
+
${this.tags.map((t) => e`
|
|
290
290
|
<pkt-tag
|
|
291
291
|
role="listitem"
|
|
292
292
|
textStyle="normal-text"
|
|
293
293
|
size="medium"
|
|
294
|
-
skin=${c(
|
|
295
|
-
iconName=${c(
|
|
294
|
+
skin=${c(t.skin)}
|
|
295
|
+
iconName=${c(t.iconName)}
|
|
296
296
|
>
|
|
297
|
-
<span>${
|
|
297
|
+
<span>${t.text}</span>
|
|
298
298
|
</pkt-tag>
|
|
299
299
|
`)}
|
|
300
300
|
</div>
|
|
301
|
-
` :
|
|
301
|
+
` : n}
|
|
302
302
|
`;
|
|
303
303
|
}
|
|
304
304
|
renderSlot() {
|
|
305
|
-
return
|
|
305
|
+
return e`<section class="pkt-card__content">${o(this)}</section>`;
|
|
306
306
|
}
|
|
307
307
|
renderMetadata() {
|
|
308
|
-
return
|
|
309
|
-
${this.metaLead || this.metaTrail ?
|
|
308
|
+
return e`
|
|
309
|
+
${this.metaLead || this.metaTrail ? e`
|
|
310
310
|
<footer class="pkt-card__metadata">
|
|
311
|
-
${this.metaLead ?
|
|
312
|
-
${this.metaTrail ?
|
|
311
|
+
${this.metaLead ? e`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : n}
|
|
312
|
+
${this.metaTrail ? e`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : n}
|
|
313
313
|
</footer>
|
|
314
|
-
` :
|
|
314
|
+
` : n}
|
|
315
315
|
`;
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
|
-
|
|
318
|
+
r([i({ type: String })], u.prototype, "ariaLabel", void 0), r([i({ type: String })], u.prototype, "metaLead", void 0), r([i({ type: Boolean })], u.prototype, "borderOnHover", void 0), r([i({
|
|
319
319
|
type: String,
|
|
320
320
|
reflect: !0
|
|
321
|
-
})], u.prototype, "clickCardLink", void 0),
|
|
321
|
+
})], u.prototype, "clickCardLink", void 0), r([i({ type: String })], u.prototype, "metaTrail", void 0), r([i({ type: String })], u.prototype, "layout", void 0), r([i({ type: String })], u.prototype, "heading", void 0), r([i({ type: Number })], u.prototype, "headinglevel", void 0), r([i({ type: Object })], u.prototype, "image", void 0), r([i({ type: String })], u.prototype, "imageShape", void 0), r([i({ type: Boolean })], u.prototype, "openLinkInNewTab", void 0), r([i({ type: String })], u.prototype, "padding", void 0), r([i({
|
|
322
322
|
type: String,
|
|
323
323
|
converter: {
|
|
324
324
|
fromAttribute: (e) => {
|
|
@@ -327,9 +327,9 @@ t([n({ type: String })], u.prototype, "ariaLabel", void 0), t([n({ type: String
|
|
|
327
327
|
},
|
|
328
328
|
toAttribute: (e) => e
|
|
329
329
|
}
|
|
330
|
-
})], u.prototype, "skin", void 0),
|
|
330
|
+
})], u.prototype, "skin", void 0), r([i({ type: String })], u.prototype, "subheading", void 0), r([i({ type: String })], u.prototype, "tagPosition", void 0), r([i({ type: Array })], u.prototype, "tags", void 0);
|
|
331
331
|
try {
|
|
332
|
-
|
|
332
|
+
t("pkt-card")(u);
|
|
333
333
|
} catch {
|
|
334
334
|
console.warn("Forsøker å definere <pkt-card>, men den er allerede definert");
|
|
335
335
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs"),t=require("./class-map-CzCE5pqG.cjs"),n=require("./element-with-slot-DTxILHVv.cjs");require("./icon-BmMC09mi.cjs");const r=require("./if-defined-CVYApOgK.cjs");require("./tag-BxYulmZn.cjs"),require("./heading-CvytvcL7.cjs");var i={name:`pkt-card`,react:`PktCard`,"css-class":`pkt-card`,isElement:!0,isPureReact:!0,"dark-mode":!0,props:{heading:{type:`string`,name:`Overskrift`,description:`Tittel på card`,category:`contents`},headingLevel:{type:[1,2,3,4,5,6],name:`Overskriftsnivå`,description:`Nivået på headingen. Brukes for tilgjengelighet.`,default:3,category:`accessibility`},subheading:{type:`string`,name:`Undertittel`,description:`Undertittel på card`,category:`contents`},layout:{type:[`vertical`,`horizontal`],name:`Layout`,description:`Horisontal eller vertikal layout. Ved horisontal layout vil bildet være plassert til venstre for teksten på desktop, og over teksten på mobil.`,default:`vertical`,category:`ui`},skin:{type:[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],name:`Utseende`,description:`Fargen på card. Velg mellom outlined, outlined-beige, gray, blue, beige og green. Ved padding=none er det ikke mulighet for outlined-skin. Card med kombinasjonen av propsene padding=none + layout=vertical vil alltid være transparante.`,default:`outlined`,category:`ui`},padding:{type:[`none`,`default`],name:`Padding`,description:`Padding rundt card. Ved "none" strekker innholdet i card seg ut til kantene, og dette er derfor ikke mulig å kombinere med outlined skin.`,default:`default`,category:`ui`},metaLead:{type:`string`,name:`Forfatter eller annen metadata`,description:`Undertekst med fet skriftvekt`,default:!1,category:`contents`},metaTrail:{type:`string`,name:`Dato eller annen metadata`,description:`Undertekst med normal skriftvekt`,default:!1,category:`contents`},tagPosition:{type:[`top`,`bottom`],name:`Tagplassering`,description:`Plassering av tags i card`,default:`top`,category:`ui`},clickCardLink:{type:`string`,name:`Lenke for klikkbart card`,description:`Href sendes inn som streng for å gjøre card klikkbart. Ved bruk MÅ heading sendes inn da denne vil brukes som lenketekst i klikkbart card.`,category:`contents`},openLinkInNewTab:{type:`boolean`,name:`Åpne i ny fane`,description:`Velg denne dersom du ønsker at lenken i card skal åpnes i ny fane.`,default:!1,category:`tech`},borderOnHover:{type:`boolean`,name:`Hover border for klikkbart card`,description:`Vi anbefaler hoverborder på klikkbart card. Kan slås av ved behov.`,default:!0,category:`ui`},image:{type:`object`,name:`Bilde`,description:`Bildet på card. Tar inn et objekt av typen {src: string, alt: string}.`,properties:{src:{type:`string`,description:`Stien til bildet`,required:!0},alt:{type:`string`,description:`Tekst til skjermleser. Skal kun sendes inn for bilder som ikke er dekorative`,required:!1}},category:`contents`},imageShape:{type:[`square`,`round`],name:`Bildeform`,description:`Valg for om bildet skal ha rektangulær eller rund form.`,default:`square`,category:`contents`},tags:{type:`array`,description:`Liste av tags på card. Tar inn et array med objekter med følgende stringproperties: skin, iconName, ariaLabel, text`,name:`Tags`,items:{type:`object`,name:`Tag`,properties:{skin:{type:[`blue`,`green`,`red`,`yellow`],description:`Farge på tag`},iconName:{type:`icon`,description:`Id på ikonet du ønsker å bruke til tag`},ariaLabel:{type:`string`,description:`Tekst for aria-label`},text:{type:`string`,description:`Tekst på tag`,required:!0}}},category:`contents`},ariaLabel:{type:`string`,name:`Aria-label for card`,description:`Tekst til skjermleser for aria-label på card. Settes automatisk til headingen, eller subheadingen der heading ikke eksisterer. Ved bruk av klikkbart card må heading alltid sendes inn da denne brukes som lenketekst.`,category:`accessibility`}},slots:{default:{description:`Innholdet i card`}}},a=class extends n.t{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=i.props.layout.default,this.heading=``,this.headinglevel=3,this.image={src:``,alt:``},this.imageShape=`square`,this.openLinkInNewTab=!1,this.padding=i.props.padding.default,this.skin=i.props.skin.default,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},i=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),a=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return e._`
|
|
2
2
|
<article
|
|
3
3
|
class=${t.t(n)}
|
|
4
4
|
aria-label=${r.t(this.clickCardLink?i:a)}
|
|
5
5
|
>
|
|
6
6
|
${this.renderImage()}
|
|
7
7
|
<div class="pkt-card__wrapper">
|
|
8
|
-
${this.tagPosition===`top`?this.renderTags():e.
|
|
8
|
+
${this.tagPosition===`top`?this.renderTags():e.h}
|
|
9
9
|
${this.renderHeader()}
|
|
10
10
|
${this.renderSlot()}
|
|
11
|
-
${this.tagPosition===`bottom`?this.renderTags():e.
|
|
11
|
+
${this.tagPosition===`bottom`?this.renderTags():e.h}
|
|
12
12
|
${this.renderMetadata()}
|
|
13
13
|
</div>
|
|
14
14
|
</article>
|
|
15
|
-
`}renderImage(){let n={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return e.
|
|
16
|
-
${this.image.src&&e.
|
|
15
|
+
`}renderImage(){let n={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return e._`
|
|
16
|
+
${this.image.src&&e._`
|
|
17
17
|
<div class=${t.t(n)}>
|
|
18
18
|
<img src=${this.image.src} alt=${this.image.alt||``} />
|
|
19
19
|
</div>
|
|
20
20
|
`}
|
|
21
|
-
`}renderHeading(){return e.
|
|
22
|
-
${this.heading&&!this.clickCardLink?e.
|
|
21
|
+
`}renderHeading(){return e._`
|
|
22
|
+
${this.heading&&!this.clickCardLink?e._`
|
|
23
23
|
<pkt-heading
|
|
24
24
|
class="pkt-card__heading"
|
|
25
25
|
.level=${this.headinglevel||3}
|
|
@@ -29,9 +29,9 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
29
29
|
>
|
|
30
30
|
${this.heading}
|
|
31
31
|
</pkt-heading>
|
|
32
|
-
`:e.
|
|
33
|
-
`}renderLinkHeading(){return e.
|
|
34
|
-
${this.clickCardLink?e.
|
|
32
|
+
`:e.h}
|
|
33
|
+
`}renderLinkHeading(){return e._`
|
|
34
|
+
${this.clickCardLink?e._`
|
|
35
35
|
<pkt-heading
|
|
36
36
|
class="pkt-card__link-heading pkt-card__heading"
|
|
37
37
|
.level=${this.headinglevel||3}
|
|
@@ -46,25 +46,25 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
46
46
|
>${this.heading}</a
|
|
47
47
|
>
|
|
48
48
|
</pkt-heading>
|
|
49
|
-
`:e.
|
|
50
|
-
`}renderSubheading(){return e.
|
|
51
|
-
${this.subheading?e.
|
|
52
|
-
`}renderHeader(){let t=!!this.heading||!!this.subheading;return e.
|
|
53
|
-
${t?e.
|
|
49
|
+
`:e.h}
|
|
50
|
+
`}renderSubheading(){return e._`
|
|
51
|
+
${this.subheading?e._` <p class="pkt-card__subheading ">${this.subheading}</p> `:e.h}
|
|
52
|
+
`}renderHeader(){let t=!!this.heading||!!this.subheading;return e._`
|
|
53
|
+
${t?e._`
|
|
54
54
|
<header class="pkt-card__header">
|
|
55
55
|
${this.renderHeading()}
|
|
56
56
|
${this.renderLinkHeading()}
|
|
57
57
|
${this.renderSubheading()}
|
|
58
58
|
</header>
|
|
59
|
-
`:e.
|
|
60
|
-
`}renderTags(){let n={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return e.
|
|
61
|
-
${this.tags.length>0?e.
|
|
59
|
+
`:e.h}
|
|
60
|
+
`}renderTags(){let n={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return e._`
|
|
61
|
+
${this.tags.length>0?e._`
|
|
62
62
|
<div
|
|
63
63
|
class=${t.t(n)}
|
|
64
64
|
role="list"
|
|
65
65
|
aria-label=${this.tags.length>1?`merkelapper`:`merkelapp`}
|
|
66
66
|
>
|
|
67
|
-
${this.tags.map(t=>e.
|
|
67
|
+
${this.tags.map(t=>e._`
|
|
68
68
|
<pkt-tag
|
|
69
69
|
role="listitem"
|
|
70
70
|
textStyle="normal-text"
|
|
@@ -76,12 +76,12 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
76
76
|
</pkt-tag>
|
|
77
77
|
`)}
|
|
78
78
|
</div>
|
|
79
|
-
`:e.
|
|
80
|
-
`}renderSlot(){return e.
|
|
81
|
-
${this.metaLead||this.metaTrail?e.
|
|
79
|
+
`:e.h}
|
|
80
|
+
`}renderSlot(){return e._`<section class="pkt-card__content">${n.n(this)}</section>`}renderMetadata(){return e._`
|
|
81
|
+
${this.metaLead||this.metaTrail?e._`
|
|
82
82
|
<footer class="pkt-card__metadata">
|
|
83
|
-
${this.metaLead?e.
|
|
84
|
-
${this.metaTrail?e.
|
|
83
|
+
${this.metaLead?e._`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:e.h}
|
|
84
|
+
${this.metaTrail?e._`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:e.h}
|
|
85
85
|
</footer>
|
|
86
|
-
`:e.
|
|
87
|
-
`}};e.n([e.
|
|
86
|
+
`:e.h}
|
|
87
|
+
`}};e.n([e.u({type:String})],a.prototype,`ariaLabel`,void 0),e.n([e.u({type:String})],a.prototype,`metaLead`,void 0),e.n([e.u({type:Boolean})],a.prototype,`borderOnHover`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`clickCardLink`,void 0),e.n([e.u({type:String})],a.prototype,`metaTrail`,void 0),e.n([e.u({type:String})],a.prototype,`layout`,void 0),e.n([e.u({type:String})],a.prototype,`heading`,void 0),e.n([e.u({type:Number})],a.prototype,`headinglevel`,void 0),e.n([e.u({type:Object})],a.prototype,`image`,void 0),e.n([e.u({type:String})],a.prototype,`imageShape`,void 0),e.n([e.u({type:Boolean})],a.prototype,`openLinkInNewTab`,void 0),e.n([e.u({type:String})],a.prototype,`padding`,void 0),e.n([e.u({type:String,converter:{fromAttribute:e=>{let t=i.props.skin.type;return e&&t.includes(e)?e:(e&&!t.includes(e)&&console.warn(`Invalid skin value "${e}". Using default skin "${i.props.skin.default}".`),i.props.skin.default)},toAttribute:e=>e}})],a.prototype,`skin`,void 0),e.n([e.u({type:String})],a.prototype,`subheading`,void 0),e.n([e.u({type:String})],a.prototype,`tagPosition`,void 0),e.n([e.u({type:Array})],a.prototype,`tags`,void 0);try{e.d(`pkt-card`)(a)}catch{console.warn(`Forsøker å definere <pkt-card>, 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}});
|