@oslokommune/punkt-elements 16.7.3 → 16.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/accordion-BB1JrONI.cjs +34 -0
- package/dist/accordion-nNH87Y60.js +130 -0
- package/dist/alert-BEEnTiCb.cjs +33 -0
- package/dist/alert-ePJuDtmm.js +171 -0
- package/dist/async-directive-B9P1Qa0k.cjs +1 -0
- package/dist/async-directive-CaQiqjyV.js +55 -0
- package/dist/backlink-Ba03LlbB.cjs +13 -0
- package/dist/backlink-CiwXrQYD.js +38 -0
- package/dist/booleanish-BmcOU-43.js +11 -0
- package/dist/booleanish-jJLlnr6-.cjs +1 -0
- package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
- package/dist/breadcrumbs-CpuVqWhF.js +76 -0
- package/dist/button-BIpd1xJh.js +95 -0
- package/dist/button-D-TOBaJB.cjs +27 -0
- package/dist/calendar-BzEtOJla.js +2031 -0
- package/dist/calendar-E5jJLt8D.cjs +90 -0
- package/dist/card-BYJu1MYm.js +339 -0
- package/dist/card-CUFhMVim.cjs +87 -0
- package/dist/checkbox-BARDb9iV.cjs +31 -0
- package/dist/checkbox-Cspxcvt_.js +111 -0
- package/dist/class-map-C8HuhNzZ.js +27 -0
- package/dist/class-map-CJ-msbHs.cjs +1 -0
- package/dist/classutils-DEL164Ur.js +7 -0
- package/dist/classutils-z8YsPlOf.cjs +1 -0
- package/dist/combobox-BcdLZRDU.js +984 -0
- package/dist/combobox-CGbFTWq_.cjs +135 -0
- package/dist/consent-DeB_5sWH.js +197 -0
- package/dist/consent-hwu7pp3S.cjs +11 -0
- package/dist/datepicker-DpmlsnH_.cjs +273 -0
- package/dist/datepicker-OVd8pmnZ.js +1125 -0
- package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
- package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
- package/dist/directive-3THFsVew.js +28 -0
- package/dist/directive-CJ2giQBZ.cjs +1 -0
- package/dist/directive-helpers-D1QSxY17.cjs +1 -0
- package/dist/directive-helpers-Dkv2gKgs.js +25 -0
- package/dist/element-DjtxO-1r.cjs +2 -0
- package/dist/element-cZ85T_aa.js +693 -0
- package/dist/element-with-slot-4J2o3SeU.js +166 -0
- package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
- package/dist/header-DWgPgGfS.cjs +304 -0
- package/dist/header-a6ztVNp3.js +782 -0
- package/dist/heading-BgSWIRii.cjs +1 -0
- package/dist/heading-DiQLPxdf.js +73 -0
- package/dist/helptext-CCBKKLus.js +65 -0
- package/dist/helptext-D-3QfZv5.cjs +24 -0
- package/dist/icon-Co72KtgF.js +86 -0
- package/dist/icon-Dr8sfT2X.cjs +1 -0
- package/dist/if-defined-Cjj8qN-Z.js +5 -0
- package/dist/if-defined-XKOD_t_V.cjs +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/input-element-B1yxcfz4.cjs +1 -0
- package/dist/input-element-Bw1s6NlF.js +643 -0
- package/dist/input-wrapper-BRuVELpK.cjs +54 -0
- package/dist/input-wrapper-CDyHTR1V.js +164 -0
- package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
- package/dist/input-wrapper-YfTmpSSY.js +117 -0
- package/dist/link-CKAFMz9j.js +89 -0
- package/dist/link-CyTCpI0k.cjs +7 -0
- package/dist/linkcard-B0KOGaGj.js +55 -0
- package/dist/linkcard-BE4-FewK.cjs +13 -0
- package/dist/listbox-DCA2JoPV.cjs +106 -0
- package/dist/listbox-DuBgTFvH.js +397 -0
- package/dist/loader-6kFZUErT.js +66 -0
- package/dist/loader-CX2rsC01.cjs +16 -0
- package/dist/messagebox-Cwlg5sOr.js +110 -0
- package/dist/messagebox-Din9X53b.cjs +13 -0
- package/dist/modal-C_wtsh9m.js +209 -0
- package/dist/modal-DS_wUOIv.cjs +36 -0
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -7
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +2 -5
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -5
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -81
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -5
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -5
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -5
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -5
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -5
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -5
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -9
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -861
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -5
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -5
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -5
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +30 -66
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -5
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -5
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -5
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -5
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -5
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -5
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -5
- package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
- package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -5
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -5
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -5
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +2 -5
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -5
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -5
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -560
- package/dist/progressbar-CdXtmOBb.cjs +17 -0
- package/dist/progressbar-Dy9AiYQz.js +113 -0
- package/dist/radiobutton-GOnpUbCW.cjs +31 -0
- package/dist/radiobutton-V_KPbup_.js +84 -0
- package/dist/ref-BaJ0mBT_.cjs +1 -0
- package/dist/ref-RS8Uv6uC.js +30 -0
- package/dist/repeat-Cepr3469.js +57 -0
- package/dist/repeat-CqcDYBxr.cjs +1 -0
- package/dist/select-BSAFd8Wa.js +164 -0
- package/dist/select-C2i8sOk5.cjs +49 -0
- package/dist/tabs-D8nL9rWx.cjs +37 -0
- package/dist/tabs-Y7utmJi9.js +318 -0
- package/dist/tag-DLthw5b4.cjs +27 -0
- package/dist/tag-VwykmuQR.js +179 -0
- package/dist/textarea-D7aGOyDf.cjs +46 -0
- package/dist/textarea-DYOBhJrN.js +115 -0
- package/dist/textinput-BUgntXnM.js +124 -0
- package/dist/textinput-DFh8_9cx.cjs +70 -0
- package/dist/timepicker-BIfE7KKJ.cjs +191 -0
- package/dist/timepicker-DaSwn1FA.js +503 -0
- package/dist/utils-CUqCKGvp.js +7 -0
- package/dist/utils-CjAbIttF.cjs +1 -0
- package/package.json +6 -6
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +6 -6
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/dist/accordionitem-_9AiCIvd.cjs +0 -34
- package/dist/accordionitem-dCfSrxh5.js +0 -140
- package/dist/alert-BtOk8yRH.cjs +0 -33
- package/dist/alert-DlY2_grU.js +0 -117
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-Ce5Vldop.js +0 -49
- package/dist/backlink-y3dwjKPC.cjs +0 -13
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-B_TXwNzt.cjs +0 -27
- package/dist/button-BiY-wlKF.js +0 -139
- package/dist/calendar-B2pji2zn.cjs +0 -90
- package/dist/calendar-DhjQDC4C.js +0 -2140
- package/dist/card-BwMNB5Bb.cjs +0 -87
- package/dist/card-CGlmcMSR.js +0 -233
- package/dist/checkbox-BsJZYA26.js +0 -147
- package/dist/checkbox-CTY8f_qn.cjs +0 -31
- package/dist/class-map-CEnykyO_.js +0 -34
- package/dist/class-map-CsENJXf1.cjs +0 -5
- package/dist/classutils-BwNK82ZQ.cjs +0 -1
- package/dist/classutils-RQs1k6D9.js +0 -7
- package/dist/combobox-DSB5WOxg.js +0 -815
- package/dist/combobox-DbICIgKG.cjs +0 -135
- package/dist/consent-DkOQpbsg.cjs +0 -11
- package/dist/consent-SNWV_mMU.js +0 -175
- package/dist/datepicker-BEWl9iz3.cjs +0 -273
- package/dist/datepicker-euHyzXnb.js +0 -1170
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
- package/dist/directive-C7oCP5Bh.cjs +0 -5
- package/dist/directive-helpers-BP2WOx60.cjs +0 -5
- package/dist/directive-helpers-rm-28gIj.js +0 -38
- package/dist/directive-oAbCiebi.js +0 -27
- package/dist/element-CPpT3rFQ.js +0 -638
- package/dist/element-gR_VtSiD.cjs +0 -27
- package/dist/element-with-slot-Dqk6-TRR.js +0 -240
- package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
- package/dist/heading-D2tVS6lS.js +0 -103
- package/dist/heading-DrzbgDb6.cjs +0 -1
- package/dist/helptext-BKtU4mas.js +0 -82
- package/dist/helptext-DcRC7wW2.cjs +0 -24
- package/dist/icon-CxQcIa5F.js +0 -105
- package/dist/icon-q81vqPK_.cjs +0 -9
- package/dist/if-defined-B0krMLad.js +0 -10
- package/dist/if-defined-BOW3ODSj.cjs +0 -5
- package/dist/input-element-8nLwuQS4.js +0 -837
- package/dist/input-element-DdVhUvva.cjs +0 -1
- package/dist/input-wrapper-Bs4CRNst.js +0 -181
- package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-C0rl-86s.cjs +0 -7
- package/dist/link-Cdqgl60z.js +0 -55
- package/dist/linkcard-Dimu7Rlx.cjs +0 -13
- package/dist/linkcard-Lbq_UhjZ.js +0 -56
- package/dist/listbox-Bia4_tvN.js +0 -440
- package/dist/listbox-La2GZQei.cjs +0 -106
- package/dist/loader-D1ugDXGV.cjs +0 -16
- package/dist/loader-DyN6RGC5.js +0 -95
- package/dist/messagebox-BGMVm2t9.js +0 -71
- package/dist/messagebox-M0yIgCz9.cjs +0 -13
- package/dist/modal-CMO1RtIi.cjs +0 -36
- package/dist/modal-DjPQDE-Z.js +0 -156
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-BqlMzkM_.cjs +0 -21
- package/dist/progressbar-sbHDFC12.js +0 -162
- package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
- package/dist/radiobutton-D8Ai8ETa.js +0 -113
- package/dist/ref-Bg_Swj5w.js +0 -42
- package/dist/ref-CL-Xk9Xm.cjs +0 -5
- package/dist/repeat-BD8TKgJb.js +0 -61
- package/dist/repeat-Cfq8CDlf.cjs +0 -5
- package/dist/select-De-n8on9.js +0 -230
- package/dist/select-dTWibR6_.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-B9-jeV97.js +0 -334
- package/dist/tabitem-BnhzqfW3.cjs +0 -65
- package/dist/tag-CbwO8yvD.cjs +0 -27
- package/dist/tag-D4FI5t3y.js +0 -117
- package/dist/textarea-BmLaKzsc.cjs +0 -50
- package/dist/textarea-CMiSJaYL.js +0 -133
- package/dist/textinput-em9y4yrL.cjs +0 -70
- package/dist/textinput-r8udK0IX.js +0 -152
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const C=globalThis,J=r=>r,T=C.trustedTypes,W=T?T.createPolicy("lit-html",{createHTML:r=>r}):void 0,rt="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+f,pt=`<${nt}>`,y=document,x=()=>y.createComment(""),U=r=>r===null||typeof r!="object"&&typeof r!="function",I=Array.isArray,ut=r=>I(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",D=`[
|
|
6
|
-
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,K=/>/g,m=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,Q=/"/g,ot=/^(?:script|style|textarea|title)$/i,$t=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ft=$t(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),X=new WeakMap,g=y.createTreeWalker(y,129);function ht(r,t){if(!I(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return W!==void 0?W.createHTML(t):t}const _t=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",o=P;for(let a=0;a<e;a++){const h=r[a];let c,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===P?p[1]==="!--"?o=Z:p[1]!==void 0?o=K:p[2]!==void 0?(ot.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=m):p[3]!==void 0&&(o=m):o===m?p[0]===">"?(o=i??P,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?m:p[3]==='"'?Q:G):o===Q||o===G?o=m:o===Z||o===K?o=P:(o=m,i=void 0);const $=o===m&&r[a+1].startsWith("/>")?" ":"";n+=o===P?h+pt:l>=0?(s.push(c),h.slice(0,l)+rt+h.slice(l)+f+$):h+f+(l===-2?a:$)}return[ht(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let F=class at{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const a=t.length-1,h=this.parts,[c,p]=_t(t,e);if(this.el=at.createElement(c,s),g.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=g.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(rt)){const u=p[o++],$=i.getAttribute(l).split(f),O=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:O[2],strings:$,ctor:O[1]==="."?gt:O[1]==="?"?At:O[1]==="@"?yt:N}),i.removeAttribute(l)}else l.startsWith(f)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(ot.test(i.tagName)){const l=i.textContent.split(f),u=l.length-1;if(u>0){i.textContent=T?T.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],x()),g.nextNode(),h.push({type:2,index:++n});i.append(l[u],x())}}}else if(i.nodeType===8)if(i.data===nt)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(f,l+1))!==-1;)h.push({type:7,index:n}),l+=f.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}};function b(r,t,e=r,s){var o,a;if(t===v)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=U(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=b(r,i._$AS(r,t.values),i,s)),t}class mt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??y).importNode(e,!0);g.currentNode=i;let n=g.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new w(n,n.nextSibling,this,t):h.type===1?c=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(c=new vt(n,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=g.nextNode(),o++)}return g.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=b(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ut(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=F.createElement(ht(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const o=new mt(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=X.get(t.strings);return e===void 0&&X.set(t.strings,e=new F(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new w(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=J(t).nextSibling;J(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class N{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=b(this,t,e,0),o=!U(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const a=t;let h,c;for(t=n[0],h=0;h<n.length-1;h++)c=b(this,a[s+h],e,h),c===v&&(c=this._$AH[h]),o||(o=!U(c)||c!==this._$AH[h]),c===d?t=d:t!==d&&(t+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class At extends N{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class yt extends N{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=b(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class vt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){b(this,t)}}const Et={I:w},j=C.litHtmlPolyfillSupport;j==null||j(F,w),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.2");const St=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new w(t.insertBefore(x(),n),n,void 0,e??{})}return i._$AI(r),i};/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const bt=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
|
|
12
|
-
* @license
|
|
13
|
-
* Copyright 2019 Google LLC
|
|
14
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const k=globalThis,B=k.ShadowRoot&&(k.ShadyCSS===void 0||k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lt=Symbol(),Y=new WeakMap;let wt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==lt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(B&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Y.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Y.set(e,t))}return t}toString(){return this.cssText}};const Pt=r=>new wt(typeof r=="string"?r:r+"",void 0,lt),Ct=(r,t)=>{if(B)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=k.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},tt=B?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Pt(e)})(r):r;/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2017 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const{is:Mt,defineProperty:xt,getOwnPropertyDescriptor:Ut,getOwnPropertyNames:Ot,getOwnPropertySymbols:kt,getPrototypeOf:Tt}=Object,_=globalThis,et=_.trustedTypes,Ht=et?et.emptyScript:"",L=_.reactiveElementPolyfillSupport,M=(r,t)=>r,H={toAttribute(r,t){switch(t){case Boolean:r=r?Ht:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},q=(r,t)=>!Mt(r,t),st={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=st){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=Ut(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);n==null||n.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??st}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const t=Tt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){const e=this.properties,s=[...Ot(e),...kt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(tt(i))}else t!==void 0&&e.push(tt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var n,o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const a=s.getPropertyOptions(i),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:H;this._$Em=i;const c=h.fromAttribute(e,a.type);this[i]=c??((o=this._$Ej)==null?void 0:o.get(i))??c,this._$Em=null}}requestUpdate(t,e,s,i=!1,n){var o;if(t!==void 0){const a=this.constructor;if(i===!1&&(n=this[t]),s??(s=a.getPropertyOptions(t)),!((s.hasChanged??q)(n,e)||s.useDefault&&s.reflect&&n===((o=this._$Ej)==null?void 0:o.get(t))&&!this.hasAttribute(a._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,o]of i){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)}),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[M("elementProperties")]=new Map,E[M("finalized")]=new Map,L==null||L({ReactiveElement:E}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.1.2");/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2017 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const Nt={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:q},Rt=(r=Nt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(e.name,r),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,r,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,r,!0,a)}}throw Error("Unsupported decorator location: "+s)};function V(r){return(t,e)=>typeof e=="object"?Rt(r,t,e):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(r,t,e)}/**
|
|
24
|
-
* @license
|
|
25
|
-
* Copyright 2017 Google LLC
|
|
26
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const A=globalThis;class S extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=St(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var it;S._$litElement$=!0,S.finalized=!0,(it=A.litElementHydrateSupport)==null||it.call(A,{LitElement:S});const z=A.litElementPolyfillSupport;z==null||z({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.2");const Dt={hi:"Hei!"},jt={from:"Fra",to:"Til"},Lt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},zt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Ft={hours:"Timer",minutes:"Minutter",openPicker:"Åpne tidspunkt-velger",prevTime:"Forrige tidspunkt",nextTime:"Neste tidspunkt",selectTime:"Velg tidspunkt"},It={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",stepMismatch:"Må treffe på steget som er definert i elementet",timeStepMismatch:"Må treffe på et steg, for eksempel 0, {step} minutter",timeStepMismatchHour:"Må treffe på hver hele time",timeStepMismatchHalfHour:"Må treffe på hver hele eller halve time",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},ct={example:Dt,generic:jt,calendar:Lt,dates:zt,timepicker:Ft,forms:It};var Bt=Object.defineProperty,dt=(r,t,e,s)=>{for(var i=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(i=o(t,e,i)||i);return i&&Bt(t,e,i),i};class R extends S{constructor(){super(...arguments),this.strings=ct,this.role=null}hotReplacedCallback(){this.requestUpdate()}}dt([V({type:Object})],R.prototype,"strings");dt([V({type:String})],R.prototype,"role");class qt extends R{createRenderRoot(){return this}}exports.A=d;exports.E=v;exports.PktElement=qt;exports.PktShadowElement=R;exports.b=ft;exports.i=S;exports.j=Et;exports.n=V;exports.strings=ct;exports.t=bt;
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { E as l, P as C } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { f as y } from "./async-directive-CMzWMlZ5.js";
|
|
3
|
-
import { e as O, t as D } from "./directive-oAbCiebi.js";
|
|
4
|
-
function T(s) {
|
|
5
|
-
return s.classList && (s.classList.contains("_dialog_overlay") || s.classList.contains("backdrop")) ? !0 : typeof s.hasAttribute == "function" && s.hasAttribute("data-skip");
|
|
6
|
-
}
|
|
7
|
-
function E(s) {
|
|
8
|
-
return s.nodeName === "OPTION" || s.nodeName === "DATA";
|
|
9
|
-
}
|
|
10
|
-
function b(s) {
|
|
11
|
-
var e;
|
|
12
|
-
return s.nodeType === Node.TEXT_NODE && ((e = s.nodeValue) == null ? void 0 : e.trim()) !== "";
|
|
13
|
-
}
|
|
14
|
-
const p = /* @__PURE__ */ new WeakMap();
|
|
15
|
-
function f(s) {
|
|
16
|
-
let e = p.get(s);
|
|
17
|
-
return e || (e = new m(s), p.set(s, e)), e;
|
|
18
|
-
}
|
|
19
|
-
const N = Symbol("default");
|
|
20
|
-
function g(s) {
|
|
21
|
-
return s === void 0 ? N : s;
|
|
22
|
-
}
|
|
23
|
-
function v(s, e) {
|
|
24
|
-
if (s.nodeType === Node.COMMENT_NODE) return !1;
|
|
25
|
-
if (s.nodeType === Node.TEXT_NODE)
|
|
26
|
-
return b(s) ? (u(e, N, s), !0) : !1;
|
|
27
|
-
if (s.nodeType === Node.ELEMENT_NODE) {
|
|
28
|
-
const t = s;
|
|
29
|
-
if (T(t) || E(t)) return !1;
|
|
30
|
-
if (t instanceof HTMLTemplateElement) {
|
|
31
|
-
const h = Array.from(t.content.childNodes), a = g(t.getAttribute("slot") ?? void 0);
|
|
32
|
-
for (const i of h)
|
|
33
|
-
u(e, a, i);
|
|
34
|
-
return !0;
|
|
35
|
-
}
|
|
36
|
-
const o = t.getAttribute("slot"), r = o !== null ? g(o) : N;
|
|
37
|
-
return u(e, r, s), !0;
|
|
38
|
-
}
|
|
39
|
-
return !1;
|
|
40
|
-
}
|
|
41
|
-
function u(s, e, t) {
|
|
42
|
-
let o = s.get(e);
|
|
43
|
-
o || (o = [], s.set(e, o)), o.push(t);
|
|
44
|
-
}
|
|
45
|
-
const c = class c {
|
|
46
|
-
constructor(e) {
|
|
47
|
-
this.observer = null, this.nodesBySlot = /* @__PURE__ */ new Map(), this.directives = /* @__PURE__ */ new Set(), this.observing = !1, this.trackedNodes = /* @__PURE__ */ new Set(), this.generation = 0, this.initialCollectionDone = !1, this.processingMutations = !1, this.placeholderToNode = /* @__PURE__ */ new Map(), this.nodeToPlaceholder = /* @__PURE__ */ new Map(), this.host = e;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Collect original children BEFORE Lit's first render.
|
|
51
|
-
* Must be called in connectedCallback or earlier.
|
|
52
|
-
* Safe to call multiple times — only the first call scans.
|
|
53
|
-
*/
|
|
54
|
-
collectNodes() {
|
|
55
|
-
if (this.initialCollectionDone) return;
|
|
56
|
-
this.initialCollectionDone = !0, this.generation++;
|
|
57
|
-
const e = Array.from(this.host.childNodes);
|
|
58
|
-
for (const t of e)
|
|
59
|
-
v(t, this.nodesBySlot) && this.trackedNodes.add(t);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Register a directive instance and start observing for dynamic changes.
|
|
63
|
-
*/
|
|
64
|
-
addDirective(e) {
|
|
65
|
-
this.directives.add(e), this.startObserving();
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Unregister a directive instance. Stops observing if no directives remain.
|
|
69
|
-
*/
|
|
70
|
-
removeDirective(e) {
|
|
71
|
-
this.directives.delete(e), this.directives.size === 0 && this.stopObserving();
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Returns nodes matching the given slot name.
|
|
75
|
-
*/
|
|
76
|
-
getNodes(e) {
|
|
77
|
-
return this.nodesBySlot.get(g(e)) ?? [];
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Returns whether the given slot has any content.
|
|
81
|
-
*/
|
|
82
|
-
hasContent(e) {
|
|
83
|
-
return this.getNodes(e).length > 0;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Ensure a placeholder comment exists for a node that is about to be distributed.
|
|
87
|
-
* Called by the directive before Lit moves the node to the target position.
|
|
88
|
-
* The placeholder stays between Lit's ChildPart markers so that when the parent
|
|
89
|
-
* template conditionally removes the content, the MutationObserver can detect
|
|
90
|
-
* the placeholder removal and clean up the real node.
|
|
91
|
-
*/
|
|
92
|
-
ensurePlaceholder(e) {
|
|
93
|
-
if (this.nodeToPlaceholder.has(e) || e.parentNode !== this.host) return;
|
|
94
|
-
const t = document.createComment(c.PLACEHOLDER_PREFIX);
|
|
95
|
-
this.host.insertBefore(t, e), this.placeholderToNode.set(t, e), this.nodeToPlaceholder.set(e, t);
|
|
96
|
-
}
|
|
97
|
-
// --- Private ---
|
|
98
|
-
/**
|
|
99
|
-
* Start MutationObserver for dynamic child changes.
|
|
100
|
-
* Deferred via setTimeout to avoid catching Lit's first render mutations.
|
|
101
|
-
*/
|
|
102
|
-
startObserving() {
|
|
103
|
-
this.observing || (this.observing = !0, setTimeout(() => {
|
|
104
|
-
this.observing && (this.observer = new MutationObserver((e) => {
|
|
105
|
-
this.handleMutations(e);
|
|
106
|
-
}), this.observer.observe(this.host, { childList: !0 }));
|
|
107
|
-
}, 0));
|
|
108
|
-
}
|
|
109
|
-
stopObserving() {
|
|
110
|
-
var e;
|
|
111
|
-
this.observing && (this.observing = !1, (e = this.observer) == null || e.disconnect(), this.observer = null);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Handle MutationObserver mutations incrementally.
|
|
115
|
-
* Only processes nodes that are NOT already part of Lit's rendered template.
|
|
116
|
-
*
|
|
117
|
-
* Uses a guard flag to prevent recursive handling: when notifyDirectives()
|
|
118
|
-
* causes setValue() to move nodes (e.g., from host into a ChildPart container),
|
|
119
|
-
* that move triggers another mutation which must be ignored.
|
|
120
|
-
*/
|
|
121
|
-
handleMutations(e) {
|
|
122
|
-
var o, r, h;
|
|
123
|
-
if (this.processingMutations) return;
|
|
124
|
-
this.processingMutations = !0;
|
|
125
|
-
let t = !1;
|
|
126
|
-
for (const a of e)
|
|
127
|
-
if (a.target === this.host) {
|
|
128
|
-
for (const i of a.removedNodes) {
|
|
129
|
-
const n = this.placeholderToNode.get(i);
|
|
130
|
-
if (n) {
|
|
131
|
-
(o = n.parentNode) == null || o.removeChild(n), this.trackedNodes.delete(n), this.removeFromSlots(n), this.placeholderToNode.delete(i), this.nodeToPlaceholder.delete(n), t = !0;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (this.trackedNodes.has(i)) {
|
|
135
|
-
this.trackedNodes.delete(i), this.removeFromSlots(i);
|
|
136
|
-
const d = this.nodeToPlaceholder.get(i);
|
|
137
|
-
d && ((r = d.parentNode) == null || r.removeChild(d), this.placeholderToNode.delete(d), this.nodeToPlaceholder.delete(i)), t = !0;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
for (const i of a.addedNodes)
|
|
141
|
-
this.placeholderToNode.has(i) || !this.trackedNodes.has(i) && this.isUserContent(i) && v(i, this.nodesBySlot) && (this.trackedNodes.add(i), t = !0);
|
|
142
|
-
}
|
|
143
|
-
t && (this.generation++, this.notifyDirectives()), (h = this.observer) == null || h.takeRecords(), this.processingMutations = !1;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Determines if a node is user-provided content (not Lit's rendered template).
|
|
147
|
-
* Lit's rendered content includes comment markers and elements created by the template.
|
|
148
|
-
*/
|
|
149
|
-
isUserContent(e) {
|
|
150
|
-
if (e.nodeType === Node.COMMENT_NODE) return !1;
|
|
151
|
-
if (e.nodeType === Node.TEXT_NODE)
|
|
152
|
-
return b(e);
|
|
153
|
-
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
154
|
-
const t = e;
|
|
155
|
-
return !(T(t) || E(t));
|
|
156
|
-
}
|
|
157
|
-
return !1;
|
|
158
|
-
}
|
|
159
|
-
removeFromSlots(e) {
|
|
160
|
-
for (const [t, o] of this.nodesBySlot) {
|
|
161
|
-
const r = o.indexOf(e);
|
|
162
|
-
if (r !== -1) {
|
|
163
|
-
o.splice(r, 1), o.length === 0 && this.nodesBySlot.delete(t);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
notifyDirectives() {
|
|
169
|
-
for (const e of this.directives)
|
|
170
|
-
e.handleNodesChanged();
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
c.PLACEHOLDER_PREFIX = "pkt-slot";
|
|
174
|
-
let m = c;
|
|
175
|
-
class P extends y {
|
|
176
|
-
constructor(e) {
|
|
177
|
-
if (super(e), this.manager = null, this.lastGeneration = -1, e.type !== D.CHILD)
|
|
178
|
-
throw new Error("slotContent() can only be used in child expressions");
|
|
179
|
-
}
|
|
180
|
-
render(e, t) {
|
|
181
|
-
return l;
|
|
182
|
-
}
|
|
183
|
-
update(e, [t, o]) {
|
|
184
|
-
return this.slotName = o, this.manager || (this.manager = f(t), this.manager.collectNodes(), this.manager.addDirective(this)), this.ensurePlaceholders(), this.getNodesOrNoChange();
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Called by SlotManager when child mutations are detected.
|
|
188
|
-
* Uses setValue() to push an async update to Lit.
|
|
189
|
-
*/
|
|
190
|
-
handleNodesChanged() {
|
|
191
|
-
if (!this.isConnected || !this.manager) return;
|
|
192
|
-
this.ensurePlaceholders();
|
|
193
|
-
const e = this.getNodesOrNoChange();
|
|
194
|
-
e !== l && this.setValue(e);
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Insert placeholders for nodes that are still direct children of the host.
|
|
198
|
-
* Must be called before Lit moves them to the target position.
|
|
199
|
-
*/
|
|
200
|
-
ensurePlaceholders() {
|
|
201
|
-
if (!this.manager) return;
|
|
202
|
-
const e = this.manager.getNodes(this.slotName);
|
|
203
|
-
for (const t of e)
|
|
204
|
-
this.manager.ensurePlaceholder(t);
|
|
205
|
-
}
|
|
206
|
-
disconnected() {
|
|
207
|
-
var e;
|
|
208
|
-
(e = this.manager) == null || e.removeDirective(this), this.manager = null, this.lastGeneration = -1;
|
|
209
|
-
}
|
|
210
|
-
reconnected() {
|
|
211
|
-
}
|
|
212
|
-
getNodesOrNoChange() {
|
|
213
|
-
if (!this.manager) return l;
|
|
214
|
-
const e = this.manager.generation;
|
|
215
|
-
return e === this.lastGeneration ? l : (this.lastGeneration = e, this.manager.getNodes(this.slotName));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
const L = O(P);
|
|
219
|
-
class A extends C {
|
|
220
|
-
/**
|
|
221
|
-
* Pre-collect children before Lit's first render clears them.
|
|
222
|
-
* This ensures slotContent() has access to the original children.
|
|
223
|
-
*/
|
|
224
|
-
connectedCallback() {
|
|
225
|
-
f(this).collectNodes(), super.connectedCallback();
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Checks if a slot has content distributed to it via the slotContent directive.
|
|
229
|
-
*
|
|
230
|
-
* @param slotName - Name of the slot. Omit for the default slot.
|
|
231
|
-
*/
|
|
232
|
-
hasSlotContent(e) {
|
|
233
|
-
return f(this).hasContent(e);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
export {
|
|
237
|
-
A as P,
|
|
238
|
-
E as i,
|
|
239
|
-
L as s
|
|
240
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./element-gR_VtSiD.cjs"),y=require("./async-directive-DoMuclel.cjs"),E=require("./directive-C7oCP5Bh.cjs");function C(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function p(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function b(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}const v=new WeakMap;function f(s){let e=v.get(s);return e||(e=new m(s),v.set(s,e)),e}const N=Symbol("default");function g(s){return s===void 0?N:s}function T(s,e){if(s.nodeType===Node.COMMENT_NODE)return!1;if(s.nodeType===Node.TEXT_NODE)return b(s)?(u(e,N,s),!0):!1;if(s.nodeType===Node.ELEMENT_NODE){const t=s;if(C(t)||p(t))return!1;if(t instanceof HTMLTemplateElement){const l=Array.from(t.content.childNodes),a=g(t.getAttribute("slot")??void 0);for(const i of l)u(e,a,i);return!0}const o=t.getAttribute("slot"),n=o!==null?g(o):N;return u(e,n,s),!0}return!1}function u(s,e,t){let o=s.get(e);o||(o=[],s.set(e,o)),o.push(t)}const c=class c{constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;const e=Array.from(this.host.childNodes);for(const t of e)T(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(g(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e)||e.parentNode!==this.host)return;const t=document.createComment(c.PLACEHOLDER_PREFIX);this.host.insertBefore(t,e),this.placeholderToNode.set(t,e),this.nodeToPlaceholder.set(e,t)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){var e;this.observing&&(this.observing=!1,(e=this.observer)==null||e.disconnect(),this.observer=null)}handleMutations(e){var o,n,l;if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(const a of e)if(a.target===this.host){for(const i of a.removedNodes){const r=this.placeholderToNode.get(i);if(r){(o=r.parentNode)==null||o.removeChild(r),this.trackedNodes.delete(r),this.removeFromSlots(r),this.placeholderToNode.delete(i),this.nodeToPlaceholder.delete(r),t=!0;continue}if(this.trackedNodes.has(i)){this.trackedNodes.delete(i),this.removeFromSlots(i);const d=this.nodeToPlaceholder.get(i);d&&((n=d.parentNode)==null||n.removeChild(d),this.placeholderToNode.delete(d),this.nodeToPlaceholder.delete(i)),t=!0}}for(const i of a.addedNodes)this.placeholderToNode.has(i)||!this.trackedNodes.has(i)&&this.isUserContent(i)&&T(i,this.nodesBySlot)&&(this.trackedNodes.add(i),t=!0)}t&&(this.generation++,this.notifyDirectives()),(l=this.observer)==null||l.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return b(e);if(e.nodeType===Node.ELEMENT_NODE){const t=e;return!(C(t)||p(t))}return!1}removeFromSlots(e){for(const[t,o]of this.nodesBySlot){const n=o.indexOf(e);if(n!==-1){o.splice(n,1),o.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(const e of this.directives)e.handleNodesChanged()}};c.PLACEHOLDER_PREFIX="pkt-slot";let m=c;class O extends y.f{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==E.t.CHILD)throw new Error("slotContent() can only be used in child expressions")}render(e,t){return h.E}update(e,[t,o]){return this.slotName=o,this.manager||(this.manager=f(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();const e=this.getNodesOrNoChange();e!==h.E&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;const e=this.manager.getNodes(this.slotName);for(const t of e)this.manager.ensurePlaceholder(t)}disconnected(){var e;(e=this.manager)==null||e.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return h.E;const e=this.manager.generation;return e===this.lastGeneration?h.E:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}}const D=E.e(O);class P extends h.PktElement{connectedCallback(){f(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return f(this).hasContent(e)}}exports.PktElementWithSlot=P;exports.isOptionElement=p;exports.slotContent=D;
|
package/dist/heading-D2tVS6lS.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { t as u, a as g, b as p, n as a } from "./element-CPpT3rFQ.js";
|
|
2
|
-
var o = Object.defineProperty, l = (r, e, d, t) => {
|
|
3
|
-
for (var i = void 0, h = r.length - 1, n; h >= 0; h--)
|
|
4
|
-
(n = r[h]) && (i = n(e, d, i) || i);
|
|
5
|
-
return i && o(e, d, i), i;
|
|
6
|
-
};
|
|
7
|
-
class s extends g {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments), this.size = void 0, this.level = 2, this.weight = void 0, this.visuallyHidden = !1, this.align = void 0;
|
|
10
|
-
}
|
|
11
|
-
connectedCallback() {
|
|
12
|
-
super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
|
|
13
|
-
}
|
|
14
|
-
attributeChangedCallback(e, d, t) {
|
|
15
|
-
super.attributeChangedCallback(e, d, t), e === "level" && t && this.setLevel(Number(t)), e === "visuallyHidden" && (this.visuallyHidden = t !== null && t !== "false"), (e === "size" || e === "visuallyHidden" || e === "align" || e === "weight") && this.updateHostClasses();
|
|
16
|
-
}
|
|
17
|
-
updated(e) {
|
|
18
|
-
super.updated(e), e.has("level") && (this.setLevel(this.level), this.hasAttribute("size") || (this.size = this.defaultSizeForLevel), this.hasAttribute("weight") || (this.weight = this.defaultWeightForLevel)), !this.hasAttribute("size") && (e.has("level") || this.size === void 0) && (this.size = this.defaultSizeForLevel), (e.has("size") || e.has("visuallyHidden") || e.has("align") || e.has("weight")) && this.updateHostClasses();
|
|
19
|
-
}
|
|
20
|
-
setLevel(e) {
|
|
21
|
-
e >= 1 && e <= 6 ? (this.level = e, this.setAttribute("aria-level", String(e))) : console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`);
|
|
22
|
-
}
|
|
23
|
-
get defaultSizeForLevel() {
|
|
24
|
-
switch (this.level) {
|
|
25
|
-
case 1:
|
|
26
|
-
return "xlarge";
|
|
27
|
-
case 2:
|
|
28
|
-
return "large";
|
|
29
|
-
case 3:
|
|
30
|
-
return "medium";
|
|
31
|
-
case 4:
|
|
32
|
-
return "small";
|
|
33
|
-
case 5:
|
|
34
|
-
return "xsmall";
|
|
35
|
-
case 6:
|
|
36
|
-
return "xsmall";
|
|
37
|
-
default:
|
|
38
|
-
return "medium";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
get defaultWeightForLevel() {
|
|
42
|
-
switch (this.level) {
|
|
43
|
-
case 1:
|
|
44
|
-
return "regular";
|
|
45
|
-
case 2:
|
|
46
|
-
return "regular";
|
|
47
|
-
case 3:
|
|
48
|
-
return "medium";
|
|
49
|
-
case 4:
|
|
50
|
-
return "medium";
|
|
51
|
-
case 5:
|
|
52
|
-
return "medium";
|
|
53
|
-
case 6:
|
|
54
|
-
return "medium";
|
|
55
|
-
default:
|
|
56
|
-
return "medium";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
updateHostClasses() {
|
|
60
|
-
this.classList.remove(
|
|
61
|
-
"pkt-heading",
|
|
62
|
-
"pkt-heading--xsmall",
|
|
63
|
-
"pkt-heading--small",
|
|
64
|
-
"pkt-heading--medium",
|
|
65
|
-
"pkt-heading--large",
|
|
66
|
-
"pkt-heading--xlarge",
|
|
67
|
-
"pkt-sr-only",
|
|
68
|
-
"pkt-heading--start",
|
|
69
|
-
"pkt-heading--center",
|
|
70
|
-
"pkt-heading--end",
|
|
71
|
-
"pkt-heading--light",
|
|
72
|
-
"pkt-heading--regular",
|
|
73
|
-
"pkt-heading--medium",
|
|
74
|
-
"pkt-heading--bold"
|
|
75
|
-
), this.classList.add("pkt-heading"), this.size && this.classList.add(`pkt-heading--${this.size}`), this.weight && this.classList.add(`pkt-heading--fw-${this.weight}`), this.visuallyHidden && this.classList.add("pkt-sr-only"), this.align && this.classList.add(`pkt-heading--${this.align}`);
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
return p`<slot></slot>`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
l([
|
|
82
|
-
a({ type: String, reflect: !0 })
|
|
83
|
-
], s.prototype, "size");
|
|
84
|
-
l([
|
|
85
|
-
a({ type: Number, reflect: !0 })
|
|
86
|
-
], s.prototype, "level");
|
|
87
|
-
l([
|
|
88
|
-
a({ type: String, reflect: !0 })
|
|
89
|
-
], s.prototype, "weight");
|
|
90
|
-
l([
|
|
91
|
-
a({ type: Boolean, reflect: !0 })
|
|
92
|
-
], s.prototype, "visuallyHidden");
|
|
93
|
-
l([
|
|
94
|
-
a({ type: String, reflect: !0 })
|
|
95
|
-
], s.prototype, "align");
|
|
96
|
-
try {
|
|
97
|
-
u("pkt-heading")(s);
|
|
98
|
-
} catch {
|
|
99
|
-
console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
|
|
100
|
-
}
|
|
101
|
-
export {
|
|
102
|
-
s as P
|
|
103
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./element-gR_VtSiD.cjs");var u=Object.defineProperty,l=(r,e,d,s)=>{for(var a=void 0,h=r.length-1,n;h>=0;h--)(n=r[h])&&(a=n(e,d,a)||a);return a&&u(e,d,a),a};class i extends t.PktShadowElement{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,d,s){super.attributeChangedCallback(e,d,s),e==="level"&&s&&this.setLevel(Number(s)),e==="visuallyHidden"&&(this.visuallyHidden=s!==null&&s!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return t.b`<slot></slot>`}}l([t.n({type:String,reflect:!0})],i.prototype,"size");l([t.n({type:Number,reflect:!0})],i.prototype,"level");l([t.n({type:String,reflect:!0})],i.prototype,"weight");l([t.n({type:Boolean,reflect:!0})],i.prototype,"visuallyHidden");l([t.n({type:String,reflect:!0})],i.prototype,"align");try{t.t("pkt-heading")(i)}catch{console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert")}exports.PktHeading=i;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { P as c, s as u } from "./element-with-slot-Dqk6-TRR.js";
|
|
2
|
-
import { t as k, b as l, A as m, n as i } from "./element-CPpT3rFQ.js";
|
|
3
|
-
import { o as h } from "./icon-CxQcIa5F.js";
|
|
4
|
-
import { e as d } from "./class-map-CEnykyO_.js";
|
|
5
|
-
import { r as _ } from "./state-C_1EOo3D.js";
|
|
6
|
-
import { u as f } from "./utils-DznhwRXm.js";
|
|
7
|
-
import { s as w } from "./input-wrapper-CDgenrYA.js";
|
|
8
|
-
var v = Object.defineProperty, n = (r, o, s, a) => {
|
|
9
|
-
for (var t = void 0, e = r.length - 1, x; e >= 0; e--)
|
|
10
|
-
(x = r[e]) && (t = x(o, s, t) || t);
|
|
11
|
-
return t && v(o, s, t), t;
|
|
12
|
-
};
|
|
13
|
-
class p extends c {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments), this.forId = f(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = w.props.helptextDropdownButton.default, this.isHelpTextOpen = !1;
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
const o = () => {
|
|
19
|
-
const e = !this.isHelpTextOpen;
|
|
20
|
-
this.isHelpTextOpen = e, this.dispatchEvent(
|
|
21
|
-
new CustomEvent("toggleHelpText", {
|
|
22
|
-
bubbles: !0,
|
|
23
|
-
detail: { isOpen: e }
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
}, s = d({
|
|
27
|
-
"pkt-inputwrapper__helptext-container": !0,
|
|
28
|
-
"pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.hasSlotContent()
|
|
29
|
-
}), a = () => this.helptextDropdown ? l`<div class="pkt-inputwrapper__helptext-expandable">
|
|
30
|
-
<button
|
|
31
|
-
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
32
|
-
type="button"
|
|
33
|
-
@click=${o}
|
|
34
|
-
>
|
|
35
|
-
<pkt-icon
|
|
36
|
-
class="pkt-btn__icon"
|
|
37
|
-
name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
|
|
38
|
-
></pkt-icon>
|
|
39
|
-
<span class="pkt-btn__text">${h(this.helptextDropdownButton)}</span>
|
|
40
|
-
</button>
|
|
41
|
-
<div
|
|
42
|
-
class="${d({
|
|
43
|
-
"pkt-inputwrapper__helptext": !0,
|
|
44
|
-
"pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
|
|
45
|
-
"pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
|
|
46
|
-
})}"
|
|
47
|
-
>
|
|
48
|
-
${h(this.helptextDropdown)}
|
|
49
|
-
</div>
|
|
50
|
-
</div>` : m;
|
|
51
|
-
return l`${l`<div class="${s}">
|
|
52
|
-
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
53
|
-
<div class="pkt-contents" name="helptext">${u(this)}</div>
|
|
54
|
-
${this.helptext && h(this.helptext)}
|
|
55
|
-
</div>
|
|
56
|
-
${a()}
|
|
57
|
-
</div>`}`;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
n([
|
|
61
|
-
i({ type: String, reflect: !0 })
|
|
62
|
-
], p.prototype, "forId");
|
|
63
|
-
n([
|
|
64
|
-
i({ type: String })
|
|
65
|
-
], p.prototype, "helptext");
|
|
66
|
-
n([
|
|
67
|
-
i({ type: String })
|
|
68
|
-
], p.prototype, "helptextDropdown");
|
|
69
|
-
n([
|
|
70
|
-
i({ type: String })
|
|
71
|
-
], p.prototype, "helptextDropdownButton");
|
|
72
|
-
n([
|
|
73
|
-
_()
|
|
74
|
-
], p.prototype, "isHelpTextOpen");
|
|
75
|
-
try {
|
|
76
|
-
k("pkt-helptext")(p);
|
|
77
|
-
} catch {
|
|
78
|
-
console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert");
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
p as P
|
|
82
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./element-with-slot-ZX-up7jO.cjs"),t=require("./element-gR_VtSiD.cjs"),l=require("./icon-q81vqPK_.cjs"),d=require("./class-map-CsENJXf1.cjs"),u=require("./state-Dg-53wQ8.cjs"),x=require("./utils-byXsEz1u.cjs"),k=require("./input-wrapper-EoSAbU-U.cjs");var _=Object.defineProperty,r=(s,i,o,h)=>{for(var e=void 0,n=s.length-1,a;n>=0;n--)(a=s[n])&&(e=a(i,o,e)||e);return e&&_(i,o,e),e};class p extends c.PktElementWithSlot{constructor(){super(...arguments),this.forId=x.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=k.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const i=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},o=d.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()}),h=()=>this.helptextDropdown?t.b`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
|
-
<button
|
|
3
|
-
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
|
-
type="button"
|
|
5
|
-
@click=${i}
|
|
6
|
-
>
|
|
7
|
-
<pkt-icon
|
|
8
|
-
class="pkt-btn__icon"
|
|
9
|
-
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
10
|
-
></pkt-icon>
|
|
11
|
-
<span class="pkt-btn__text">${l.o(this.helptextDropdownButton)}</span>
|
|
12
|
-
</button>
|
|
13
|
-
<div
|
|
14
|
-
class="${d.e({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
15
|
-
>
|
|
16
|
-
${l.o(this.helptextDropdown)}
|
|
17
|
-
</div>
|
|
18
|
-
</div>`:t.A,e=()=>t.b`<div class="${o}">
|
|
19
|
-
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
20
|
-
<div class="pkt-contents" name="helptext">${c.slotContent(this)}</div>
|
|
21
|
-
${this.helptext&&l.o(this.helptext)}
|
|
22
|
-
</div>
|
|
23
|
-
${h()}
|
|
24
|
-
</div>`;return t.b`${e()}`}}r([t.n({type:String,reflect:!0})],p.prototype,"forId");r([t.n({type:String})],p.prototype,"helptext");r([t.n({type:String})],p.prototype,"helptextDropdown");r([t.n({type:String})],p.prototype,"helptextDropdownButton");r([u.r()],p.prototype,"isHelpTextOpen");try{t.t("pkt-helptext")(p)}catch{console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert")}exports.PktHelptext=p;
|
package/dist/icon-CxQcIa5F.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { A as y, E as v, t as I, P, b as _, n as d } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { e as m, i as S, t as b } from "./directive-oAbCiebi.js";
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2017 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
class c extends S {
|
|
9
|
-
constructor(t) {
|
|
10
|
-
if (super(t), this.it = y, t.type !== b.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
11
|
-
}
|
|
12
|
-
render(t) {
|
|
13
|
-
if (t === y || t == null) return this._t = void 0, this.it = t;
|
|
14
|
-
if (t === v) return t;
|
|
15
|
-
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
16
|
-
if (t === this.it) return this._t;
|
|
17
|
-
this.it = t;
|
|
18
|
-
const e = [t];
|
|
19
|
-
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
c.directiveName = "unsafeHTML", c.resultType = 1;
|
|
23
|
-
const R = m(c);
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
class f extends c {
|
|
30
|
-
}
|
|
31
|
-
f.directiveName = "unsafeSVG", f.resultType = 2;
|
|
32
|
-
const u = m(f);
|
|
33
|
-
var C = Object.defineProperty, h = (n, t, e, s) => {
|
|
34
|
-
for (var o = void 0, p = n.length - 1, w; p >= 0; p--)
|
|
35
|
-
(w = n[p]) && (o = w(t, e, o) || o);
|
|
36
|
-
return o && C(t, e, o), o;
|
|
37
|
-
};
|
|
38
|
-
const l = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
|
|
39
|
-
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || l);
|
|
40
|
-
const r = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', i = {}, E = 2, F = 1500, g = typeof Storage < "u" && typeof sessionStorage < "u", T = (n) => window.pktFetch(n).then((t) => {
|
|
41
|
-
if (!t.ok)
|
|
42
|
-
throw new Error("Missing icon: " + n);
|
|
43
|
-
return t.text();
|
|
44
|
-
}), k = async (n, t = E) => {
|
|
45
|
-
try {
|
|
46
|
-
return await T(n);
|
|
47
|
-
} catch {
|
|
48
|
-
return t > 0 ? (await new Promise((s) => setTimeout(s, F)), k(n, t - 1)) : (console.error("Failed to fetch icon: " + n), r);
|
|
49
|
-
}
|
|
50
|
-
}, $ = async (n, t) => {
|
|
51
|
-
const e = t + n + ".svg";
|
|
52
|
-
return g && sessionStorage.getItem(e) ? sessionStorage.getItem(e) : e in i ? i[e] : typeof window < "u" && typeof window.pktFetch == "function" ? (i[e] = k(e).then((s) => (s !== r && g && sessionStorage.setItem(e, s), delete i[e], s)), i[e]) : r;
|
|
53
|
-
};
|
|
54
|
-
class a extends P {
|
|
55
|
-
constructor() {
|
|
56
|
-
super(...arguments), this.path = typeof window < "u" ? window.pktIconPath : l, this.name = "", this.icon = u(r), this._updatedProps = [];
|
|
57
|
-
}
|
|
58
|
-
connectedCallback() {
|
|
59
|
-
super.connectedCallback(), this.classList.add("pkt-icon");
|
|
60
|
-
}
|
|
61
|
-
async attributeChangedCallback(t, e, s) {
|
|
62
|
-
super.attributeChangedCallback(t, e, s), (t === "name" || t === "path") && this.getIcon(this.name);
|
|
63
|
-
}
|
|
64
|
-
async updated(t) {
|
|
65
|
-
super.updated(t), (t.has("name") || t.has("path")) && this.getIcon(this.name);
|
|
66
|
-
}
|
|
67
|
-
async getIcon(t = "") {
|
|
68
|
-
if (this._updatedProps.length > 0) {
|
|
69
|
-
this.path || (this.path = typeof window < "u" ? window.pktIconPath : l);
|
|
70
|
-
try {
|
|
71
|
-
this.icon = u(
|
|
72
|
-
await $(this.name || "", this.path)
|
|
73
|
-
);
|
|
74
|
-
} catch {
|
|
75
|
-
this.icon = u(r);
|
|
76
|
-
}
|
|
77
|
-
this._updatedProps = [];
|
|
78
|
-
} else
|
|
79
|
-
this._updatedProps.includes(t) || this._updatedProps.push(t);
|
|
80
|
-
}
|
|
81
|
-
render() {
|
|
82
|
-
return _`${this.name && this.icon}`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
h([
|
|
86
|
-
d({ type: String, reflect: !1 })
|
|
87
|
-
], a.prototype, "path");
|
|
88
|
-
h([
|
|
89
|
-
d({ type: String, reflect: !0 })
|
|
90
|
-
], a.prototype, "name");
|
|
91
|
-
h([
|
|
92
|
-
d({ type: SVGElement })
|
|
93
|
-
], a.prototype, "icon");
|
|
94
|
-
h([
|
|
95
|
-
d({ type: Array, noAccessor: !0 })
|
|
96
|
-
], a.prototype, "_updatedProps");
|
|
97
|
-
try {
|
|
98
|
-
I("pkt-icon")(a);
|
|
99
|
-
} catch {
|
|
100
|
-
console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
|
|
101
|
-
}
|
|
102
|
-
export {
|
|
103
|
-
a as P,
|
|
104
|
-
R as o
|
|
105
|
-
};
|
package/dist/icon-q81vqPK_.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./element-gR_VtSiD.cjs"),d=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/class h extends d.i{constructor(t){if(super(t),this.it=i.A,t.type!==d.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===i.A||t==null)return this._t=void 0,this.it=t;if(t===i.E)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}h.directiveName="unsafeHTML",h.resultType=1;const m=d.e(h);/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/class l extends h{}l.directiveName="unsafeSVG",l.resultType=2;const f=d.e(l);var v=Object.defineProperty,p=(n,t,e,s)=>{for(var o=void 0,u=n.length-1,y;u>=0;u--)(y=n[u])&&(o=y(t,e,o)||o);return o&&v(t,e,o),o};const w="https://punkt-cdn.oslo.kommune.no/latest/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||w);const a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',c={},I=2,P=1500,g=typeof Storage<"u"&&typeof sessionStorage<"u",_=n=>window.pktFetch(n).then(t=>{if(!t.ok)throw new Error("Missing icon: "+n);return t.text()}),k=async(n,t=I)=>{try{return await _(n)}catch{return t>0?(await new Promise(s=>setTimeout(s,P)),k(n,t-1)):(console.error("Failed to fetch icon: "+n),a)}},S=async(n,t)=>{const e=t+n+".svg";return g&&sessionStorage.getItem(e)?sessionStorage.getItem(e):e in c?c[e]:typeof window<"u"&&typeof window.pktFetch=="function"?(c[e]=k(e).then(s=>(s!==a&&g&&sessionStorage.setItem(e,s),delete c[e],s)),c[e]):a};class r extends i.PktElement{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:w,this.name="",this.icon=f(a),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:w);try{this.icon=f(await S(this.name||"",this.path))}catch{this.icon=f(a)}this._updatedProps=[]}else this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return i.b`${this.name&&this.icon}`}}p([i.n({type:String,reflect:!1})],r.prototype,"path");p([i.n({type:String,reflect:!0})],r.prototype,"name");p([i.n({type:SVGElement})],r.prototype,"icon");p([i.n({type:Array,noAccessor:!0})],r.prototype,"_updatedProps");try{i.t("pkt-icon")(r)}catch{console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert")}exports.PktIcon=r;exports.o=m;
|