@oslokommune/punkt-elements 14.3.0 → 14.5.2
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 +34 -0
- package/dist/{accordionitem-C_URrDjP.js → accordionitem-DB3tAjIZ.js} +4 -4
- package/dist/{accordionitem-DCZrHVNR.cjs → accordionitem-DHYmPA-o.cjs} +1 -1
- package/dist/{alert-UFQFbbzZ.js → alert-DqXar67l.js} +6 -6
- package/dist/{alert-SvqEDHuW.cjs → alert-GrKyqxuR.cjs} +1 -1
- package/dist/{backlink-C7qUmUzs.js → backlink-CqUcmiPQ.js} +11 -11
- package/dist/{backlink-BrIIpgJ7.cjs → backlink-QDcQd6vK.cjs} +1 -1
- package/dist/{button-DaM4jvhJ.cjs → button-R4l10Nqd.cjs} +1 -1
- package/dist/{button-CjXih_Nx.js → button-f36menSU.js} +5 -5
- package/dist/{calendar-CvfMj3fA.js → calendar-DiNuZ8Ai.js} +7 -8
- package/dist/{calendar-ZzLAjDpv.cjs → calendar-wuD6ZH0t.cjs} +3 -3
- package/dist/{card-C1gRTfXb.cjs → card-C2hWaMev.cjs} +1 -1
- package/dist/{card-CO3D8wQE.js → card-CnINxZma.js} +7 -7
- package/dist/{checkbox-C0TPnShf.cjs → checkbox-B-0FOdwi.cjs} +1 -1
- package/dist/{checkbox-CnhA52o_.js → checkbox-CkAwPK_E.js} +4 -4
- package/dist/{class-map-C_erArZz.cjs → class-map-CApIYSRo.cjs} +1 -1
- package/dist/{class-map-wy7PUk0P.js → class-map-Dt2jXOlF.js} +1 -1
- package/dist/{combobox-Dcp_fHcL.js → combobox-Dxa7XjLz.js} +55 -55
- package/dist/{combobox-C1xwAju5.cjs → combobox-yy6hIGmB.cjs} +13 -13
- package/dist/{consent-Daj-Xa7w.cjs → consent-FbFS1pmz.cjs} +1 -1
- package/dist/{consent-BO3Ga8N4.js → consent-c9PhWxnP.js} +3 -3
- package/dist/{datepicker-Bjb9GK1E.js → datepicker-C7GWMtXH.js} +222 -241
- package/dist/{datepicker-COIRRau0.cjs → datepicker-D_3vYgMt.cjs} +25 -25
- package/dist/{directive-helpers-BzAtj9by.js → directive-helpers-CQef4qUQ.js} +1 -1
- package/dist/{directive-helpers-4oOjKnGY.cjs → directive-helpers-CYIEJ8pI.cjs} +1 -1
- package/dist/{element-CRDRygXu.js → element-BXsf_NlG.js} +3 -3
- package/dist/{element-CJ_QKaki.cjs → element-aUzIoa1s.cjs} +3 -3
- package/dist/{heading-Dv_cH6N1.cjs → heading-CBepYb7H.cjs} +1 -1
- package/dist/{heading-BUdy170t.js → heading-J7dN9nRi.js} +13 -13
- package/dist/{helptext-hlcc584n.cjs → helptext-DebHGRsD.cjs} +1 -1
- package/dist/{helptext-Bn17Picx.js → helptext-DuyRRfCn.js} +5 -5
- package/dist/{icon-BB7e5iQN.js → icon-BgG6oO4Q.js} +1 -1
- package/dist/{icon-MRx-m0Or.cjs → icon-Dl9ZPqe6.cjs} +1 -1
- package/dist/{if-defined-Bc9-_I01.cjs → if-defined-BElHLTlB.cjs} +1 -1
- package/dist/{if-defined-BWZGb3bh.js → if-defined-CxHgig4I.js} +1 -1
- package/dist/index.d.ts +213 -55
- package/dist/input-element-DVZhYDJ_.js +840 -0
- package/dist/input-element-RBQVA8i0.cjs +1 -0
- package/dist/{input-wrapper-1PCXqtiu.js → input-wrapper-3qfjLkrP.js} +7 -7
- package/dist/{input-wrapper-CtBiAb04.cjs → input-wrapper-rgXsRNkk.cjs} +1 -1
- package/dist/{link-BboUBUcg.js → link-CZvcdRek.js} +4 -4
- package/dist/{link-Dw39h-YN.cjs → link-D85g20GS.cjs} +1 -1
- package/dist/{linkcard-DUA3kGGd.cjs → linkcard-B-9K02q8.cjs} +1 -1
- package/dist/{linkcard-BqJmHFu8.js → linkcard-C3RTcMqc.js} +4 -4
- package/dist/{listbox-mvKKzH-v.js → listbox-CLtowV6W.js} +36 -36
- package/dist/{listbox-DnoqOo5u.cjs → listbox-C_0RhGhk.cjs} +2 -2
- package/dist/{loader-DjGxT7C3.cjs → loader-1EXLdxfq.cjs} +1 -1
- package/dist/{loader-DIum_s_D.js → loader-Dci0SrOz.js} +5 -5
- package/dist/{messagebox-aPlConlJ.js → messagebox-CnZlttZp.js} +5 -5
- package/dist/{messagebox-ChIKVTO_.cjs → messagebox-dscnWgCd.cjs} +1 -1
- package/dist/{modal-B4qq0VFB.cjs → modal-ncKVjcyZ.cjs} +1 -1
- package/dist/{modal-jAUtM-NP.js → modal-wSGthXAC.js} +5 -5
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +9 -9
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -29
- package/dist/pkt-index.js +60 -157
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-options-controller-DjBCEHU4.cjs +1 -0
- package/dist/{pkt-options-controller-CZO1nxZ8.js → pkt-options-controller-zn5cmMvL.js} +3 -3
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-CmAQ-DVW.cjs → progressbar-ClY1WgnM.cjs} +1 -1
- package/dist/{progressbar-CVt73-JQ.js → progressbar-D5WBW1Dm.js} +5 -5
- package/dist/{radiobutton-BkqaqO5E.cjs → radiobutton-iHuLnuAn.cjs} +1 -1
- package/dist/{radiobutton-Caq8-GhM.js → radiobutton-oA20HijB.js} +15 -15
- package/dist/{ref-Xa5dbh--.js → ref-BxiKhrfa.js} +2 -2
- package/dist/{ref-BFa5Utho.cjs → ref-C5iJMIE1.cjs} +1 -1
- package/dist/{repeat-CJ79egkN.js → repeat-B55jMEsG.js} +2 -2
- package/dist/{repeat-BZb41H64.cjs → repeat-DcYSFU2y.cjs} +1 -1
- package/dist/select-Bug9sfr5.js +228 -0
- package/dist/select-jbIbD7hW.cjs +49 -0
- package/dist/{state-DS_kr2Fy.js → state-DgnkjP0q.js} +1 -1
- package/dist/{state-DSjcvzDN.cjs → state-GDzxl12x.cjs} +1 -1
- package/dist/{tabitem-D5zyipN1.cjs → tabitem-CtltSqDK.cjs} +1 -1
- package/dist/{tabitem-NV2fzs_-.js → tabitem-CypTmORF.js} +30 -30
- package/dist/{tag-B02fKJ66.cjs → tag-BfjOlIyS.cjs} +1 -1
- package/dist/{tag-CES41g0D.js → tag-DgoTYNVA.js} +6 -6
- package/dist/{textarea-a6T4aJJU.js → textarea-Da9E3RM7.js} +9 -9
- package/dist/{textarea-DyUy8u7X.cjs → textarea-Dfa4_ZBy.cjs} +1 -1
- package/dist/{textinput-IN3b0nSH.cjs → textinput-CLM9fRjm.cjs} +1 -1
- package/dist/{textinput-DIuM70dd.js → textinput-DaMYc5gd.js} +8 -8
- package/package.json +2 -2
- package/src/components/checkbox/checkbox.ts +1 -1
- package/src/components/combobox/combobox.ts +2 -2
- package/src/components/datepicker/datepicker-utils.test.ts +0 -25
- package/src/components/datepicker/datepicker-utils.ts +0 -28
- package/src/components/datepicker/datepicker.ts +0 -6
- package/src/components/header/header.ts +2 -0
- package/src/components/index.ts +0 -1
- package/src/components/radiobutton/radiobutton.ts +1 -1
- package/src/components/select/select.ts +14 -47
- package/src/components/textarea/textarea.ts +1 -1
- package/src/components/textinput/textinput.ts +1 -1
- package/dist/input-element-B8M8Nppd.js +0 -708
- package/dist/input-element-D697OAJo.cjs +0 -1
- package/dist/pkt-options-controller-CiuBG6Lt.cjs +0 -1
- package/dist/select-3dwlk22G.cjs +0 -49
- package/dist/select-_C-yztI0.js +0 -173
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("./element-aUzIoa1s.cjs"),B=require("./state-GDzxl12x.cjs"),u=require("./calendar-wuD6ZH0t.cjs"),A=require("./input-element-RBQVA8i0.cjs"),p=require("./ref-C5iJMIE1.cjs");require("./icon-Dl9ZPqe6.cjs");require("./input-wrapper-rgXsRNkk.cjs");const m=require("./class-map-CApIYSRo.cjs"),M=require("./repeat-DcYSFU2y.cjs");require("./tag-BfjOlIyS.cjs");const I=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-BElHLTlB.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs");var F=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&F(e,t,i),i};exports.PktDateTags=class extends r.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=I.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},r.x`
|
|
2
2
|
<div class=${m.e(this.classes)} aria-live="polite">
|
|
3
|
-
${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return
|
|
3
|
+
${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return r.x` <pkt-tag
|
|
4
4
|
id=${this.idBase+e+"-tag"}
|
|
5
5
|
closeTag
|
|
6
6
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
|
|
7
7
|
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${u.fromISOtoLocal(e,this.dateformat)}`}
|
|
8
8
|
>
|
|
9
9
|
<time datetime=${e}>${u.fromISOtoLocal(e,this.dateformat)}</time>
|
|
10
|
-
</pkt-tag>`}):
|
|
10
|
+
</pkt-tag>`}):r.E}
|
|
11
11
|
</div>
|
|
12
|
-
`}};b([
|
|
12
|
+
`}};b([r.n({type:Array})],exports.PktDateTags.prototype,"dates",2);b([r.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);b([r.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);b([r.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=b([r.t("pkt-date-tags")],exports.PktDateTags);const L={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:L},y=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},S={validateRangeOrder(s){return!s||s.length!==2?!0:u.isValidDateRange(s[0],s[1])},sortDates(s){return u.sortDateStrings(s)},filterSelectableDates(s,e,t,a,i){return u.filterSelectableDates(s,e,t,a,i)}},V={getInputType(){return y()?"text":"date"}},k={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,a,i){var l,h,R,E;const n=s.value;n&&(t&&t>n?e.setValidity({rangeUnderflow:!0},((h=(l=i==null?void 0:i.forms)==null?void 0:l.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",s):a&&a<n&&e.setValidity({rangeOverflow:!0},((E=(R=i==null?void 0:i.forms)==null?void 0:R.messages)==null?void 0:E.rangeOverflow)||"Value is above maximum",s))}},D={addToSelected(s,e,t,a){const i=s.target;if(!i.value)return;const n=t?u.newDate(t):null,l=a?u.newDate(a):null,h=u.newDate(i.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!n||h>=n)&&(!l||h<=l)&&e.value&&e.value.handleDateSelect(h),i.value=""},handleCalendarPosition(s,e,t=!1){var h;if(!s.value||!e.value)return;const a=((h=e.value.parentElement)==null?void 0:h.getBoundingClientRect())||e.value.getBoundingClientRect(),i=t?a.height+30:a.height,n=s.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";a&&a.top+n>window.innerHeight&&a.top-n>0&&(l=`calc(100% - ${i}px - ${n}px)`),s.value.style.top=l}},T={getInputClasses(s,e,t,a,i,n){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":a,"ios-readonly-hack":i===!1&&n==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},P={processDateSelection(s,e,t){return!e&&!t?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,e,t,a,i,n){s.value&&(a&&(e!=null&&e.value)?(s.value.value=t[0]??"",e.value.value=t[1]??"",n(s.value),n(e.value)):i||(s.value.value=t.length?t[0]:"",n(s.value)))},processRangeBlur(s,e,t,a,i){var l;const n=s.target;if(n.value){i(n);const h=u.fromISOToDate(n.value);h&&((l=t==null?void 0:t.value)==null||l.handleDateSelect(h))}else e[0]&&a()}},w={handleInputKeydown(s,e,t,a,i,n){const{key:l}=s;l===","&&(s.preventDefault(),n?n(s):i&&i()),(l==="Space"||l===" ")&&(s.preventDefault(),e(s)),l==="Enter"&&(s.preventDefault(),t?t():a?a():i&&i())},handleButtonKeydown(s,e){const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))}};var U=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(s,e,t,a)=>{for(var i=a>1?void 0:a?K(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&U(e,t,i),i};let d=class extends r.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=p.e(),this.calendarRef=p.e(),this.handleDocumentClick=s=>{if(!this.open)return;const e=s.composedPath(),t=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=s=>{this.open&&s.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var s;this.open=!0,(s=this.calendarRef.value)==null||s.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(s){var e;return!!s&&!!((e=this.popupRef.value)!=null&&e.contains(s))}focusOnCurrentDate(){const s=this.calendarRef.value;s&&typeof s.focusOnCurrentDate=="function"&&s.focusOnCurrentDate()}addToSelected(s,e,t){if(typeof D.addToSelected=="function")return D.addToSelected(s,this.calendarRef,e,t)}handleDateSelect(s){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(s)}render(){const s={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return r.x`
|
|
13
13
|
<div
|
|
14
14
|
class="${m.e(s)}"
|
|
15
15
|
${p.n(this.popupRef)}
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
35
35
|
></pkt-calendar>
|
|
36
36
|
</div>
|
|
37
|
-
`}};c([
|
|
37
|
+
`}};c([r.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([r.n({type:Boolean})],d.prototype,"multiple",2);c([r.n({type:Boolean})],d.prototype,"range",2);c([r.n({type:Boolean})],d.prototype,"weeknumbers",2);c([r.n({type:Boolean})],d.prototype,"withcontrols",2);c([r.n({type:Number})],d.prototype,"maxMultiple",2);c([r.n({type:Array})],d.prototype,"selected",2);c([r.n({type:String})],d.prototype,"earliest",2);c([r.n({type:String})],d.prototype,"latest",2);c([r.n({type:Array})],d.prototype,"excludedates",2);c([r.n({type:Array})],d.prototype,"excludeweekdays",2);c([r.n({type:String})],d.prototype,"currentmonth",2);d=c([r.t("pkt-datepicker-popup")],d);var N=Object.defineProperty,v=(s,e,t,a)=>{for(var i=void 0,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=l(e,t,i)||i);return i&&N(e,t,i),i};class f extends r.PktElement{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=p.e(),this.btnRef=p.e()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return r.x`
|
|
38
38
|
<button
|
|
39
|
-
class="${m.e(
|
|
39
|
+
class="${m.e(T.getButtonClasses())}"
|
|
40
40
|
type="button"
|
|
41
41
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
42
42
|
@keydown=${t=>{const{key:a}=t;(a==="Enter"||a===" "||a==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<pkt-icon name="calendar"></pkt-icon>
|
|
47
47
|
<span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
|
|
48
48
|
</button>
|
|
49
|
-
`}createRenderRoot(){return this}}v([
|
|
49
|
+
`}createRenderRoot(){return this}}v([r.n({type:String})],f.prototype,"inputType");v([r.n({type:String})],f.prototype,"id");v([r.n({type:String})],f.prototype,"min");v([r.n({type:String})],f.prototype,"max");v([r.n({type:String})],f.prototype,"placeholder");v([r.n({type:Boolean})],f.prototype,"readonly");v([r.n({type:Boolean})],f.prototype,"disabled");v([r.n({type:Object})],f.prototype,"inputClasses");v([r.n({type:Object})],f.prototype,"internals");const O={calendar:{buttonAltText:"Åpne kalender"}},z={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var H=Object.defineProperty,W=Object.getOwnPropertyDescriptor,_=(s,e,t,a)=>{for(var i=a>1?void 0:a?W(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&H(e,t,i),i};exports.PktDatepickerSingle=class extends f{constructor(){super(...arguments),this.value="",this.strings=O}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return r.x`
|
|
50
50
|
<div class="pkt-input__container">
|
|
51
51
|
<input
|
|
52
52
|
class="${m.e(this.inputClasses)}"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
62
62
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
63
63
|
?disabled=${this.disabled}
|
|
64
|
-
@keydown=${e=>
|
|
64
|
+
@keydown=${e=>w.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>k.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()})}
|
|
65
65
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
66
66
|
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
67
67
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
/>
|
|
71
71
|
${this.renderCalendarButton()}
|
|
72
72
|
</div>
|
|
73
|
-
`}};
|
|
73
|
+
`}};_([r.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);_([r.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=_([r.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,C=(s,e,t,a)=>{for(var i=a>1?void 0:a?J(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&G(e,t,i),i};exports.PktDatepickerRange=class extends f{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=z,this.inputRefTo=p.e()}get inputElementTo(){return this.inputRefTo.value}render(){var t,a;const e=T.getRangeLabelClasses(this.showRangeLabels);return r.x`
|
|
74
74
|
<div class="pkt-input__container">
|
|
75
|
-
${this.showRangeLabels?
|
|
75
|
+
${this.showRangeLabels?r.x` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:r.E}
|
|
76
76
|
<input
|
|
77
77
|
class=${m.e(this.inputClasses)}
|
|
78
78
|
.type=${this.inputType}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
?disabled=${this.disabled}
|
|
86
86
|
@click=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
87
87
|
@touchend=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
88
|
-
@keydown=${i=>
|
|
88
|
+
@keydown=${i=>w.handleInputKeydown(i,n=>this.dispatchToggleCalendar(n),()=>k.submitFormOrFallback(this.internals,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.focus()}),()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.focus()},()=>{var n;return(n=this.inputRef.value)==null?void 0:n.blur()})}
|
|
89
89
|
@input=${i=>{this.dispatchInput(i),i.stopImmediatePropagation()}}
|
|
90
90
|
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
91
91
|
@blur=${i=>{this.dispatchBlur(i),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:i,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<div class="${m.e(e)}" id="${this.id}-to-label">
|
|
96
96
|
${(a=this.strings.generic)==null?void 0:a.to}
|
|
97
97
|
</div>
|
|
98
|
-
${this.showRangeLabels?
|
|
98
|
+
${this.showRangeLabels?r.E:r.x` <div class="pkt-input-separator">–</div> `}
|
|
99
99
|
<input
|
|
100
100
|
class=${m.e(this.inputClasses)}
|
|
101
101
|
.type=${this.inputType}
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
?disabled=${this.disabled}
|
|
110
110
|
@click=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
111
111
|
@touchend=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
112
|
-
@keydown=${i=>
|
|
112
|
+
@keydown=${i=>w.handleInputKeydown(i,n=>this.dispatchToggleCalendar(n),()=>k.submitFormOrFallback(this.internals,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.blur()}),void 0,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.blur()})}
|
|
113
113
|
@input=${i=>{this.dispatchInput(i),i.stopImmediatePropagation()}}
|
|
114
114
|
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
115
115
|
@blur=${i=>{this.dispatchBlur(i),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:i,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
/>
|
|
119
119
|
${this.renderCalendarButton()}
|
|
120
120
|
</div>
|
|
121
|
-
`}};
|
|
121
|
+
`}};C([r.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);C([r.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);C([r.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=C([r.t("pkt-datepicker-range")],exports.PktDatepickerRange);var Q=Object.defineProperty,X=Object.getOwnPropertyDescriptor,x=(s,e,t,a)=>{for(var i=a>1?void 0:a?X(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&Q(e,t,i),i};exports.PktDatepickerMultiple=class extends f{constructor(){super(...arguments),this.value=[],this.strings=O}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return r.x`
|
|
122
122
|
<div class="pkt-input__container">
|
|
123
123
|
<input
|
|
124
124
|
class=${m.e(this.inputClasses)}
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
135
135
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
136
136
|
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
137
|
-
@keydown=${e=>
|
|
137
|
+
@keydown=${e=>w.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>k.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
138
138
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
139
139
|
${p.n(this.inputRef)}
|
|
140
140
|
/>
|
|
141
141
|
${this.renderCalendarButton()}
|
|
142
142
|
</div>
|
|
143
|
-
`}};
|
|
143
|
+
`}};x([r.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);x([r.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);x([r.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=x([r.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var Y=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,o=(s,e,t,a)=>{for(var i=a>1?void 0:a?Z(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&Y(e,t,i),i};exports.PktDatepicker=class extends A.PktInputElement{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=p.e(),this._value=[],this.label="Datovelger",this.dateformat=$.props.dateformat.default,this.multiple=$.props.multiple.default,this.maxlength=null,this.range=$.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$.props.weeknumbers.default,this.withcontrols=$.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=p.e(),this.popupRef=p.e(),this.helptextSlot=p.e(),this.singleInputRef=p.e(),this.rangeInputRef=p.e(),this.multipleInputRef=p.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):D.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new j.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return V.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(e===t)return;const a=u.valueToArray(e),i=this.multiple&&a.length>1?S.filterSelectableDates(a,this.min,this.max,this.excludedates,this.excludeweekdays):a;if(this.range&&!S.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const n=u.arrayToCsv(i);this._valueProperty!==n&&(this._valueProperty=n),super.valueChanged(n,t)}attributeChangedCallback(e,t,a){e==="value"&&this.value!==t&&this.valueChanged(a,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=u.valueToArray(a||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=u.valueToArray(a||"")),super.attributeChangedCallback(e,t,a)}updated(e){if(e.has("value")){const t=Array.isArray(this.value)?this.value.join(","):this.value,a=e.get("value"),i=Array.isArray(a)?a.join(","):a;this.valueChanged(t,i)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=u.valueToArray(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(a=this.singleInputRef.value)==null?void 0:a.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(a=this.singleInputRef.value)==null?void 0:a.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return r.x`
|
|
144
144
|
<pkt-datepicker-single
|
|
145
145
|
.value=${this._value[0]??""}
|
|
146
146
|
.inputType=${this.inputType}
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
@input-changed=${()=>{this.touched=!0}}
|
|
163
163
|
${p.n(this.singleInputRef)}
|
|
164
164
|
></pkt-datepicker-single>
|
|
165
|
-
`}renderRangeInput(){return
|
|
165
|
+
`}renderRangeInput(){return r.x`
|
|
166
166
|
<pkt-datepicker-range
|
|
167
167
|
.value=${this._value}
|
|
168
168
|
.inputType=${this.inputType}
|
|
@@ -180,14 +180,14 @@
|
|
|
180
180
|
@input-change=${()=>this.onInput()}
|
|
181
181
|
@input-focus=${()=>this.onFocus()}
|
|
182
182
|
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
183
|
-
@range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,n=a.value;if(i&&n&&i>n)a.value="",this._value=[i],this.value=i;else{const
|
|
183
|
+
@range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,n=a.value;if(i&&n&&i>n)a.value="",this._value=[i],this.value=i;else{const l=[i,n].filter(Boolean);l.length>0&&(l[0]!==this._value[0]||l[1]!==this._value[1])&&(this._value=l,this.value=l.join(","))}}P.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
|
|
184
184
|
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
185
185
|
@validate-date-input=${e=>{k.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
186
186
|
@handle-date-select=${e=>{var a,i;const t=u.fromISOToDate(e.detail);if(t){const n=u.formatISODate(t);this._value[0]!==n&&this._value[1]!==n&&((i=(a=this.calRef)==null?void 0:a.value)==null||i.handleDateSelect(t))}}}
|
|
187
187
|
@input-changed=${()=>{this.touched=!0}}
|
|
188
188
|
${p.n(this.rangeInputRef)}
|
|
189
189
|
></pkt-datepicker-range>
|
|
190
|
-
`}renderMultipleInput(){return
|
|
190
|
+
`}renderMultipleInput(){return r.x`
|
|
191
191
|
<pkt-datepicker-multiple
|
|
192
192
|
.value=${this._value}
|
|
193
193
|
.inputType=${this.inputType}
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
@input-changed=${()=>{this.touched=!0}}
|
|
210
210
|
${p.n(this.multipleInputRef)}
|
|
211
211
|
></pkt-datepicker-multiple>
|
|
212
|
-
`}renderCalendar(){return
|
|
212
|
+
`}renderCalendar(){return r.x`
|
|
213
213
|
<pkt-datepicker-popup
|
|
214
214
|
class="pkt-contents"
|
|
215
215
|
?open=${this.calendarOpen}
|
|
@@ -224,11 +224,11 @@
|
|
|
224
224
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
225
225
|
.excludeweekdays=${this.excludeweekdays}
|
|
226
226
|
.currentmonth=${this.currentmonth?u.parseISODateString(this.currentmonth):null}
|
|
227
|
-
@date-selected=${e=>{this.value=
|
|
227
|
+
@date-selected=${e=>{this.value=P.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,P.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
228
228
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
229
229
|
${p.n(this.datepickerPopupRef)}
|
|
230
230
|
></pkt-datepicker-popup>
|
|
231
|
-
`}render(){return this.inputClasses=
|
|
231
|
+
`}render(){return this.inputClasses=T.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),r.x`
|
|
232
232
|
<pkt-input-wrapper
|
|
233
233
|
label="${this.label}"
|
|
234
234
|
forId="${this.id}-input"
|
|
@@ -254,13 +254,13 @@
|
|
|
254
254
|
class="pkt-datepicker"
|
|
255
255
|
>
|
|
256
256
|
<div class="pkt-contents" ${p.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
257
|
-
${this.multiple?
|
|
257
|
+
${this.multiple?r.x`<pkt-date-tags
|
|
258
258
|
.dates=${this._value}
|
|
259
259
|
dateformat=${this.dateformat}
|
|
260
260
|
strings=${this.strings}
|
|
261
261
|
id-base=${this.id}
|
|
262
262
|
@date-tag-removed=${e=>{var i;const t=this.datepickerPopupRef.value,a=u.fromISOToDate(e.detail);t&&a&&typeof t.handleDateSelect=="function"?t.handleDateSelect(a):(i=this.calRef.value)==null||i.handleDateSelect(a)}}
|
|
263
|
-
></pkt-date-tags>`:
|
|
263
|
+
></pkt-date-tags>`:r.E}
|
|
264
264
|
<div
|
|
265
265
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
266
266
|
>
|
|
@@ -268,4 +268,4 @@
|
|
|
268
268
|
</div>
|
|
269
269
|
</pkt-input-wrapper>
|
|
270
270
|
${this.renderCalendar()}
|
|
271
|
-
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;
|
|
271
|
+
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;D.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),y()&&e.focusOnCurrentDate();return}await I.sleep(20),this.handleCalendarPosition(),y()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const a=!!t.open;t.toggle(),this.calendarOpen=!a;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);o([r.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);o([r.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);o([r.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);o([r.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);o([r.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);o([r.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);o([B.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=o([r.t("pkt-datepicker")],exports.PktDatepicker);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/const C=globalThis,H=C.trustedTypes,J=H?H.createPolicy("lit-html",{createHTML:r=>r}):void 0,it="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,rt="?"+_,ct=`<${rt}>`,y=document,U=()=>y.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",B=Array.isArray,dt=r=>B(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",L=`[
|
|
6
|
-
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,Z=/>/g,
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,G=/"/g,nt=/^(?:script|style|textarea|title)$/i,pt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ut=pt(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Q=new WeakMap,
|
|
6
|
+
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,Z=/>/g,g=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,G=/"/g,nt=/^(?:script|style|textarea|title)$/i,pt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ut=pt(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Q=new WeakMap,m=y.createTreeWalker(y,129);function ot(r,t){if(!B(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return J!==void 0?J.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=W:p[1]!==void 0?o=Z:p[2]!==void 0?(nt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=g):p[3]!==void 0&&(o=g):o===g?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?g:p[3]==='"'?G:K):o===G||o===K?o=g:o===W||o===Z?o=P:(o=g,i=void 0);const $=o===g&&r[a+1].startsWith("/>")?" ":"";n+=o===P?h+ct:l>=0?(s.push(c),h.slice(0,l)+it+h.slice(l)+_+$):h+_+(l===-2?a:$)}return[ot(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class M{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=M.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=m.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(it)){const u=p[o++],$=i.getAttribute(l).split(_),T=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:T[2],strings:$,ctor:T[1]==="."?ft:T[1]==="?"?gt:T[1]==="@"?mt:R}),i.removeAttribute(l)}else l.startsWith(_)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(nt.test(i.tagName)){const l=i.textContent.split(_),u=l.length-1;if(u>0){i.textContent=H?H.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],U()),m.nextNode(),h.push({type:2,index:++n});i.append(l[u],U())}}}else if(i.nodeType===8)if(i.data===rt)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)h.push({type:7,index:n}),l+=_.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=O(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 _t{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);m.currentNode=i;let n=m.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 At(n,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=m.nextNode(),o++)}return m.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),O(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):dt(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&&O(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=M.createElement(ot(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 _t(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Q.get(t.strings);return e===void 0&&Q.set(t.strings,e=new M(t)),e}k(t){B(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(U()),this.O(U()),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=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class R{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=!O(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=!O(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 ft extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class gt extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class mt extends R{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 At{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 yt={I:w},j=C.litHtmlPolyfillSupport;j==null||j(M,w),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.1");const vt=(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(U(),n),n,void 0,e??{})}return i._$AI(r),i};/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
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=vt(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 st;S._$litElement$=!0,S.finalized=!0,(st=A.litElementHydrateSupport)==null||st.call(A,{LitElement:S});const I=A.litElementPolyfillSupport;I==null||I({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.1");const Nt={hi:"Hei!"},Rt={from:"Fra",to:"Til"},Dt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Lt={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"},jt={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",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."}},at={example:Nt,generic:Rt,calendar:Dt,dates:Lt,forms:jt};var zt=Object.defineProperty,lt=(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&&zt(t,e,i),i};class D extends S{constructor(){super(...arguments),this.strings=at,this.role=null}hotReplacedCallback(){this.requestUpdate()}}lt([V({type:Object})],D.prototype,"strings");lt([V({type:String})],D.prototype,"role");class It extends D{createRenderRoot(){return this}}exports.E=d;exports.PktElement=It;exports.PktShadowElement=D;exports.T=v;exports.Z=yt;exports.i=S;exports.n=V;exports.
|
|
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=vt(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 st;S._$litElement$=!0,S.finalized=!0,(st=A.litElementHydrateSupport)==null||st.call(A,{LitElement:S});const I=A.litElementPolyfillSupport;I==null||I({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.1");const Nt={hi:"Hei!"},Rt={from:"Fra",to:"Til"},Dt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Lt={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"},jt={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",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."}},at={example:Nt,generic:Rt,calendar:Dt,dates:Lt,forms:jt};var zt=Object.defineProperty,lt=(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&&zt(t,e,i),i};class D extends S{constructor(){super(...arguments),this.strings=at,this.role=null}hotReplacedCallback(){this.requestUpdate()}}lt([V({type:Object})],D.prototype,"strings");lt([V({type:String})],D.prototype,"role");class It extends D{createRenderRoot(){return this}}exports.E=d;exports.PktElement=It;exports.PktShadowElement=D;exports.T=v;exports.Z=yt;exports.i=S;exports.n=V;exports.strings=at;exports.t=Et;exports.x=ut;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./element-
|
|
1
|
+
"use strict";const i=require("./element-aUzIoa1s.cjs");var n=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(r,e,l,t)=>{for(var s=t>1?void 0:t?u(e,l):e,d=r.length-1,h;d>=0;d--)(h=r[d])&&(s=(t?h(e,l,s):h(s))||s);return t&&s&&n(e,l,s),s};exports.PktHeading=class extends i.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,l,t){super.attributeChangedCallback(e,l,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()}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 i.x`<slot></slot>`}};a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);a([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"weight",2);a([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=a([i.t("pkt-heading")],exports.PktHeading);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var o = Object.defineProperty, c = Object.getOwnPropertyDescriptor,
|
|
3
|
-
for (var i = h > 1 ? void 0 : h ? c(
|
|
4
|
-
(u = e[d]) && (i = (h ? u(
|
|
5
|
-
return h && i && o(
|
|
1
|
+
import { a as n, x as g, n as r, t as p } from "./element-BXsf_NlG.js";
|
|
2
|
+
var o = Object.defineProperty, c = Object.getOwnPropertyDescriptor, a = (e, l, t, h) => {
|
|
3
|
+
for (var i = h > 1 ? void 0 : h ? c(l, t) : l, d = e.length - 1, u; d >= 0; d--)
|
|
4
|
+
(u = e[d]) && (i = (h ? u(l, t, i) : u(i)) || i);
|
|
5
|
+
return h && i && o(l, t, i), i;
|
|
6
6
|
};
|
|
7
7
|
let s = class extends n {
|
|
8
8
|
constructor() {
|
|
@@ -11,8 +11,8 @@ let s = class extends n {
|
|
|
11
11
|
connectedCallback() {
|
|
12
12
|
super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
|
|
13
13
|
}
|
|
14
|
-
attributeChangedCallback(e,
|
|
15
|
-
super.attributeChangedCallback(e,
|
|
14
|
+
attributeChangedCallback(e, l, t) {
|
|
15
|
+
super.attributeChangedCallback(e, l, 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
16
|
}
|
|
17
17
|
updated(e) {
|
|
18
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();
|
|
@@ -78,22 +78,22 @@ let s = class extends n {
|
|
|
78
78
|
return g`<slot></slot>`;
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
a([
|
|
82
82
|
r({ type: String, reflect: !0 })
|
|
83
83
|
], s.prototype, "size", 2);
|
|
84
|
-
|
|
84
|
+
a([
|
|
85
85
|
r({ type: Number, reflect: !0 })
|
|
86
86
|
], s.prototype, "level", 2);
|
|
87
|
-
|
|
87
|
+
a([
|
|
88
88
|
r({ type: String, reflect: !0 })
|
|
89
89
|
], s.prototype, "weight", 2);
|
|
90
|
-
|
|
90
|
+
a([
|
|
91
91
|
r({ type: Boolean, reflect: !0 })
|
|
92
92
|
], s.prototype, "visuallyHidden", 2);
|
|
93
|
-
|
|
93
|
+
a([
|
|
94
94
|
r({ type: String, reflect: !0 })
|
|
95
95
|
], s.prototype, "align", 2);
|
|
96
|
-
s =
|
|
96
|
+
s = a([
|
|
97
97
|
p("pkt-heading")
|
|
98
98
|
], s);
|
|
99
99
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-aUzIoa1s.cjs"),x=require("./ref-C5iJMIE1.cjs"),h=require("./icon-Dl9ZPqe6.cjs"),u=require("./class-map-CApIYSRo.cjs"),a=require("./state-GDzxl12x.cjs"),c=require("./utils-byXsEz1u.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,l=(o,p,r,n)=>{for(var e=n>1?void 0:n?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(n?i(p,r,e):i(e))||e);return n&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),n=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
2
|
<button
|
|
3
3
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
4
|
type="button"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as c, x as a, E as f, n as r,
|
|
2
|
-
import { e as _, n as m } from "./ref-
|
|
3
|
-
import { o as x } from "./icon-
|
|
4
|
-
import { e as d } from "./class-map-
|
|
5
|
-
import { r as u } from "./state-
|
|
1
|
+
import { P as c, x as a, E as f, n as r, t as w } from "./element-BXsf_NlG.js";
|
|
2
|
+
import { e as _, n as m } from "./ref-BxiKhrfa.js";
|
|
3
|
+
import { o as x } from "./icon-BgG6oO4Q.js";
|
|
4
|
+
import { e as d } from "./class-map-Dt2jXOlF.js";
|
|
5
|
+
import { r as u } from "./state-DgnkjP0q.js";
|
|
6
6
|
import { u as k } from "./utils-DznhwRXm.js";
|
|
7
7
|
import { s as v } from "./input-wrapper-CDgenrYA.js";
|
|
8
8
|
import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-
|
|
1
|
+
"use strict";const o=require("./element-aUzIoa1s.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|