@oslokommune/punkt-elements 16.7.3 → 16.7.4
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-BB1JrONI.cjs +34 -0
- package/dist/accordion-nNH87Y60.js +130 -0
- package/dist/alert-BEEnTiCb.cjs +33 -0
- package/dist/alert-ePJuDtmm.js +171 -0
- package/dist/async-directive-B9P1Qa0k.cjs +1 -0
- package/dist/async-directive-CaQiqjyV.js +55 -0
- package/dist/backlink-Ba03LlbB.cjs +13 -0
- package/dist/backlink-CiwXrQYD.js +38 -0
- package/dist/booleanish-BmcOU-43.js +11 -0
- package/dist/booleanish-jJLlnr6-.cjs +1 -0
- package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
- package/dist/breadcrumbs-CpuVqWhF.js +76 -0
- package/dist/button-BIpd1xJh.js +95 -0
- package/dist/button-D-TOBaJB.cjs +27 -0
- package/dist/calendar-BzEtOJla.js +2031 -0
- package/dist/calendar-E5jJLt8D.cjs +90 -0
- package/dist/card-BYJu1MYm.js +339 -0
- package/dist/card-CUFhMVim.cjs +87 -0
- package/dist/checkbox-BARDb9iV.cjs +31 -0
- package/dist/checkbox-Cspxcvt_.js +111 -0
- package/dist/class-map-C8HuhNzZ.js +27 -0
- package/dist/class-map-CJ-msbHs.cjs +1 -0
- package/dist/classutils-DEL164Ur.js +7 -0
- package/dist/classutils-z8YsPlOf.cjs +1 -0
- package/dist/combobox-BcdLZRDU.js +984 -0
- package/dist/combobox-CGbFTWq_.cjs +135 -0
- package/dist/consent-DeB_5sWH.js +197 -0
- package/dist/consent-hwu7pp3S.cjs +11 -0
- package/dist/datepicker-DpmlsnH_.cjs +273 -0
- package/dist/datepicker-OVd8pmnZ.js +1125 -0
- package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
- package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
- package/dist/directive-3THFsVew.js +28 -0
- package/dist/directive-CJ2giQBZ.cjs +1 -0
- package/dist/directive-helpers-D1QSxY17.cjs +1 -0
- package/dist/directive-helpers-Dkv2gKgs.js +25 -0
- package/dist/element-DjtxO-1r.cjs +2 -0
- package/dist/element-cZ85T_aa.js +693 -0
- package/dist/element-with-slot-4J2o3SeU.js +166 -0
- package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
- package/dist/header-DWgPgGfS.cjs +304 -0
- package/dist/header-a6ztVNp3.js +782 -0
- package/dist/heading-BgSWIRii.cjs +1 -0
- package/dist/heading-DiQLPxdf.js +73 -0
- package/dist/helptext-CCBKKLus.js +65 -0
- package/dist/helptext-D-3QfZv5.cjs +24 -0
- package/dist/icon-Co72KtgF.js +86 -0
- package/dist/icon-Dr8sfT2X.cjs +1 -0
- package/dist/if-defined-Cjj8qN-Z.js +5 -0
- package/dist/if-defined-XKOD_t_V.cjs +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/input-element-B1yxcfz4.cjs +1 -0
- package/dist/input-element-Bw1s6NlF.js +643 -0
- package/dist/input-wrapper-BRuVELpK.cjs +54 -0
- package/dist/input-wrapper-CDyHTR1V.js +164 -0
- package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
- package/dist/input-wrapper-YfTmpSSY.js +117 -0
- package/dist/link-CKAFMz9j.js +89 -0
- package/dist/link-CyTCpI0k.cjs +7 -0
- package/dist/linkcard-B0KOGaGj.js +55 -0
- package/dist/linkcard-BE4-FewK.cjs +13 -0
- package/dist/listbox-DCA2JoPV.cjs +106 -0
- package/dist/listbox-DuBgTFvH.js +397 -0
- package/dist/loader-6kFZUErT.js +66 -0
- package/dist/loader-CX2rsC01.cjs +16 -0
- package/dist/messagebox-Cwlg5sOr.js +110 -0
- package/dist/messagebox-Din9X53b.cjs +13 -0
- package/dist/modal-C_wtsh9m.js +209 -0
- package/dist/modal-DS_wUOIv.cjs +36 -0
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -7
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +2 -5
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -5
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -81
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -5
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -5
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -5
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -5
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -5
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -5
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -9
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -861
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -5
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -5
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -5
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +30 -66
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -5
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -5
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -5
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -5
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -5
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -5
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -5
- package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
- package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -5
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -5
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -5
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +2 -5
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -5
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -5
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -560
- package/dist/progressbar-CdXtmOBb.cjs +17 -0
- package/dist/progressbar-Dy9AiYQz.js +113 -0
- package/dist/radiobutton-GOnpUbCW.cjs +31 -0
- package/dist/radiobutton-V_KPbup_.js +84 -0
- package/dist/ref-BaJ0mBT_.cjs +1 -0
- package/dist/ref-RS8Uv6uC.js +30 -0
- package/dist/repeat-Cepr3469.js +57 -0
- package/dist/repeat-CqcDYBxr.cjs +1 -0
- package/dist/select-BSAFd8Wa.js +164 -0
- package/dist/select-C2i8sOk5.cjs +49 -0
- package/dist/tabs-D8nL9rWx.cjs +37 -0
- package/dist/tabs-Y7utmJi9.js +318 -0
- package/dist/tag-DLthw5b4.cjs +27 -0
- package/dist/tag-VwykmuQR.js +179 -0
- package/dist/textarea-D7aGOyDf.cjs +46 -0
- package/dist/textarea-DYOBhJrN.js +115 -0
- package/dist/textinput-BUgntXnM.js +124 -0
- package/dist/textinput-DFh8_9cx.cjs +70 -0
- package/dist/timepicker-BIfE7KKJ.cjs +191 -0
- package/dist/timepicker-DaSwn1FA.js +503 -0
- package/dist/utils-CUqCKGvp.js +7 -0
- package/dist/utils-CjAbIttF.cjs +1 -0
- package/package.json +6 -6
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +6 -6
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/dist/accordionitem-_9AiCIvd.cjs +0 -34
- package/dist/accordionitem-dCfSrxh5.js +0 -140
- package/dist/alert-BtOk8yRH.cjs +0 -33
- package/dist/alert-DlY2_grU.js +0 -117
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-Ce5Vldop.js +0 -49
- package/dist/backlink-y3dwjKPC.cjs +0 -13
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-B_TXwNzt.cjs +0 -27
- package/dist/button-BiY-wlKF.js +0 -139
- package/dist/calendar-B2pji2zn.cjs +0 -90
- package/dist/calendar-DhjQDC4C.js +0 -2140
- package/dist/card-BwMNB5Bb.cjs +0 -87
- package/dist/card-CGlmcMSR.js +0 -233
- package/dist/checkbox-BsJZYA26.js +0 -147
- package/dist/checkbox-CTY8f_qn.cjs +0 -31
- package/dist/class-map-CEnykyO_.js +0 -34
- package/dist/class-map-CsENJXf1.cjs +0 -5
- package/dist/classutils-BwNK82ZQ.cjs +0 -1
- package/dist/classutils-RQs1k6D9.js +0 -7
- package/dist/combobox-DSB5WOxg.js +0 -815
- package/dist/combobox-DbICIgKG.cjs +0 -135
- package/dist/consent-DkOQpbsg.cjs +0 -11
- package/dist/consent-SNWV_mMU.js +0 -175
- package/dist/datepicker-BEWl9iz3.cjs +0 -273
- package/dist/datepicker-euHyzXnb.js +0 -1170
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
- package/dist/directive-C7oCP5Bh.cjs +0 -5
- package/dist/directive-helpers-BP2WOx60.cjs +0 -5
- package/dist/directive-helpers-rm-28gIj.js +0 -38
- package/dist/directive-oAbCiebi.js +0 -27
- package/dist/element-CPpT3rFQ.js +0 -638
- package/dist/element-gR_VtSiD.cjs +0 -27
- package/dist/element-with-slot-Dqk6-TRR.js +0 -240
- package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
- package/dist/heading-D2tVS6lS.js +0 -103
- package/dist/heading-DrzbgDb6.cjs +0 -1
- package/dist/helptext-BKtU4mas.js +0 -82
- package/dist/helptext-DcRC7wW2.cjs +0 -24
- package/dist/icon-CxQcIa5F.js +0 -105
- package/dist/icon-q81vqPK_.cjs +0 -9
- package/dist/if-defined-B0krMLad.js +0 -10
- package/dist/if-defined-BOW3ODSj.cjs +0 -5
- package/dist/input-element-8nLwuQS4.js +0 -837
- package/dist/input-element-DdVhUvva.cjs +0 -1
- package/dist/input-wrapper-Bs4CRNst.js +0 -181
- package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-C0rl-86s.cjs +0 -7
- package/dist/link-Cdqgl60z.js +0 -55
- package/dist/linkcard-Dimu7Rlx.cjs +0 -13
- package/dist/linkcard-Lbq_UhjZ.js +0 -56
- package/dist/listbox-Bia4_tvN.js +0 -440
- package/dist/listbox-La2GZQei.cjs +0 -106
- package/dist/loader-D1ugDXGV.cjs +0 -16
- package/dist/loader-DyN6RGC5.js +0 -95
- package/dist/messagebox-BGMVm2t9.js +0 -71
- package/dist/messagebox-M0yIgCz9.cjs +0 -13
- package/dist/modal-CMO1RtIi.cjs +0 -36
- package/dist/modal-DjPQDE-Z.js +0 -156
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-BqlMzkM_.cjs +0 -21
- package/dist/progressbar-sbHDFC12.js +0 -162
- package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
- package/dist/radiobutton-D8Ai8ETa.js +0 -113
- package/dist/ref-Bg_Swj5w.js +0 -42
- package/dist/ref-CL-Xk9Xm.cjs +0 -5
- package/dist/repeat-BD8TKgJb.js +0 -61
- package/dist/repeat-Cfq8CDlf.cjs +0 -5
- package/dist/select-De-n8on9.js +0 -230
- package/dist/select-dTWibR6_.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-B9-jeV97.js +0 -334
- package/dist/tabitem-BnhzqfW3.cjs +0 -65
- package/dist/tag-CbwO8yvD.cjs +0 -27
- package/dist/tag-D4FI5t3y.js +0 -117
- package/dist/textarea-BmLaKzsc.cjs +0 -50
- package/dist/textarea-CMiSJaYL.js +0 -133
- package/dist/textinput-em9y4yrL.cjs +0 -70
- package/dist/textinput-r8udK0IX.js +0 -152
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
package/dist/card-BwMNB5Bb.cjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";const p=require("./class-map-CsENJXf1.cjs"),l=require("./if-defined-BOW3ODSj.cjs"),e=require("./element-gR_VtSiD.cjs"),c=require("./element-with-slot-ZX-up7jO.cjs");require("./icon-q81vqPK_.cjs");require("./tag-CbwO8yvD.cjs");require("./heading-DrzbgDb6.cjs");const k={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},o={props:k};var u=Object.defineProperty,a=(i,r,s,h)=>{for(var n=void 0,d=i.length-1,g;d>=0;d--)(g=i[d])&&(n=g(r,s,n)||n);return n&&u(r,s,n),n};class t extends c.PktElementWithSlot{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=o.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=o.props.padding.default,this.skin=o.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var n,d;const r={"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},s=((n=this.ariaLabel)==null?void 0:n.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),h=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return e.b`
|
|
2
|
-
<article
|
|
3
|
-
class=${p.e(r)}
|
|
4
|
-
aria-label=${l.o(this.clickCardLink?s:h)}
|
|
5
|
-
>
|
|
6
|
-
${this.renderImage()}
|
|
7
|
-
<div class="pkt-card__wrapper">
|
|
8
|
-
${this.tagPosition==="top"?this.renderTags():e.A}
|
|
9
|
-
${this.renderHeader()}
|
|
10
|
-
${this.renderSlot()}
|
|
11
|
-
${this.tagPosition==="bottom"?this.renderTags():e.A}
|
|
12
|
-
${this.renderMetadata()}
|
|
13
|
-
</div>
|
|
14
|
-
</article>
|
|
15
|
-
`}renderImage(){const r={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return e.b`
|
|
16
|
-
${this.image.src&&e.b`
|
|
17
|
-
<div class=${p.e(r)}>
|
|
18
|
-
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
19
|
-
</div>
|
|
20
|
-
`}
|
|
21
|
-
`}renderHeading(){return e.b`
|
|
22
|
-
${this.heading&&!this.clickCardLink?e.b`
|
|
23
|
-
<pkt-heading
|
|
24
|
-
class="pkt-card__heading"
|
|
25
|
-
.level=${this.headinglevel||3}
|
|
26
|
-
size="medium"
|
|
27
|
-
nospacing
|
|
28
|
-
weight="regular"
|
|
29
|
-
>
|
|
30
|
-
${this.heading}
|
|
31
|
-
</pkt-heading>
|
|
32
|
-
`:e.A}
|
|
33
|
-
`}renderLinkHeading(){return e.b`
|
|
34
|
-
${this.clickCardLink?e.b`
|
|
35
|
-
<pkt-heading
|
|
36
|
-
class="pkt-card__link-heading pkt-card__heading"
|
|
37
|
-
.level=${this.headinglevel||3}
|
|
38
|
-
size="medium"
|
|
39
|
-
weight="regular"
|
|
40
|
-
nospacing
|
|
41
|
-
>
|
|
42
|
-
<a
|
|
43
|
-
class="pkt-card__link"
|
|
44
|
-
href=${this.clickCardLink}
|
|
45
|
-
target=${this.openLinkInNewTab?"_blank":"_self"}
|
|
46
|
-
>${this.heading}</a
|
|
47
|
-
>
|
|
48
|
-
</pkt-heading>
|
|
49
|
-
`:e.A}
|
|
50
|
-
`}renderSubheading(){return e.b`
|
|
51
|
-
${this.subheading?e.b` <p class="pkt-card__subheading ">${this.subheading}</p> `:e.A}
|
|
52
|
-
`}renderHeader(){const r=!!this.heading||!!this.subheading;return e.b`
|
|
53
|
-
${r?e.b`
|
|
54
|
-
<header class="pkt-card__header">
|
|
55
|
-
${this.renderHeading()}
|
|
56
|
-
${this.renderLinkHeading()}
|
|
57
|
-
${this.renderSubheading()}
|
|
58
|
-
</header>
|
|
59
|
-
`:e.A}
|
|
60
|
-
`}renderTags(){const r={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return e.b`
|
|
61
|
-
${this.tags.length>0?e.b`
|
|
62
|
-
<div
|
|
63
|
-
class=${p.e(r)}
|
|
64
|
-
role="list"
|
|
65
|
-
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
66
|
-
>
|
|
67
|
-
${this.tags.map(s=>e.b`
|
|
68
|
-
<pkt-tag
|
|
69
|
-
role="listitem"
|
|
70
|
-
textStyle="normal-text"
|
|
71
|
-
size="medium"
|
|
72
|
-
skin=${l.o(s.skin)}
|
|
73
|
-
iconName=${l.o(s.iconName)}
|
|
74
|
-
>
|
|
75
|
-
<span>${s.text}</span>
|
|
76
|
-
</pkt-tag>
|
|
77
|
-
`)}
|
|
78
|
-
</div>
|
|
79
|
-
`:e.A}
|
|
80
|
-
`}renderSlot(){return e.b`<section class="pkt-card__content">${c.slotContent(this)}</section>`}renderMetadata(){return e.b`
|
|
81
|
-
${this.metaLead||this.metaTrail?e.b`
|
|
82
|
-
<footer class="pkt-card__metadata">
|
|
83
|
-
${this.metaLead?e.b`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:e.A}
|
|
84
|
-
${this.metaTrail?e.b`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:e.A}
|
|
85
|
-
</footer>
|
|
86
|
-
`:e.A}
|
|
87
|
-
`}}a([e.n({type:String})],t.prototype,"ariaLabel");a([e.n({type:String})],t.prototype,"metaLead");a([e.n({type:Boolean})],t.prototype,"borderOnHover");a([e.n({type:String,reflect:!0})],t.prototype,"clickCardLink");a([e.n({type:String})],t.prototype,"metaTrail");a([e.n({type:String})],t.prototype,"layout");a([e.n({type:String})],t.prototype,"heading");a([e.n({type:Number})],t.prototype,"headinglevel");a([e.n({type:Object})],t.prototype,"image");a([e.n({type:String})],t.prototype,"imageShape");a([e.n({type:Boolean})],t.prototype,"openLinkInNewTab");a([e.n({type:String})],t.prototype,"padding");a([e.n({type:String,converter:{fromAttribute:i=>{const r=o.props.skin.type;return i&&r.includes(i)?i:(i&&!r.includes(i)&&console.warn(`Invalid skin value "${i}". Using default skin "${o.props.skin.default}".`),o.props.skin.default)},toAttribute:i=>i}})],t.prototype,"skin");a([e.n({type:String})],t.prototype,"subheading");a([e.n({type:String})],t.prototype,"tagPosition");a([e.n({type:Array})],t.prototype,"tags");try{e.t("pkt-card")(t)}catch{console.warn("Forsøker å definere <pkt-card>, men den er allerede definert")}exports.PktCard=t;
|
package/dist/card-CGlmcMSR.js
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { e as h } from "./class-map-CEnykyO_.js";
|
|
2
|
-
import { o as g } from "./if-defined-B0krMLad.js";
|
|
3
|
-
import { t as m, A as n, b as t, n as a } from "./element-CPpT3rFQ.js";
|
|
4
|
-
import { P as u, s as $ } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
|
-
import "./icon-CxQcIa5F.js";
|
|
6
|
-
import "./tag-D4FI5t3y.js";
|
|
7
|
-
import "./heading-D2tVS6lS.js";
|
|
8
|
-
const y = { layout: { default: "vertical" }, skin: { type: ["outlined", "outlined-beige", "gray", "blue", "beige", "green"], default: "outlined" }, padding: { default: "default" } }, l = {
|
|
9
|
-
props: y
|
|
10
|
-
};
|
|
11
|
-
var b = Object.defineProperty, i = (r, s, p, c) => {
|
|
12
|
-
for (var d = void 0, o = r.length - 1, k; o >= 0; o--)
|
|
13
|
-
(k = r[o]) && (d = k(s, p, d) || d);
|
|
14
|
-
return d && b(s, p, d), d;
|
|
15
|
-
};
|
|
16
|
-
class e extends u {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments), this.ariaLabel = "", this.metaLead = null, this.borderOnHover = !0, this.clickCardLink = null, this.metaTrail = null, this.layout = l.props.layout.default, this.heading = "", this.headinglevel = 3, this.image = {
|
|
19
|
-
src: "",
|
|
20
|
-
alt: ""
|
|
21
|
-
}, this.imageShape = "square", this.openLinkInNewTab = !1, this.padding = l.props.padding.default, this.skin = l.props.skin.default, this.subheading = "", this.tagPosition = "top", this.tags = [];
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
super.connectedCallback();
|
|
25
|
-
}
|
|
26
|
-
// Render methods
|
|
27
|
-
// Main render method
|
|
28
|
-
// prettier-ignore
|
|
29
|
-
render() {
|
|
30
|
-
var d, o;
|
|
31
|
-
const s = {
|
|
32
|
-
"pkt-card": !0,
|
|
33
|
-
[`pkt-card--${this.skin}`]: this.skin,
|
|
34
|
-
[`pkt-card--${this.layout}`]: this.layout,
|
|
35
|
-
[`pkt-card--padding-${this.padding}`]: this.padding,
|
|
36
|
-
"pkt-card--border-on-hover": this.borderOnHover
|
|
37
|
-
}, p = ((d = this.ariaLabel) == null ? void 0 : d.trim()) || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), c = ((o = this.ariaLabel) == null ? void 0 : o.trim()) || (this.heading ? this.heading : "kort");
|
|
38
|
-
return t`
|
|
39
|
-
<article
|
|
40
|
-
class=${h(s)}
|
|
41
|
-
aria-label=${g(this.clickCardLink ? p : c)}
|
|
42
|
-
>
|
|
43
|
-
${this.renderImage()}
|
|
44
|
-
<div class="pkt-card__wrapper">
|
|
45
|
-
${this.tagPosition === "top" ? this.renderTags() : n}
|
|
46
|
-
${this.renderHeader()}
|
|
47
|
-
${this.renderSlot()}
|
|
48
|
-
${this.tagPosition === "bottom" ? this.renderTags() : n}
|
|
49
|
-
${this.renderMetadata()}
|
|
50
|
-
</div>
|
|
51
|
-
</article>
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
// Render methods for different parts of the card
|
|
55
|
-
renderImage() {
|
|
56
|
-
const s = {
|
|
57
|
-
"pkt-card__image": !0,
|
|
58
|
-
[`pkt-card__image-${this.imageShape}`]: this.imageShape
|
|
59
|
-
};
|
|
60
|
-
return t`
|
|
61
|
-
${this.image.src && t`
|
|
62
|
-
<div class=${h(s)}>
|
|
63
|
-
<img src=${this.image.src} alt=${this.image.alt || ""} />
|
|
64
|
-
</div>
|
|
65
|
-
`}
|
|
66
|
-
`;
|
|
67
|
-
}
|
|
68
|
-
// Do not render heading if link is present, render link heading instead
|
|
69
|
-
// Combine the rendering for headings into a renderHeader method
|
|
70
|
-
renderHeading() {
|
|
71
|
-
return t`
|
|
72
|
-
${this.heading && !this.clickCardLink ? t`
|
|
73
|
-
<pkt-heading
|
|
74
|
-
class="pkt-card__heading"
|
|
75
|
-
.level=${this.headinglevel || 3}
|
|
76
|
-
size="medium"
|
|
77
|
-
nospacing
|
|
78
|
-
weight="regular"
|
|
79
|
-
>
|
|
80
|
-
${this.heading}
|
|
81
|
-
</pkt-heading>
|
|
82
|
-
` : n}
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
renderLinkHeading() {
|
|
86
|
-
return t`
|
|
87
|
-
${this.clickCardLink ? t`
|
|
88
|
-
<pkt-heading
|
|
89
|
-
class="pkt-card__link-heading pkt-card__heading"
|
|
90
|
-
.level=${this.headinglevel || 3}
|
|
91
|
-
size="medium"
|
|
92
|
-
weight="regular"
|
|
93
|
-
nospacing
|
|
94
|
-
>
|
|
95
|
-
<a
|
|
96
|
-
class="pkt-card__link"
|
|
97
|
-
href=${this.clickCardLink}
|
|
98
|
-
target=${this.openLinkInNewTab ? "_blank" : "_self"}
|
|
99
|
-
>${this.heading}</a
|
|
100
|
-
>
|
|
101
|
-
</pkt-heading>
|
|
102
|
-
` : n}
|
|
103
|
-
`;
|
|
104
|
-
}
|
|
105
|
-
renderSubheading() {
|
|
106
|
-
return t`
|
|
107
|
-
${this.subheading ? t` <p class="pkt-card__subheading ">${this.subheading}</p> ` : n}
|
|
108
|
-
`;
|
|
109
|
-
}
|
|
110
|
-
// Render header
|
|
111
|
-
// prettier-ignore
|
|
112
|
-
renderHeader() {
|
|
113
|
-
const s = !!this.heading || !!this.subheading;
|
|
114
|
-
return t`
|
|
115
|
-
${s ? t`
|
|
116
|
-
<header class="pkt-card__header">
|
|
117
|
-
${this.renderHeading()}
|
|
118
|
-
${this.renderLinkHeading()}
|
|
119
|
-
${this.renderSubheading()}
|
|
120
|
-
</header>
|
|
121
|
-
` : n}
|
|
122
|
-
`;
|
|
123
|
-
}
|
|
124
|
-
renderTags() {
|
|
125
|
-
const s = {
|
|
126
|
-
"pkt-card__tags": !0,
|
|
127
|
-
[`pkt-card__tags-${this.tagPosition}`]: this.tagPosition
|
|
128
|
-
};
|
|
129
|
-
return t`
|
|
130
|
-
${this.tags.length > 0 ? t`
|
|
131
|
-
<div
|
|
132
|
-
class=${h(s)}
|
|
133
|
-
role="list"
|
|
134
|
-
aria-label=${this.tags.length > 1 ? "merkelapper" : "merkelapp"}
|
|
135
|
-
>
|
|
136
|
-
${this.tags.map(
|
|
137
|
-
(p) => t`
|
|
138
|
-
<pkt-tag
|
|
139
|
-
role="listitem"
|
|
140
|
-
textStyle="normal-text"
|
|
141
|
-
size="medium"
|
|
142
|
-
skin=${g(p.skin)}
|
|
143
|
-
iconName=${g(p.iconName)}
|
|
144
|
-
>
|
|
145
|
-
<span>${p.text}</span>
|
|
146
|
-
</pkt-tag>
|
|
147
|
-
`
|
|
148
|
-
)}
|
|
149
|
-
</div>
|
|
150
|
-
` : n}
|
|
151
|
-
`;
|
|
152
|
-
}
|
|
153
|
-
renderSlot() {
|
|
154
|
-
return t`<section class="pkt-card__content">${$(this)}</section>`;
|
|
155
|
-
}
|
|
156
|
-
renderMetadata() {
|
|
157
|
-
return t`
|
|
158
|
-
${this.metaLead || this.metaTrail ? t`
|
|
159
|
-
<footer class="pkt-card__metadata">
|
|
160
|
-
${this.metaLead ? t`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : n}
|
|
161
|
-
${this.metaTrail ? t`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : n}
|
|
162
|
-
</footer>
|
|
163
|
-
` : n}
|
|
164
|
-
`;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
i([
|
|
168
|
-
a({ type: String })
|
|
169
|
-
], e.prototype, "ariaLabel");
|
|
170
|
-
i([
|
|
171
|
-
a({ type: String })
|
|
172
|
-
], e.prototype, "metaLead");
|
|
173
|
-
i([
|
|
174
|
-
a({ type: Boolean })
|
|
175
|
-
], e.prototype, "borderOnHover");
|
|
176
|
-
i([
|
|
177
|
-
a({ type: String, reflect: !0 })
|
|
178
|
-
], e.prototype, "clickCardLink");
|
|
179
|
-
i([
|
|
180
|
-
a({ type: String })
|
|
181
|
-
], e.prototype, "metaTrail");
|
|
182
|
-
i([
|
|
183
|
-
a({ type: String })
|
|
184
|
-
], e.prototype, "layout");
|
|
185
|
-
i([
|
|
186
|
-
a({ type: String })
|
|
187
|
-
], e.prototype, "heading");
|
|
188
|
-
i([
|
|
189
|
-
a({ type: Number })
|
|
190
|
-
], e.prototype, "headinglevel");
|
|
191
|
-
i([
|
|
192
|
-
a({ type: Object })
|
|
193
|
-
], e.prototype, "image");
|
|
194
|
-
i([
|
|
195
|
-
a({ type: String })
|
|
196
|
-
], e.prototype, "imageShape");
|
|
197
|
-
i([
|
|
198
|
-
a({ type: Boolean })
|
|
199
|
-
], e.prototype, "openLinkInNewTab");
|
|
200
|
-
i([
|
|
201
|
-
a({ type: String })
|
|
202
|
-
], e.prototype, "padding");
|
|
203
|
-
i([
|
|
204
|
-
a({
|
|
205
|
-
type: String,
|
|
206
|
-
converter: {
|
|
207
|
-
fromAttribute: (r) => {
|
|
208
|
-
const s = l.props.skin.type;
|
|
209
|
-
return r && s.includes(r) ? r : (r && !s.includes(r) && console.warn(
|
|
210
|
-
`Invalid skin value "${r}". Using default skin "${l.props.skin.default}".`
|
|
211
|
-
), l.props.skin.default);
|
|
212
|
-
},
|
|
213
|
-
toAttribute: (r) => r
|
|
214
|
-
}
|
|
215
|
-
})
|
|
216
|
-
], e.prototype, "skin");
|
|
217
|
-
i([
|
|
218
|
-
a({ type: String })
|
|
219
|
-
], e.prototype, "subheading");
|
|
220
|
-
i([
|
|
221
|
-
a({ type: String })
|
|
222
|
-
], e.prototype, "tagPosition");
|
|
223
|
-
i([
|
|
224
|
-
a({ type: Array })
|
|
225
|
-
], e.prototype, "tags");
|
|
226
|
-
try {
|
|
227
|
-
m("pkt-card")(e);
|
|
228
|
-
} catch {
|
|
229
|
-
console.warn("Forsøker å definere <pkt-card>, men den er allerede definert");
|
|
230
|
-
}
|
|
231
|
-
export {
|
|
232
|
-
e as P
|
|
233
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { t as u, A as l, b as n, n as i } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { P as k } from "./input-element-8nLwuQS4.js";
|
|
3
|
-
import { e as f, n as b } from "./ref-Bg_Swj5w.js";
|
|
4
|
-
import { e as o } from "./class-map-CEnykyO_.js";
|
|
5
|
-
var g = Object.defineProperty, s = (r, e, h, d) => {
|
|
6
|
-
for (var a = void 0, p = r.length - 1, c; p >= 0; p--)
|
|
7
|
-
(c = r[p]) && (a = c(e, h, a) || a);
|
|
8
|
-
return a && g(e, h, a), a;
|
|
9
|
-
};
|
|
10
|
-
class t extends k {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this.inputRef = f(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.isSwitch = !1, this.labelPosition = "right", this.hideLabel = !1, this.checked = null, this.indeterminate = !1, this.type = "checkbox", this.tagText = null, this.optionalTag = !1, this.optionalText = "Valgfritt", this.requiredTag = !1, this.requiredText = "Må fylles ut";
|
|
13
|
-
}
|
|
14
|
-
connectedCallback() {
|
|
15
|
-
super.connectedCallback();
|
|
16
|
-
}
|
|
17
|
-
attributeChangedCallback(e, h, d) {
|
|
18
|
-
e === "defaultChecked" && !this.checked && (this.checked = this.defaultChecked), e === "checked" && (this.checked = this.checked === "" || this.checked === "true" || this.checked === !0, this.inputRef.value && (this.inputRef.value.checked = this.checked)), e === "indeterminate" && (this.indeterminate = this.indeterminate === "" || this.indeterminate === "true" || this.indeterminate === !0, this.inputRef.value && (this.inputRef.value.indeterminate = this.indeterminate)), super.attributeChangedCallback(e, h, d);
|
|
19
|
-
}
|
|
20
|
-
firstUpdated(e) {
|
|
21
|
-
e.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), this.inputRef.value && (this.inputRef.value.indeterminate = this.indeterminate === "" || this.indeterminate === "true" || this.indeterminate === !0), super.firstUpdated(e);
|
|
22
|
-
}
|
|
23
|
-
updated(e) {
|
|
24
|
-
e.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), e.has("checked") && this.inputRef.value && (this.inputRef.value.checked = this.checked === "" || this.checked === "true" || this.checked === !0), e.has("indeterminate") && this.inputRef.value && (this.inputRef.value.indeterminate = this.indeterminate === "" || this.indeterminate === "true" || this.indeterminate === !0), super.updated(e);
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
const e = o({
|
|
28
|
-
"pkt-input-check__input": !0,
|
|
29
|
-
"pkt-input-check__input--tile": this.hasTile,
|
|
30
|
-
"pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
|
|
31
|
-
}), h = o({
|
|
32
|
-
"pkt-input-check__input-checkbox": !0,
|
|
33
|
-
"pkt-input-check__input-checkbox--error": this.hasError
|
|
34
|
-
}), d = o({
|
|
35
|
-
"pkt-input-check__input-label": !0,
|
|
36
|
-
"pkt-input-check__input-label--disabled": this.disabled,
|
|
37
|
-
"pkt-input-check__input-label--left": this.labelPosition === "left",
|
|
38
|
-
"pkt-input-check__input-label--right": this.labelPosition === "right",
|
|
39
|
-
"pkt-sr-only": this.hideLabel
|
|
40
|
-
}), a = "pkt-tag pkt-tag--small pkt-tag--thin-text", p = () => n`
|
|
41
|
-
${this.tagText ? n`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : l}
|
|
42
|
-
${this.optionalTag ? n`<span class=${a + " pkt-tag--blue-light"}>${this.optionalText}</span>` : l}
|
|
43
|
-
${this.requiredTag ? n`<span class=${a + " pkt-tag--beige"}>${this.requiredText}</span>` : l}
|
|
44
|
-
`, c = () => n`
|
|
45
|
-
<label class=${d} for=${this.id + "-internal"}>
|
|
46
|
-
${this.label} ${p()}
|
|
47
|
-
${this.checkHelptext ? n`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : l}
|
|
48
|
-
</label>
|
|
49
|
-
`;
|
|
50
|
-
return n`
|
|
51
|
-
<div class="pkt-input-check">
|
|
52
|
-
<div class=${e}>
|
|
53
|
-
${this.labelPosition === "left" ? c() : l}
|
|
54
|
-
<input
|
|
55
|
-
id=${this.id + "-internal"}
|
|
56
|
-
class=${h}
|
|
57
|
-
type="checkbox"
|
|
58
|
-
?disabled=${this.disabled}
|
|
59
|
-
name=${this.name + "-internal"}
|
|
60
|
-
${b(this.inputRef)}
|
|
61
|
-
@change=${this.handleChange}
|
|
62
|
-
@click=${this.handleClick}
|
|
63
|
-
@blur=${this.onBlur}
|
|
64
|
-
@focus=${this.onFocus}
|
|
65
|
-
?checked=${this.checked}
|
|
66
|
-
role=${this.isSwitch ? "switch" : "checkbox"}
|
|
67
|
-
/>
|
|
68
|
-
${this.labelPosition === "right" ? c() : l}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
handleClick(e) {
|
|
74
|
-
if (this.disabled)
|
|
75
|
-
return e.preventDefault(), e.stopImmediatePropagation(), !1;
|
|
76
|
-
}
|
|
77
|
-
handleChange(e) {
|
|
78
|
-
if (this.disabled)
|
|
79
|
-
return e.preventDefault(), e.stopImmediatePropagation(), !1;
|
|
80
|
-
this.toggleChecked(e);
|
|
81
|
-
}
|
|
82
|
-
toggleChecked(e) {
|
|
83
|
-
if (this.disabled) {
|
|
84
|
-
e.preventDefault(), e.stopImmediatePropagation();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const h = e.target;
|
|
88
|
-
if (h && h.disabled) {
|
|
89
|
-
e.preventDefault(), e.stopImmediatePropagation();
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this.checked = this.inputRef.value.matches(":checked"), this.valueChecked(this.checked));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
s([
|
|
96
|
-
i({ type: String, reflect: !0 })
|
|
97
|
-
], t.prototype, "value");
|
|
98
|
-
s([
|
|
99
|
-
i({ type: String })
|
|
100
|
-
], t.prototype, "checkHelptext");
|
|
101
|
-
s([
|
|
102
|
-
i({ type: Boolean })
|
|
103
|
-
], t.prototype, "defaultChecked");
|
|
104
|
-
s([
|
|
105
|
-
i({ type: Boolean })
|
|
106
|
-
], t.prototype, "hasTile");
|
|
107
|
-
s([
|
|
108
|
-
i({ type: Boolean })
|
|
109
|
-
], t.prototype, "isSwitch");
|
|
110
|
-
s([
|
|
111
|
-
i({ type: String })
|
|
112
|
-
], t.prototype, "labelPosition");
|
|
113
|
-
s([
|
|
114
|
-
i({ type: Boolean })
|
|
115
|
-
], t.prototype, "hideLabel");
|
|
116
|
-
s([
|
|
117
|
-
i({ type: Boolean, reflect: !0 })
|
|
118
|
-
], t.prototype, "checked");
|
|
119
|
-
s([
|
|
120
|
-
i({ type: Boolean, reflect: !0 })
|
|
121
|
-
], t.prototype, "indeterminate");
|
|
122
|
-
s([
|
|
123
|
-
i({ type: String, reflect: !0 })
|
|
124
|
-
], t.prototype, "type");
|
|
125
|
-
s([
|
|
126
|
-
i({ type: String })
|
|
127
|
-
], t.prototype, "tagText");
|
|
128
|
-
s([
|
|
129
|
-
i({ type: Boolean })
|
|
130
|
-
], t.prototype, "optionalTag");
|
|
131
|
-
s([
|
|
132
|
-
i({ type: String })
|
|
133
|
-
], t.prototype, "optionalText");
|
|
134
|
-
s([
|
|
135
|
-
i({ type: Boolean })
|
|
136
|
-
], t.prototype, "requiredTag");
|
|
137
|
-
s([
|
|
138
|
-
i({ type: String })
|
|
139
|
-
], t.prototype, "requiredText");
|
|
140
|
-
try {
|
|
141
|
-
u("pkt-checkbox")(t);
|
|
142
|
-
} catch {
|
|
143
|
-
console.warn("Forsøker å definere <pkt-checkbox>, men den er allerede definert");
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
t as P
|
|
147
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./element-gR_VtSiD.cjs"),u=require("./input-element-DdVhUvva.cjs"),d=require("./ref-CL-Xk9Xm.cjs"),p=require("./class-map-CsENJXf1.cjs");var o=Object.defineProperty,s=(c,e,n,r)=>{for(var a=void 0,h=c.length-1,l;h>=0;h--)(l=c[h])&&(a=l(e,n,a)||a);return a&&o(e,n,a),a};class i extends u.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,n,r){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,n,r)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),n=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),r=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),a="pkt-tag pkt-tag--small pkt-tag--thin-text",h=()=>t.b`
|
|
2
|
-
${this.tagText?t.b`<span class=${a+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
|
-
${this.optionalTag?t.b`<span class=${a+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
|
-
${this.requiredTag?t.b`<span class=${a+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
5
|
-
`,l=()=>t.b`
|
|
6
|
-
<label class=${r} for=${this.id+"-internal"}>
|
|
7
|
-
${this.label} ${h()}
|
|
8
|
-
${this.checkHelptext?t.b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:t.A}
|
|
9
|
-
</label>
|
|
10
|
-
`;return t.b`
|
|
11
|
-
<div class="pkt-input-check">
|
|
12
|
-
<div class=${e}>
|
|
13
|
-
${this.labelPosition==="left"?l():t.A}
|
|
14
|
-
<input
|
|
15
|
-
id=${this.id+"-internal"}
|
|
16
|
-
class=${n}
|
|
17
|
-
type="checkbox"
|
|
18
|
-
?disabled=${this.disabled}
|
|
19
|
-
name=${this.name+"-internal"}
|
|
20
|
-
${d.n(this.inputRef)}
|
|
21
|
-
@change=${this.handleChange}
|
|
22
|
-
@click=${this.handleClick}
|
|
23
|
-
@blur=${this.onBlur}
|
|
24
|
-
@focus=${this.onFocus}
|
|
25
|
-
?checked=${this.checked}
|
|
26
|
-
role=${this.isSwitch?"switch":"checkbox"}
|
|
27
|
-
/>
|
|
28
|
-
${this.labelPosition==="right"?l():t.A}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
`}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const n=e.target;if(n&&n.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}}s([t.n({type:String,reflect:!0})],i.prototype,"value");s([t.n({type:String})],i.prototype,"checkHelptext");s([t.n({type:Boolean})],i.prototype,"defaultChecked");s([t.n({type:Boolean})],i.prototype,"hasTile");s([t.n({type:Boolean})],i.prototype,"isSwitch");s([t.n({type:String})],i.prototype,"labelPosition");s([t.n({type:Boolean})],i.prototype,"hideLabel");s([t.n({type:Boolean,reflect:!0})],i.prototype,"checked");s([t.n({type:Boolean,reflect:!0})],i.prototype,"indeterminate");s([t.n({type:String,reflect:!0})],i.prototype,"type");s([t.n({type:String})],i.prototype,"tagText");s([t.n({type:Boolean})],i.prototype,"optionalTag");s([t.n({type:String})],i.prototype,"optionalText");s([t.n({type:Boolean})],i.prototype,"requiredTag");s([t.n({type:String})],i.prototype,"requiredText");try{t.t("pkt-checkbox")(i)}catch{console.warn("Forsøker å definere <pkt-checkbox>, men den er allerede definert")}exports.PktCheckbox=i;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { E as a } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { e as h, i as d, t as c } from "./directive-oAbCiebi.js";
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2018 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
const u = h(class extends d {
|
|
9
|
-
constructor(s) {
|
|
10
|
-
var e;
|
|
11
|
-
if (super(s), s.type !== c.ATTRIBUTE || s.name !== "class" || ((e = s.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
12
|
-
}
|
|
13
|
-
render(s) {
|
|
14
|
-
return " " + Object.keys(s).filter((e) => s[e]).join(" ") + " ";
|
|
15
|
-
}
|
|
16
|
-
update(s, [e]) {
|
|
17
|
-
var n, i;
|
|
18
|
-
if (this.st === void 0) {
|
|
19
|
-
this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter((t) => t !== "")));
|
|
20
|
-
for (const t in e) e[t] && !((n = this.nt) != null && n.has(t)) && this.st.add(t);
|
|
21
|
-
return this.render(e);
|
|
22
|
-
}
|
|
23
|
-
const r = s.element.classList;
|
|
24
|
-
for (const t of this.st) t in e || (r.remove(t), this.st.delete(t));
|
|
25
|
-
for (const t in e) {
|
|
26
|
-
const o = !!e[t];
|
|
27
|
-
o === this.st.has(t) || (i = this.nt) != null && i.has(t) || (o ? (r.add(t), this.st.add(t)) : (r.remove(t), this.st.delete(t)));
|
|
28
|
-
}
|
|
29
|
-
return a;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
export {
|
|
33
|
-
u as e
|
|
34
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./element-gR_VtSiD.cjs"),r=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2018 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const c=r.e(class extends r.i{constructor(s){var e;if(super(s),s.type!==r.t.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var i,o;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>t!=="")));for(const t in e)e[t]&&!((i=this.nt)!=null&&i.has(t))&&this.st.add(t);return this.render(e)}const n=s.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const h=!!e[t];h===this.st.has(t)||(o=this.nt)!=null&&o.has(t)||(h?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return a.E}});exports.e=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function a(s,e,i){const r=s.getAttribute("class")||"",t=new Set(r.split(/\s+/).filter(Boolean));i?t.add(e):t.delete(e),s.setAttribute("class",Array.from(t).join(" "))}exports.updateClassAttribute=a;
|