@oslokommune/punkt-elements 16.7.3 → 16.7.7
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 -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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./element-gR_VtSiD.cjs"),Ct=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs"),xt=require("./element-with-slot-ZX-up7jO.cjs");var lt={},ct;function It(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,S=new WeakMap,g=new WeakMap,A=new WeakMap,V=new WeakMap,C=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&B(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?B(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=A.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),S.has(h)&&S.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const W={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},B=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const wt=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},_=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class H extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");_.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=_.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=_.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function St(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new H(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});A.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=C.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function At(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=H,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new H(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&B(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(C.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,W):d.observe(o,W),S.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,W),typeof HTMLFormElement<"u"&&St(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(At()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}It();var Rt=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&Rt(a,n,u),u};const dt="on",U="--checked",D=",";class l extends xt.PktElementWithSlot{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=Ct.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,S,g,A,V,C,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(S=a.validity)!=null&&S.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(A=a.validity)!=null&&A.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(C=this.max)==null?void 0:C.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a),this.validate();return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { P as x, s as y } from "./element-with-slot-Dqk6-TRR.js";
|
|
2
|
-
import { o as m } from "./if-defined-B0krMLad.js";
|
|
3
|
-
import { t as k, A as i, b as o, n as e } from "./element-CPpT3rFQ.js";
|
|
4
|
-
import { o as w } from "./icon-CxQcIa5F.js";
|
|
5
|
-
import { e as v } from "./class-map-CEnykyO_.js";
|
|
6
|
-
import { u as T } from "./utils-DznhwRXm.js";
|
|
7
|
-
import { b as E } from "./booleanish-C9R0tdXH.js";
|
|
8
|
-
import { s as p } from "./input-wrapper-CDgenrYA.js";
|
|
9
|
-
import "./helptext-BKtU4mas.js";
|
|
10
|
-
import "./alert-DlY2_grU.js";
|
|
11
|
-
var D = Object.defineProperty, r = (h, l, a, d) => {
|
|
12
|
-
for (var s = void 0, n = h.length - 1, u; n >= 0; n--)
|
|
13
|
-
(u = h[n]) && (s = u(l, a, s) || s);
|
|
14
|
-
return s && D(l, a, s), s;
|
|
15
|
-
};
|
|
16
|
-
class t extends x {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments), this.forId = T(), this.label = "", this.helptext = null, this.helptextDropdown = null, this.helptextDropdownButton = null, this.counter = p.props.counter.default, this.counterCurrent = 0, this.counterMaxLength = 0, this.counterError = null, this.counterPosition = "bottom", this.optionalTag = p.props.optionalTag.default, this.optionalText = p.props.optionalText.default, this.requiredTag = p.props.requiredTag.default, this.requiredText = p.props.requiredText.default, this.tagText = null, this.hasError = p.props.hasError.default, this.errorMessage = "", this.disabled = p.props.disabled.default, this.inline = p.props.inline.default, this.ariaDescribedby = void 0, this.hasFieldset = p.props.hasFieldset.default, this.role = "group", this.useWrapper = p.props.useWrapper.default;
|
|
19
|
-
}
|
|
20
|
-
updated(l) {
|
|
21
|
-
super.updated(l);
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
const l = {
|
|
25
|
-
"pkt-inputwrapper": !0,
|
|
26
|
-
"pkt-inputwrapper--error": this.hasError,
|
|
27
|
-
"pkt-inputwrapper--disabled": this.disabled,
|
|
28
|
-
"pkt-inputwrapper--inline": this.inline
|
|
29
|
-
}, a = "pkt-tag pkt-tag--small pkt-tag--thin-text", d = this.ariaDescribedby ? this.ariaDescribedby : this.helptext ? `${this.forId}-helptext` : i, s = () => o`
|
|
30
|
-
${this.tagText ? o`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : i}
|
|
31
|
-
${this.optionalTag ? o`<span class=${a + " pkt-tag--blue-light"}>${this.optionalText}</span>` : i}
|
|
32
|
-
${this.requiredTag ? o`<span class=${a + " pkt-tag--beige"}>${this.requiredText}</span>` : i}
|
|
33
|
-
`, n = () => this.useWrapper ? this.hasFieldset ? o`<legend
|
|
34
|
-
class="pkt-inputwrapper__legend"
|
|
35
|
-
id="${this.forId}-label"
|
|
36
|
-
@click=${this.handleLabelClick}
|
|
37
|
-
>
|
|
38
|
-
${this.label} ${s()}
|
|
39
|
-
</legend>` : o`<label
|
|
40
|
-
class="pkt-inputwrapper__label"
|
|
41
|
-
for="${this.forId}"
|
|
42
|
-
aria-describedby="${d}"
|
|
43
|
-
id="${this.forId}-label"
|
|
44
|
-
@click=${this.handleLabelClick}
|
|
45
|
-
>${this.label}${s()}</label
|
|
46
|
-
>` : o`<label
|
|
47
|
-
for="${this.forId}"
|
|
48
|
-
class="pkt-sr-only"
|
|
49
|
-
aria-describedby="${d}"
|
|
50
|
-
id="${this.forId}-label"
|
|
51
|
-
>
|
|
52
|
-
${this.label}
|
|
53
|
-
</label>`, u = () => o`
|
|
54
|
-
<pkt-helptext
|
|
55
|
-
class="${m(this.useWrapper ? void 0 : "pkt-hide")}"
|
|
56
|
-
.forId=${this.forId}
|
|
57
|
-
.helptext=${this.helptext}
|
|
58
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
59
|
-
.helptextDropdownButton=${this.helptextDropdownButton || p.props.helptextDropdownButton.default}
|
|
60
|
-
@toggleHelpText=${($) => {
|
|
61
|
-
this.toggleDropdown($);
|
|
62
|
-
}}
|
|
63
|
-
>${y(this, "helptext")}</pkt-helptext>
|
|
64
|
-
`, c = () => this.counter ? o`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
65
|
-
${this.counterError ? this.counterError : i} ${this.counterCurrent || 0}
|
|
66
|
-
${this.counterMaxLength ? `/${this.counterMaxLength}` : i}
|
|
67
|
-
</div>` : i, b = () => this.hasError && this.errorMessage ? o`<pkt-alert
|
|
68
|
-
skin="error"
|
|
69
|
-
compact
|
|
70
|
-
id=${`${this.forId}-error`}
|
|
71
|
-
aria-live="assertive"
|
|
72
|
-
aria-atomic="true"
|
|
73
|
-
>
|
|
74
|
-
${w(this.errorMessage)}
|
|
75
|
-
</pkt-alert>` : i, g = () => o`
|
|
76
|
-
${n()}
|
|
77
|
-
${u()}
|
|
78
|
-
${this.counterPosition === "top" ? c() : i}
|
|
79
|
-
<div class="pkt-contents">${y(this)}</div>
|
|
80
|
-
${this.counterPosition === "bottom" ? c() : i}
|
|
81
|
-
${b()}
|
|
82
|
-
`, f = () => this.hasFieldset ? o`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${d}">
|
|
83
|
-
${g()}
|
|
84
|
-
</fieldset>` : o`<div class="pkt-inputwrapper__fieldset">${g()}</div>`;
|
|
85
|
-
return o`<div class=${v(l)}>${f()}</div> `;
|
|
86
|
-
}
|
|
87
|
-
toggleDropdown(l) {
|
|
88
|
-
this.dispatchEvent(
|
|
89
|
-
new CustomEvent("toggleHelpText", {
|
|
90
|
-
bubbles: !1,
|
|
91
|
-
detail: { isOpen: l.detail.isOpen }
|
|
92
|
-
})
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
handleLabelClick() {
|
|
96
|
-
this.dispatchEvent(
|
|
97
|
-
new CustomEvent("labelClick", {
|
|
98
|
-
bubbles: !0,
|
|
99
|
-
composed: !0,
|
|
100
|
-
detail: "label clicked"
|
|
101
|
-
})
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
r([
|
|
106
|
-
e({ type: String })
|
|
107
|
-
], t.prototype, "forId");
|
|
108
|
-
r([
|
|
109
|
-
e({ type: String })
|
|
110
|
-
], t.prototype, "label");
|
|
111
|
-
r([
|
|
112
|
-
e({ type: String })
|
|
113
|
-
], t.prototype, "helptext");
|
|
114
|
-
r([
|
|
115
|
-
e({ type: String })
|
|
116
|
-
], t.prototype, "helptextDropdown");
|
|
117
|
-
r([
|
|
118
|
-
e({ type: String })
|
|
119
|
-
], t.prototype, "helptextDropdownButton");
|
|
120
|
-
r([
|
|
121
|
-
e({ type: Boolean })
|
|
122
|
-
], t.prototype, "counter");
|
|
123
|
-
r([
|
|
124
|
-
e({ type: Number })
|
|
125
|
-
], t.prototype, "counterCurrent");
|
|
126
|
-
r([
|
|
127
|
-
e({ type: Number })
|
|
128
|
-
], t.prototype, "counterMaxLength");
|
|
129
|
-
r([
|
|
130
|
-
e({ type: String })
|
|
131
|
-
], t.prototype, "counterError");
|
|
132
|
-
r([
|
|
133
|
-
e({ type: String, reflect: !1 })
|
|
134
|
-
], t.prototype, "counterPosition");
|
|
135
|
-
r([
|
|
136
|
-
e({ type: Boolean })
|
|
137
|
-
], t.prototype, "optionalTag");
|
|
138
|
-
r([
|
|
139
|
-
e({ type: String })
|
|
140
|
-
], t.prototype, "optionalText");
|
|
141
|
-
r([
|
|
142
|
-
e({ type: Boolean })
|
|
143
|
-
], t.prototype, "requiredTag");
|
|
144
|
-
r([
|
|
145
|
-
e({ type: String })
|
|
146
|
-
], t.prototype, "requiredText");
|
|
147
|
-
r([
|
|
148
|
-
e({ type: String })
|
|
149
|
-
], t.prototype, "tagText");
|
|
150
|
-
r([
|
|
151
|
-
e({ type: Boolean })
|
|
152
|
-
], t.prototype, "hasError");
|
|
153
|
-
r([
|
|
154
|
-
e({ type: String })
|
|
155
|
-
], t.prototype, "errorMessage");
|
|
156
|
-
r([
|
|
157
|
-
e({ type: Boolean })
|
|
158
|
-
], t.prototype, "disabled");
|
|
159
|
-
r([
|
|
160
|
-
e({ type: Boolean })
|
|
161
|
-
], t.prototype, "inline");
|
|
162
|
-
r([
|
|
163
|
-
e({ type: String })
|
|
164
|
-
], t.prototype, "ariaDescribedby");
|
|
165
|
-
r([
|
|
166
|
-
e({ type: Boolean })
|
|
167
|
-
], t.prototype, "hasFieldset");
|
|
168
|
-
r([
|
|
169
|
-
e({ type: String, reflect: !0 })
|
|
170
|
-
], t.prototype, "role");
|
|
171
|
-
r([
|
|
172
|
-
e({ type: Boolean, reflect: !0, converter: E })
|
|
173
|
-
], t.prototype, "useWrapper");
|
|
174
|
-
try {
|
|
175
|
-
k("pkt-input-wrapper")(t);
|
|
176
|
-
} catch {
|
|
177
|
-
console.warn("Forsøker å definere <pkt-input-wrapper>, men den er allerede definert");
|
|
178
|
-
}
|
|
179
|
-
export {
|
|
180
|
-
t as P
|
|
181
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./element-with-slot-ZX-up7jO.cjs"),$=require("./if-defined-BOW3ODSj.cjs"),e=require("./element-gR_VtSiD.cjs"),f=require("./icon-q81vqPK_.cjs"),x=require("./class-map-CsENJXf1.cjs"),k=require("./utils-byXsEz1u.cjs"),w=require("./booleanish-BKVonob4.cjs"),s=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-DcRC7wW2.cjs");require("./alert-BtOk8yRH.cjs");var v=Object.defineProperty,r=(l,o,i,a)=>{for(var p=void 0,n=l.length-1,u;n>=0;n--)(u=l[n])&&(p=u(o,i,p)||p);return p&&v(o,i,p),p};class t extends h.PktElementWithSlot{constructor(){super(...arguments),this.forId=k.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=s.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=s.specs.props.optionalTag.default,this.optionalText=s.specs.props.optionalText.default,this.requiredTag=s.specs.props.requiredTag.default,this.requiredText=s.specs.props.requiredText.default,this.tagText=null,this.hasError=s.specs.props.hasError.default,this.errorMessage="",this.disabled=s.specs.props.disabled.default,this.inline=s.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=s.specs.props.hasFieldset.default,this.role="group",this.useWrapper=s.specs.props.useWrapper.default}updated(o){super.updated(o)}render(){const o={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},i="pkt-tag pkt-tag--small pkt-tag--thin-text",a=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:e.A,p=()=>e.b`
|
|
2
|
-
${this.tagText?e.b`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:e.A}
|
|
3
|
-
${this.optionalTag?e.b`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:e.A}
|
|
4
|
-
${this.requiredTag?e.b`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:e.A}
|
|
5
|
-
`,n=()=>this.useWrapper?this.hasFieldset?e.b`<legend
|
|
6
|
-
class="pkt-inputwrapper__legend"
|
|
7
|
-
id="${this.forId}-label"
|
|
8
|
-
@click=${this.handleLabelClick}
|
|
9
|
-
>
|
|
10
|
-
${this.label} ${p()}
|
|
11
|
-
</legend>`:e.b`<label
|
|
12
|
-
class="pkt-inputwrapper__label"
|
|
13
|
-
for="${this.forId}"
|
|
14
|
-
aria-describedby="${a}"
|
|
15
|
-
id="${this.forId}-label"
|
|
16
|
-
@click=${this.handleLabelClick}
|
|
17
|
-
>${this.label}${p()}</label
|
|
18
|
-
>`:e.b`<label
|
|
19
|
-
for="${this.forId}"
|
|
20
|
-
class="pkt-sr-only"
|
|
21
|
-
aria-describedby="${a}"
|
|
22
|
-
id="${this.forId}-label"
|
|
23
|
-
>
|
|
24
|
-
${this.label}
|
|
25
|
-
</label>`,u=()=>e.b`
|
|
26
|
-
<pkt-helptext
|
|
27
|
-
class="${$.o(this.useWrapper?void 0:"pkt-hide")}"
|
|
28
|
-
.forId=${this.forId}
|
|
29
|
-
.helptext=${this.helptext}
|
|
30
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
31
|
-
.helptextDropdownButton=${this.helptextDropdownButton||s.specs.props.helptextDropdownButton.default}
|
|
32
|
-
@toggleHelpText=${y=>{this.toggleDropdown(y)}}
|
|
33
|
-
>${h.slotContent(this,"helptext")}</pkt-helptext>
|
|
34
|
-
`,d=()=>this.counter?e.b`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
35
|
-
${this.counterError?this.counterError:e.A} ${this.counterCurrent||0}
|
|
36
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:e.A}
|
|
37
|
-
</div>`:e.A,b=()=>this.hasError&&this.errorMessage?e.b`<pkt-alert
|
|
38
|
-
skin="error"
|
|
39
|
-
compact
|
|
40
|
-
id=${`${this.forId}-error`}
|
|
41
|
-
aria-live="assertive"
|
|
42
|
-
aria-atomic="true"
|
|
43
|
-
>
|
|
44
|
-
${f.o(this.errorMessage)}
|
|
45
|
-
</pkt-alert>`:e.A,c=()=>e.b`
|
|
46
|
-
${n()}
|
|
47
|
-
${u()}
|
|
48
|
-
${this.counterPosition==="top"?d():e.A}
|
|
49
|
-
<div class="pkt-contents">${h.slotContent(this)}</div>
|
|
50
|
-
${this.counterPosition==="bottom"?d():e.A}
|
|
51
|
-
${b()}
|
|
52
|
-
`,g=()=>this.hasFieldset?e.b`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${a}">
|
|
53
|
-
${c()}
|
|
54
|
-
</fieldset>`:e.b`<div class="pkt-inputwrapper__fieldset">${c()}</div>`;return e.b`<div class=${x.e(o)}>${g()}</div> `}toggleDropdown(o){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:o.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}}r([e.n({type:String})],t.prototype,"forId");r([e.n({type:String})],t.prototype,"label");r([e.n({type:String})],t.prototype,"helptext");r([e.n({type:String})],t.prototype,"helptextDropdown");r([e.n({type:String})],t.prototype,"helptextDropdownButton");r([e.n({type:Boolean})],t.prototype,"counter");r([e.n({type:Number})],t.prototype,"counterCurrent");r([e.n({type:Number})],t.prototype,"counterMaxLength");r([e.n({type:String})],t.prototype,"counterError");r([e.n({type:String,reflect:!1})],t.prototype,"counterPosition");r([e.n({type:Boolean})],t.prototype,"optionalTag");r([e.n({type:String})],t.prototype,"optionalText");r([e.n({type:Boolean})],t.prototype,"requiredTag");r([e.n({type:String})],t.prototype,"requiredText");r([e.n({type:String})],t.prototype,"tagText");r([e.n({type:Boolean})],t.prototype,"hasError");r([e.n({type:String})],t.prototype,"errorMessage");r([e.n({type:Boolean})],t.prototype,"disabled");r([e.n({type:Boolean})],t.prototype,"inline");r([e.n({type:String})],t.prototype,"ariaDescribedby");r([e.n({type:Boolean})],t.prototype,"hasFieldset");r([e.n({type:String,reflect:!0})],t.prototype,"role");r([e.n({type:Boolean,reflect:!0,converter:w.booleanishConverter})],t.prototype,"useWrapper");try{e.t("pkt-input-wrapper")(t)}catch{console.warn("Forsøker å definere <pkt-input-wrapper>, men den er allerede definert")}exports.PktInputWrapper=t;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const e = { helptextDropdownButton: { default: "Les mer <span class='pkt-sr-only'>om feltet</span>" }, counter: { default: !1 }, optionalTag: { default: !1 }, optionalText: { default: "Valgfritt" }, requiredTag: { default: !1 }, requiredText: { default: "Må fylles ut" }, hasError: { default: !1 }, disabled: { default: !1 }, inline: { default: !1 }, hasFieldset: { default: !1 }, useWrapper: { default: !0 } }, a = {
|
|
2
|
-
props: e
|
|
3
|
-
};
|
|
4
|
-
export {
|
|
5
|
-
a as s
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},t={props:e};exports.specs=t;
|
package/dist/link-C0rl-86s.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./element-with-slot-ZX-up7jO.cjs"),e=require("./element-gR_VtSiD.cjs"),h=require("./class-map-CsENJXf1.cjs");require("./icon-q81vqPK_.cjs");const f={href:{default:"#"},target:{default:"_self"}},p={props:f};var k=Object.defineProperty,n=(i,o,l,u)=>{for(var r=void 0,s=i.length-1,a;s>=0;s--)(a=i[s])&&(r=a(o,l,r)||r);return r&&k(o,l,r),r};class t extends c.PktElementWithSlot{constructor(){super(...arguments),this.href=p.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=p.props.target.default}render(){const o={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return e.b`<a
|
|
2
|
-
class=${h.e(o)}
|
|
3
|
-
href=${this.href}
|
|
4
|
-
.target=${this.target}
|
|
5
|
-
.rel=${this.external?"noopener noreferrer":e.A}
|
|
6
|
-
>${this.iconName?e.b`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span>${c.slotContent(this)}</span></a
|
|
7
|
-
>`}}n([e.n({type:String,reflect:!0})],t.prototype,"href");n([e.n({type:String,reflect:!0})],t.prototype,"iconName");n([e.n({type:String,reflect:!0})],t.prototype,"iconPosition");n([e.n({type:Boolean,reflect:!0})],t.prototype,"external");n([e.n({type:String,reflect:!0})],t.prototype,"target");try{e.t("pkt-link")(t)}catch{console.warn("Forsøker å definere <pkt-link>, men den er allerede definert")}exports.PktLink=t;
|
package/dist/link-Cdqgl60z.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { P as f, s as h } from "./element-with-slot-Dqk6-TRR.js";
|
|
2
|
-
import { t as k, A as m, b as l, n as r } from "./element-CPpT3rFQ.js";
|
|
3
|
-
import { e as u } from "./class-map-CEnykyO_.js";
|
|
4
|
-
import "./icon-CxQcIa5F.js";
|
|
5
|
-
const d = { href: { default: "#" }, target: { default: "_self" } }, c = {
|
|
6
|
-
props: d
|
|
7
|
-
};
|
|
8
|
-
var g = Object.defineProperty, i = (n, o, a, y) => {
|
|
9
|
-
for (var t = void 0, s = n.length - 1, p; s >= 0; s--)
|
|
10
|
-
(p = n[s]) && (t = p(o, a, t) || t);
|
|
11
|
-
return t && g(o, a, t), t;
|
|
12
|
-
};
|
|
13
|
-
class e extends f {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments), this.href = c.props.href.default, this.iconName = void 0, this.iconPosition = void 0, this.external = !1, this.target = c.props.target.default;
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
const o = {
|
|
19
|
-
"pkt-link": !0,
|
|
20
|
-
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
21
|
-
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
22
|
-
"pkt-link--external": this.external
|
|
23
|
-
};
|
|
24
|
-
return l`<a
|
|
25
|
-
class=${u(o)}
|
|
26
|
-
href=${this.href}
|
|
27
|
-
.target=${this.target}
|
|
28
|
-
.rel=${this.external ? "noopener noreferrer" : m}
|
|
29
|
-
>${this.iconName ? l`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span>${h(this)}</span></a
|
|
30
|
-
>`;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
i([
|
|
34
|
-
r({ type: String, reflect: !0 })
|
|
35
|
-
], e.prototype, "href");
|
|
36
|
-
i([
|
|
37
|
-
r({ type: String, reflect: !0 })
|
|
38
|
-
], e.prototype, "iconName");
|
|
39
|
-
i([
|
|
40
|
-
r({ type: String, reflect: !0 })
|
|
41
|
-
], e.prototype, "iconPosition");
|
|
42
|
-
i([
|
|
43
|
-
r({ type: Boolean, reflect: !0 })
|
|
44
|
-
], e.prototype, "external");
|
|
45
|
-
i([
|
|
46
|
-
r({ type: String, reflect: !0 })
|
|
47
|
-
], e.prototype, "target");
|
|
48
|
-
try {
|
|
49
|
-
k("pkt-link")(e);
|
|
50
|
-
} catch {
|
|
51
|
-
console.warn("Forsøker å definere <pkt-link>, men den er allerede definert");
|
|
52
|
-
}
|
|
53
|
-
export {
|
|
54
|
-
e as P
|
|
55
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./element-gR_VtSiD.cjs"),p=require("./element-with-slot-ZX-up7jO.cjs");require("./icon-q81vqPK_.cjs");const c=require("./if-defined-BOW3ODSj.cjs");var k=Object.defineProperty,r=(i,l,s,f)=>{for(var n=void 0,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=a(l,s,n)||n);return n&&k(l,s,n),n};class t extends p.PktElementWithSlot{constructor(){super(...arguments),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal"}render(){const l=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),s=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return e.b`
|
|
2
|
-
<a
|
|
3
|
-
href=${this.href}
|
|
4
|
-
class=${l}
|
|
5
|
-
target=${this.openInNewTab?"_blank":"_self"}
|
|
6
|
-
rel=${c.o(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
7
|
-
>
|
|
8
|
-
${this.iconName&&e.b`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
9
|
-
${this.title&&e.b`<div class=${s}>${this.title}</div>`}
|
|
10
|
-
|
|
11
|
-
<div class="pkt-linkcard__text">${p.slotContent(this)}</div>
|
|
12
|
-
</a>
|
|
13
|
-
`}}r([e.n({type:String,reflect:!0})],t.prototype,"title");r([e.n({type:String,reflect:!0})],t.prototype,"href");r([e.n({type:String,reflect:!0})],t.prototype,"iconName");r([e.n({type:Boolean,reflect:!0})],t.prototype,"external");r([e.n({type:Boolean,reflect:!0})],t.prototype,"openInNewTab");r([e.n({type:String,reflect:!0})],t.prototype,"skin");try{e.t("pkt-linkcard")(t)}catch{console.warn("Forsøker å definere <pkt-linkcard>, men den er allerede definert")}exports.PktLinkCard=t;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { t as c, b as a, n as r } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { P as k, s as f } from "./element-with-slot-Dqk6-TRR.js";
|
|
3
|
-
import "./icon-CxQcIa5F.js";
|
|
4
|
-
import { o as h } from "./if-defined-B0krMLad.js";
|
|
5
|
-
var d = Object.defineProperty, n = (i, o, s, m) => {
|
|
6
|
-
for (var t = void 0, l = i.length - 1, p; l >= 0; l--)
|
|
7
|
-
(p = i[l]) && (t = p(o, s, t) || t);
|
|
8
|
-
return t && d(o, s, t), t;
|
|
9
|
-
};
|
|
10
|
-
class e extends k {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this.title = "", this.href = "#", this.iconName = "", this.external = !1, this.openInNewTab = !1, this.skin = "normal";
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
const o = ["pkt-linkcard", this.skin && `pkt-linkcard--${this.skin}`].filter(Boolean).join(" "), s = ["pkt-linkcard__title", this.external && "pkt-link pkt-link--external"].filter(Boolean).join(" ");
|
|
16
|
-
return a`
|
|
17
|
-
<a
|
|
18
|
-
href=${this.href}
|
|
19
|
-
class=${o}
|
|
20
|
-
target=${this.openInNewTab ? "_blank" : "_self"}
|
|
21
|
-
rel=${h(this.openInNewTab ? "noopener noreferrer" : void 0)}
|
|
22
|
-
>
|
|
23
|
-
${this.iconName && a`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
24
|
-
${this.title && a`<div class=${s}>${this.title}</div>`}
|
|
25
|
-
|
|
26
|
-
<div class="pkt-linkcard__text">${f(this)}</div>
|
|
27
|
-
</a>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
n([
|
|
32
|
-
r({ type: String, reflect: !0 })
|
|
33
|
-
], e.prototype, "title");
|
|
34
|
-
n([
|
|
35
|
-
r({ type: String, reflect: !0 })
|
|
36
|
-
], e.prototype, "href");
|
|
37
|
-
n([
|
|
38
|
-
r({ type: String, reflect: !0 })
|
|
39
|
-
], e.prototype, "iconName");
|
|
40
|
-
n([
|
|
41
|
-
r({ type: Boolean, reflect: !0 })
|
|
42
|
-
], e.prototype, "external");
|
|
43
|
-
n([
|
|
44
|
-
r({ type: Boolean, reflect: !0 })
|
|
45
|
-
], e.prototype, "openInNewTab");
|
|
46
|
-
n([
|
|
47
|
-
r({ type: String, reflect: !0 })
|
|
48
|
-
], e.prototype, "skin");
|
|
49
|
-
try {
|
|
50
|
-
c("pkt-linkcard")(e);
|
|
51
|
-
} catch {
|
|
52
|
-
console.warn("Forsøker å definere <pkt-linkcard>, men den er allerede definert");
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
e as P
|
|
56
|
-
};
|