@oslokommune/punkt-elements 16.7.1 → 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 +35 -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 -6
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -6
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -79
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -6
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -6
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -6
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -6
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -6
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -6
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -10
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -855
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -6
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -6
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -6
- 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 -6
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -6
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -6
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -6
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -6
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -6
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -6
- 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 -6
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -6
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -6
- 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 -6
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -6
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -6
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -558
- 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/accordion/accordion.ts +6 -1
- package/src/components/accordion/accordionitem.ts +6 -1
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +12 -7
- package/src/components/backlink/backlink.ts +6 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
- package/src/components/button/button.ts +6 -1
- package/src/components/calendar/calendar.ts +6 -1
- package/src/components/card/card.ts +6 -1
- package/src/components/checkbox/checkbox.ts +6 -1
- package/src/components/combobox/combobox.ts +6 -1
- package/src/components/consent/consent.ts +6 -1
- package/src/components/datepicker/date-tags.ts +6 -1
- package/src/components/datepicker/datepicker-multiple.ts +6 -1
- package/src/components/datepicker/datepicker-popup.ts +6 -1
- package/src/components/datepicker/datepicker-range.ts +6 -1
- package/src/components/datepicker/datepicker-single.ts +6 -1
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/src/components/datepicker/datepicker.ts +6 -1
- package/src/components/header/header-service.ts +6 -1
- package/src/components/header/header-user-menu.ts +6 -1
- package/src/components/header/header.ts +6 -1
- package/src/components/heading/heading.ts +6 -1
- package/src/components/helptext/helptext.ts +6 -1
- package/src/components/icon/icon.ts +6 -1
- package/src/components/input-wrapper/input-wrapper.ts +6 -1
- package/src/components/link/link.ts +6 -1
- package/src/components/linkcard/linkcard.ts +6 -1
- package/src/components/listbox/listbox.ts +6 -1
- package/src/components/loader/loader.ts +6 -1
- package/src/components/messagebox/messagebox.ts +6 -1
- package/src/components/modal/modal.ts +6 -1
- package/src/components/progressbar/progressbar.ts +6 -1
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/select/select.ts +6 -1
- package/src/components/tabs/tabitem.ts +6 -1
- package/src/components/tabs/tabs.ts +6 -1
- package/src/components/tag/tag.ts +6 -1
- package/src/components/textarea/textarea.ts +6 -1
- package/src/components/textinput/textinput.ts +6 -1
- package/src/components/timepicker/timepicker.ts +6 -1
- package/dist/accordionitem-D1Agl1bB.cjs +0 -34
- package/dist/accordionitem-ZlaXvjt5.js +0 -138
- package/dist/alert-BuAXrnKl.js +0 -115
- package/dist/alert-DFkFNTxh.cjs +0 -33
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-EiAXUUZP.cjs +0 -13
- package/dist/backlink-V4DAt17e.js +0 -47
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-DEyvt1LI.js +0 -137
- package/dist/button-DYv5Dg4M.cjs +0 -27
- package/dist/calendar-HIE9nxcc.cjs +0 -90
- package/dist/calendar-S63oreVW.js +0 -2138
- package/dist/card-CyeH6l1c.cjs +0 -87
- package/dist/card-DDiLfuO4.js +0 -231
- package/dist/checkbox-BLlwTABj.cjs +0 -31
- package/dist/checkbox-ejBUa5qQ.js +0 -145
- 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-BmxSecfE.js +0 -818
- package/dist/combobox-Hb2V-fPX.cjs +0 -135
- package/dist/consent-iXyx5v6J.js +0 -173
- package/dist/consent-ruWAEVXW.cjs +0 -11
- package/dist/datepicker-CZl7b8Na.js +0 -1158
- package/dist/datepicker-D2H7U6MS.cjs +0 -273
- 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-CKt7cVn7.js +0 -101
- package/dist/heading-Cvz8m1xL.cjs +0 -1
- package/dist/helptext-5Mzp65-F.cjs +0 -24
- package/dist/helptext-jIoWRcCF.js +0 -80
- package/dist/icon-BlKA8YuW.js +0 -103
- package/dist/icon-Bqj9oBbl.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-B0MkQ0IZ.cjs +0 -54
- package/dist/input-wrapper-B2JpK016.js +0 -179
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-R_lNhViF.cjs +0 -7
- package/dist/link-Z_GizclR.js +0 -53
- package/dist/linkcard-BlQvdB1a.js +0 -54
- package/dist/linkcard-C7HbSLlX.cjs +0 -13
- package/dist/listbox-BQKDZvZn.js +0 -438
- package/dist/listbox-CGgV9MAe.cjs +0 -106
- package/dist/loader-Ci3CHU8k.js +0 -93
- package/dist/loader-e2gs_1xz.cjs +0 -16
- package/dist/messagebox-Bf-XMlvW.js +0 -69
- package/dist/messagebox-D67w71VX.cjs +0 -13
- package/dist/modal-CyvEkbfQ.cjs +0 -36
- package/dist/modal-DzGe1g8Z.js +0 -154
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-By7e0lEI.js +0 -162
- package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
- package/dist/radiobutton-6frNG9J_.js +0 -111
- package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
- 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-CXZt1nHS.js +0 -228
- package/dist/select-WFhS4Vfp.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-CB8wkKmv.js +0 -332
- package/dist/tabitem-DZpspU4Q.cjs +0 -65
- package/dist/tag-BuCpqaks.js +0 -115
- package/dist/tag-X6xdjR0N.cjs +0 -27
- package/dist/textarea-Bzuymclz.js +0 -131
- package/dist/textarea-DoeHJ7HR.cjs +0 -50
- package/dist/textinput-9lHjs4ce.js +0 -150
- package/dist/textinput-BNsLd26i.cjs +0 -70
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
package/dist/card-CyeH6l1c.cjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("./class-map-CsENJXf1.cjs"),h=require("./if-defined-BOW3ODSj.cjs"),t=require("./element-gR_VtSiD.cjs"),g=require("./element-with-slot-ZX-up7jO.cjs");require("./icon-Bqj9oBbl.cjs");require("./tag-X6xdjR0N.cjs");require("./heading-Cvz8m1xL.cjs");const c={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},p={props:c};var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(i,a,n,s)=>{for(var r=s>1?void 0:s?u(a,n):a,d=i.length-1,o;d>=0;d--)(o=i[d])&&(r=(s?o(a,n,r):o(r))||r);return s&&r&&k(a,n,r),r};exports.PktCard=class extends g.PktElementWithSlot{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=p.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=p.props.padding.default,this.skin=p.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var r,d;const a={"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},n=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),s=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return t.b`
|
|
2
|
-
<article
|
|
3
|
-
class=${l.e(a)}
|
|
4
|
-
aria-label=${h.o(this.clickCardLink?n:s)}
|
|
5
|
-
>
|
|
6
|
-
${this.renderImage()}
|
|
7
|
-
<div class="pkt-card__wrapper">
|
|
8
|
-
${this.tagPosition==="top"?this.renderTags():t.A}
|
|
9
|
-
${this.renderHeader()}
|
|
10
|
-
${this.renderSlot()}
|
|
11
|
-
${this.tagPosition==="bottom"?this.renderTags():t.A}
|
|
12
|
-
${this.renderMetadata()}
|
|
13
|
-
</div>
|
|
14
|
-
</article>
|
|
15
|
-
`}renderImage(){const a={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return t.b`
|
|
16
|
-
${this.image.src&&t.b`
|
|
17
|
-
<div class=${l.e(a)}>
|
|
18
|
-
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
19
|
-
</div>
|
|
20
|
-
`}
|
|
21
|
-
`}renderHeading(){return t.b`
|
|
22
|
-
${this.heading&&!this.clickCardLink?t.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
|
-
`:t.A}
|
|
33
|
-
`}renderLinkHeading(){return t.b`
|
|
34
|
-
${this.clickCardLink?t.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
|
-
`:t.A}
|
|
50
|
-
`}renderSubheading(){return t.b`
|
|
51
|
-
${this.subheading?t.b` <p class="pkt-card__subheading ">${this.subheading}</p> `:t.A}
|
|
52
|
-
`}renderHeader(){const a=!!this.heading||!!this.subheading;return t.b`
|
|
53
|
-
${a?t.b`
|
|
54
|
-
<header class="pkt-card__header">
|
|
55
|
-
${this.renderHeading()}
|
|
56
|
-
${this.renderLinkHeading()}
|
|
57
|
-
${this.renderSubheading()}
|
|
58
|
-
</header>
|
|
59
|
-
`:t.A}
|
|
60
|
-
`}renderTags(){const a={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return t.b`
|
|
61
|
-
${this.tags.length>0?t.b`
|
|
62
|
-
<div
|
|
63
|
-
class=${l.e(a)}
|
|
64
|
-
role="list"
|
|
65
|
-
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
66
|
-
>
|
|
67
|
-
${this.tags.map(n=>t.b`
|
|
68
|
-
<pkt-tag
|
|
69
|
-
role="listitem"
|
|
70
|
-
textStyle="normal-text"
|
|
71
|
-
size="medium"
|
|
72
|
-
skin=${h.o(n.skin)}
|
|
73
|
-
iconName=${h.o(n.iconName)}
|
|
74
|
-
>
|
|
75
|
-
<span>${n.text}</span>
|
|
76
|
-
</pkt-tag>
|
|
77
|
-
`)}
|
|
78
|
-
</div>
|
|
79
|
-
`:t.A}
|
|
80
|
-
`}renderSlot(){return t.b`<section class="pkt-card__content">${g.slotContent(this)}</section>`}renderMetadata(){return t.b`
|
|
81
|
-
${this.metaLead||this.metaTrail?t.b`
|
|
82
|
-
<footer class="pkt-card__metadata">
|
|
83
|
-
${this.metaLead?t.b`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:t.A}
|
|
84
|
-
${this.metaTrail?t.b`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:t.A}
|
|
85
|
-
</footer>
|
|
86
|
-
`:t.A}
|
|
87
|
-
`}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"metaLead",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"metaTrail",2);e([t.n({type:String})],exports.PktCard.prototype,"layout",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String,converter:{fromAttribute:i=>{const a=p.props.skin.type;return i&&a.includes(i)?i:(i&&!a.includes(i)&&console.warn(`Invalid skin value "${i}". Using default skin "${p.props.skin.default}".`),p.props.skin.default)},toAttribute:i=>i}})],exports.PktCard.prototype,"skin",2);e([t.n({type:String})],exports.PktCard.prototype,"subheading",2);e([t.n({type:String})],exports.PktCard.prototype,"tagPosition",2);e([t.n({type:Array})],exports.PktCard.prototype,"tags",2);exports.PktCard=e([t.t("pkt-card")],exports.PktCard);
|
package/dist/card-DDiLfuO4.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { e as c } from "./class-map-CEnykyO_.js";
|
|
2
|
-
import { o as k } from "./if-defined-B0krMLad.js";
|
|
3
|
-
import { A as d, b as e, n as r, t as u } from "./element-CPpT3rFQ.js";
|
|
4
|
-
import { P as m, s as $ } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
|
-
import "./icon-BlKA8YuW.js";
|
|
6
|
-
import "./tag-BuCpqaks.js";
|
|
7
|
-
import "./heading-CKt7cVn7.js";
|
|
8
|
-
const y = { layout: { default: "vertical" }, skin: { type: ["outlined", "outlined-beige", "gray", "blue", "beige", "green"], default: "outlined" }, padding: { default: "default" } }, o = {
|
|
9
|
-
props: y
|
|
10
|
-
};
|
|
11
|
-
var _ = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (t, s, l, p) => {
|
|
12
|
-
for (var n = p > 1 ? void 0 : p ? b(s, l) : s, h = t.length - 1, g; h >= 0; h--)
|
|
13
|
-
(g = t[h]) && (n = (p ? g(s, l, n) : g(n)) || n);
|
|
14
|
-
return p && n && _(s, l, n), n;
|
|
15
|
-
};
|
|
16
|
-
let a = class extends m {
|
|
17
|
-
constructor() {
|
|
18
|
-
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 = {
|
|
19
|
-
src: "",
|
|
20
|
-
alt: ""
|
|
21
|
-
}, 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 = [];
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
super.connectedCallback();
|
|
25
|
-
}
|
|
26
|
-
// Render methods
|
|
27
|
-
// Main render method
|
|
28
|
-
// prettier-ignore
|
|
29
|
-
render() {
|
|
30
|
-
var p, n;
|
|
31
|
-
const t = {
|
|
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
|
-
}, s = ((p = this.ariaLabel) == null ? void 0 : p.trim()) || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), l = ((n = this.ariaLabel) == null ? void 0 : n.trim()) || (this.heading ? this.heading : "kort");
|
|
38
|
-
return e`
|
|
39
|
-
<article
|
|
40
|
-
class=${c(t)}
|
|
41
|
-
aria-label=${k(this.clickCardLink ? s : l)}
|
|
42
|
-
>
|
|
43
|
-
${this.renderImage()}
|
|
44
|
-
<div class="pkt-card__wrapper">
|
|
45
|
-
${this.tagPosition === "top" ? this.renderTags() : d}
|
|
46
|
-
${this.renderHeader()}
|
|
47
|
-
${this.renderSlot()}
|
|
48
|
-
${this.tagPosition === "bottom" ? this.renderTags() : d}
|
|
49
|
-
${this.renderMetadata()}
|
|
50
|
-
</div>
|
|
51
|
-
</article>
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
// Render methods for different parts of the card
|
|
55
|
-
renderImage() {
|
|
56
|
-
const t = {
|
|
57
|
-
"pkt-card__image": !0,
|
|
58
|
-
[`pkt-card__image-${this.imageShape}`]: this.imageShape
|
|
59
|
-
};
|
|
60
|
-
return e`
|
|
61
|
-
${this.image.src && e`
|
|
62
|
-
<div class=${c(t)}>
|
|
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 e`
|
|
72
|
-
${this.heading && !this.clickCardLink ? e`
|
|
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
|
-
` : d}
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
renderLinkHeading() {
|
|
86
|
-
return e`
|
|
87
|
-
${this.clickCardLink ? e`
|
|
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
|
-
` : d}
|
|
103
|
-
`;
|
|
104
|
-
}
|
|
105
|
-
renderSubheading() {
|
|
106
|
-
return e`
|
|
107
|
-
${this.subheading ? e` <p class="pkt-card__subheading ">${this.subheading}</p> ` : d}
|
|
108
|
-
`;
|
|
109
|
-
}
|
|
110
|
-
// Render header
|
|
111
|
-
// prettier-ignore
|
|
112
|
-
renderHeader() {
|
|
113
|
-
const t = !!this.heading || !!this.subheading;
|
|
114
|
-
return e`
|
|
115
|
-
${t ? e`
|
|
116
|
-
<header class="pkt-card__header">
|
|
117
|
-
${this.renderHeading()}
|
|
118
|
-
${this.renderLinkHeading()}
|
|
119
|
-
${this.renderSubheading()}
|
|
120
|
-
</header>
|
|
121
|
-
` : d}
|
|
122
|
-
`;
|
|
123
|
-
}
|
|
124
|
-
renderTags() {
|
|
125
|
-
const t = {
|
|
126
|
-
"pkt-card__tags": !0,
|
|
127
|
-
[`pkt-card__tags-${this.tagPosition}`]: this.tagPosition
|
|
128
|
-
};
|
|
129
|
-
return e`
|
|
130
|
-
${this.tags.length > 0 ? e`
|
|
131
|
-
<div
|
|
132
|
-
class=${c(t)}
|
|
133
|
-
role="list"
|
|
134
|
-
aria-label=${this.tags.length > 1 ? "merkelapper" : "merkelapp"}
|
|
135
|
-
>
|
|
136
|
-
${this.tags.map(
|
|
137
|
-
(s) => e`
|
|
138
|
-
<pkt-tag
|
|
139
|
-
role="listitem"
|
|
140
|
-
textStyle="normal-text"
|
|
141
|
-
size="medium"
|
|
142
|
-
skin=${k(s.skin)}
|
|
143
|
-
iconName=${k(s.iconName)}
|
|
144
|
-
>
|
|
145
|
-
<span>${s.text}</span>
|
|
146
|
-
</pkt-tag>
|
|
147
|
-
`
|
|
148
|
-
)}
|
|
149
|
-
</div>
|
|
150
|
-
` : d}
|
|
151
|
-
`;
|
|
152
|
-
}
|
|
153
|
-
renderSlot() {
|
|
154
|
-
return e`<section class="pkt-card__content">${$(this)}</section>`;
|
|
155
|
-
}
|
|
156
|
-
renderMetadata() {
|
|
157
|
-
return e`
|
|
158
|
-
${this.metaLead || this.metaTrail ? e`
|
|
159
|
-
<footer class="pkt-card__metadata">
|
|
160
|
-
${this.metaLead ? e`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : d}
|
|
161
|
-
${this.metaTrail ? e`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : d}
|
|
162
|
-
</footer>
|
|
163
|
-
` : d}
|
|
164
|
-
`;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
i([
|
|
168
|
-
r({ type: String })
|
|
169
|
-
], a.prototype, "ariaLabel", 2);
|
|
170
|
-
i([
|
|
171
|
-
r({ type: String })
|
|
172
|
-
], a.prototype, "metaLead", 2);
|
|
173
|
-
i([
|
|
174
|
-
r({ type: Boolean })
|
|
175
|
-
], a.prototype, "borderOnHover", 2);
|
|
176
|
-
i([
|
|
177
|
-
r({ type: String, reflect: !0 })
|
|
178
|
-
], a.prototype, "clickCardLink", 2);
|
|
179
|
-
i([
|
|
180
|
-
r({ type: String })
|
|
181
|
-
], a.prototype, "metaTrail", 2);
|
|
182
|
-
i([
|
|
183
|
-
r({ type: String })
|
|
184
|
-
], a.prototype, "layout", 2);
|
|
185
|
-
i([
|
|
186
|
-
r({ type: String })
|
|
187
|
-
], a.prototype, "heading", 2);
|
|
188
|
-
i([
|
|
189
|
-
r({ type: Number })
|
|
190
|
-
], a.prototype, "headinglevel", 2);
|
|
191
|
-
i([
|
|
192
|
-
r({ type: Object })
|
|
193
|
-
], a.prototype, "image", 2);
|
|
194
|
-
i([
|
|
195
|
-
r({ type: String })
|
|
196
|
-
], a.prototype, "imageShape", 2);
|
|
197
|
-
i([
|
|
198
|
-
r({ type: Boolean })
|
|
199
|
-
], a.prototype, "openLinkInNewTab", 2);
|
|
200
|
-
i([
|
|
201
|
-
r({ type: String })
|
|
202
|
-
], a.prototype, "padding", 2);
|
|
203
|
-
i([
|
|
204
|
-
r({
|
|
205
|
-
type: String,
|
|
206
|
-
converter: {
|
|
207
|
-
fromAttribute: (t) => {
|
|
208
|
-
const s = o.props.skin.type;
|
|
209
|
-
return t && s.includes(t) ? t : (t && !s.includes(t) && console.warn(
|
|
210
|
-
`Invalid skin value "${t}". Using default skin "${o.props.skin.default}".`
|
|
211
|
-
), o.props.skin.default);
|
|
212
|
-
},
|
|
213
|
-
toAttribute: (t) => t
|
|
214
|
-
}
|
|
215
|
-
})
|
|
216
|
-
], a.prototype, "skin", 2);
|
|
217
|
-
i([
|
|
218
|
-
r({ type: String })
|
|
219
|
-
], a.prototype, "subheading", 2);
|
|
220
|
-
i([
|
|
221
|
-
r({ type: String })
|
|
222
|
-
], a.prototype, "tagPosition", 2);
|
|
223
|
-
i([
|
|
224
|
-
r({ type: Array })
|
|
225
|
-
], a.prototype, "tags", 2);
|
|
226
|
-
a = i([
|
|
227
|
-
u("pkt-card")
|
|
228
|
-
], a);
|
|
229
|
-
export {
|
|
230
|
-
a as P
|
|
231
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./element-gR_VtSiD.cjs"),o=require("./input-element-DdVhUvva.cjs"),r=require("./ref-CL-Xk9Xm.cjs"),p=require("./class-map-CsENJXf1.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.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,h,a){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,a)}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}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=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}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.b`
|
|
2
|
-
${this.tagText?t.b`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
|
-
${this.optionalTag?t.b`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
|
-
${this.requiredTag?t.b`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
5
|
-
`,n=()=>t.b`
|
|
6
|
-
<label class=${a} for=${this.id+"-internal"}>
|
|
7
|
-
${this.label} ${c()}
|
|
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"?n():t.A}
|
|
14
|
-
<input
|
|
15
|
-
id=${this.id+"-internal"}
|
|
16
|
-
class=${h}
|
|
17
|
-
type="checkbox"
|
|
18
|
-
?disabled=${this.disabled}
|
|
19
|
-
name=${this.name+"-internal"}
|
|
20
|
-
${r.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"?n():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 h=e.target;if(h&&h.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))}};i([t.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"value",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"checkHelptext",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"defaultChecked",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"hasTile",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"isSwitch",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"labelPosition",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"hideLabel",2);i([t.n({type:Boolean,reflect:!0})],exports.PktCheckbox.prototype,"checked",2);i([t.n({type:Boolean,reflect:!0})],exports.PktCheckbox.prototype,"indeterminate",2);i([t.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"type",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"tagText",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"optionalTag",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"optionalText",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"requiredTag",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"requiredText",2);exports.PktCheckbox=i([t.t("pkt-checkbox")],exports.PktCheckbox);
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { A as r, b as p, n as s, t as d } 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 u } from "./class-map-CEnykyO_.js";
|
|
5
|
-
var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (t, a, n, l) => {
|
|
6
|
-
for (var h = l > 1 ? void 0 : l ? m(a, n) : a, c = t.length - 1, o; c >= 0; c--)
|
|
7
|
-
(o = t[c]) && (h = (l ? o(a, n, h) : o(h)) || h);
|
|
8
|
-
return l && h && g(a, n, h), h;
|
|
9
|
-
};
|
|
10
|
-
let e = class 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(t, a, n) {
|
|
18
|
-
t === "defaultChecked" && !this.checked && (this.checked = this.defaultChecked), t === "checked" && (this.checked = this.checked === "" || this.checked === "true" || this.checked === !0, this.inputRef.value && (this.inputRef.value.checked = this.checked)), t === "indeterminate" && (this.indeterminate = this.indeterminate === "" || this.indeterminate === "true" || this.indeterminate === !0, this.inputRef.value && (this.inputRef.value.indeterminate = this.indeterminate)), super.attributeChangedCallback(t, a, n);
|
|
19
|
-
}
|
|
20
|
-
firstUpdated(t) {
|
|
21
|
-
t.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(t);
|
|
22
|
-
}
|
|
23
|
-
updated(t) {
|
|
24
|
-
t.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), t.has("checked") && this.inputRef.value && (this.inputRef.value.checked = this.checked === "" || this.checked === "true" || this.checked === !0), t.has("indeterminate") && this.inputRef.value && (this.inputRef.value.indeterminate = this.indeterminate === "" || this.indeterminate === "true" || this.indeterminate === !0), super.updated(t);
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
const t = u({
|
|
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
|
-
}), a = u({
|
|
32
|
-
"pkt-input-check__input-checkbox": !0,
|
|
33
|
-
"pkt-input-check__input-checkbox--error": this.hasError
|
|
34
|
-
}), n = u({
|
|
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
|
-
}), l = "pkt-tag pkt-tag--small pkt-tag--thin-text", h = () => p`
|
|
41
|
-
${this.tagText ? p`<span class=${l + " pkt-tag--gray"}>${this.tagText}</span>` : r}
|
|
42
|
-
${this.optionalTag ? p`<span class=${l + " pkt-tag--blue-light"}>${this.optionalText}</span>` : r}
|
|
43
|
-
${this.requiredTag ? p`<span class=${l + " pkt-tag--beige"}>${this.requiredText}</span>` : r}
|
|
44
|
-
`, c = () => p`
|
|
45
|
-
<label class=${n} for=${this.id + "-internal"}>
|
|
46
|
-
${this.label} ${h()}
|
|
47
|
-
${this.checkHelptext ? p`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : r}
|
|
48
|
-
</label>
|
|
49
|
-
`;
|
|
50
|
-
return p`
|
|
51
|
-
<div class="pkt-input-check">
|
|
52
|
-
<div class=${t}>
|
|
53
|
-
${this.labelPosition === "left" ? c() : r}
|
|
54
|
-
<input
|
|
55
|
-
id=${this.id + "-internal"}
|
|
56
|
-
class=${a}
|
|
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() : r}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
handleClick(t) {
|
|
74
|
-
if (this.disabled)
|
|
75
|
-
return t.preventDefault(), t.stopImmediatePropagation(), !1;
|
|
76
|
-
}
|
|
77
|
-
handleChange(t) {
|
|
78
|
-
if (this.disabled)
|
|
79
|
-
return t.preventDefault(), t.stopImmediatePropagation(), !1;
|
|
80
|
-
this.toggleChecked(t);
|
|
81
|
-
}
|
|
82
|
-
toggleChecked(t) {
|
|
83
|
-
if (this.disabled) {
|
|
84
|
-
t.preventDefault(), t.stopImmediatePropagation();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const a = t.target;
|
|
88
|
-
if (a && a.disabled) {
|
|
89
|
-
t.preventDefault(), t.stopImmediatePropagation();
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
t.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this.checked = this.inputRef.value.matches(":checked"), this.valueChecked(this.checked));
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
i([
|
|
96
|
-
s({ type: String, reflect: !0 })
|
|
97
|
-
], e.prototype, "value", 2);
|
|
98
|
-
i([
|
|
99
|
-
s({ type: String })
|
|
100
|
-
], e.prototype, "checkHelptext", 2);
|
|
101
|
-
i([
|
|
102
|
-
s({ type: Boolean })
|
|
103
|
-
], e.prototype, "defaultChecked", 2);
|
|
104
|
-
i([
|
|
105
|
-
s({ type: Boolean })
|
|
106
|
-
], e.prototype, "hasTile", 2);
|
|
107
|
-
i([
|
|
108
|
-
s({ type: Boolean })
|
|
109
|
-
], e.prototype, "isSwitch", 2);
|
|
110
|
-
i([
|
|
111
|
-
s({ type: String })
|
|
112
|
-
], e.prototype, "labelPosition", 2);
|
|
113
|
-
i([
|
|
114
|
-
s({ type: Boolean })
|
|
115
|
-
], e.prototype, "hideLabel", 2);
|
|
116
|
-
i([
|
|
117
|
-
s({ type: Boolean, reflect: !0 })
|
|
118
|
-
], e.prototype, "checked", 2);
|
|
119
|
-
i([
|
|
120
|
-
s({ type: Boolean, reflect: !0 })
|
|
121
|
-
], e.prototype, "indeterminate", 2);
|
|
122
|
-
i([
|
|
123
|
-
s({ type: String, reflect: !0 })
|
|
124
|
-
], e.prototype, "type", 2);
|
|
125
|
-
i([
|
|
126
|
-
s({ type: String })
|
|
127
|
-
], e.prototype, "tagText", 2);
|
|
128
|
-
i([
|
|
129
|
-
s({ type: Boolean })
|
|
130
|
-
], e.prototype, "optionalTag", 2);
|
|
131
|
-
i([
|
|
132
|
-
s({ type: String })
|
|
133
|
-
], e.prototype, "optionalText", 2);
|
|
134
|
-
i([
|
|
135
|
-
s({ type: Boolean })
|
|
136
|
-
], e.prototype, "requiredTag", 2);
|
|
137
|
-
i([
|
|
138
|
-
s({ type: String })
|
|
139
|
-
], e.prototype, "requiredText", 2);
|
|
140
|
-
e = i([
|
|
141
|
-
d("pkt-checkbox")
|
|
142
|
-
], e);
|
|
143
|
-
export {
|
|
144
|
-
e as P
|
|
145
|
-
};
|
|
@@ -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;
|