@oslokommune/punkt-elements 12.30.2 → 12.31.0
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/dist/{alert-CP5oN7df.cjs → alert-BDxxRqgi.cjs} +1 -1
- package/dist/{alert-CugVni4g.js → alert-D0S57u0r.js} +5 -5
- package/dist/backlink-CzpB-ih9.js +46 -0
- package/dist/backlink-Dn4DfWVR.cjs +13 -0
- package/dist/backlink.d.ts +15 -0
- package/dist/{button-BCcznC7Q.js → button-9NwGr-OS.js} +2 -2
- package/dist/{button-rngMU-vh.cjs → button-Beo3c7cx.cjs} +1 -1
- package/dist/{calendar-DevhqUoj.js → calendar-BbZNxsKY.js} +4 -4
- package/dist/{calendar-DUkAC9Hx.cjs → calendar-CxBo98iI.cjs} +1 -1
- package/dist/{card-CGMZxbH_.js → card-B0uNyDCw.js} +6 -6
- package/dist/{card-D6VEEvX3.cjs → card-BWslf2mu.cjs} +1 -1
- package/dist/{checkbox-CDMUepTW.cjs → checkbox-9Zjy_NU7.cjs} +1 -1
- package/dist/{checkbox-Dw2CX5zY.js → checkbox-CzDpR6_8.js} +11 -11
- package/dist/{class-map-BYCG9U47.js → class-map-DWtqmIRS.js} +10 -9
- package/dist/class-map-Dj5mbCUg.cjs +5 -0
- package/dist/datepicker-BczZqaup.cjs +155 -0
- package/dist/{datepicker-LKIwV9DD.js → datepicker-CQZ84VOS.js} +18 -17
- package/dist/directive-B76A7YXI.js +27 -0
- package/dist/directive-C_VV3qwo.cjs +5 -0
- package/dist/{element-D_ZgQsSr.js → element-C7XjZtLU.js} +401 -426
- package/dist/{element-r-PeQ419.cjs → element-CzFXQBoS.cjs} +23 -27
- package/dist/{helptext-C0mrdhRi.cjs → helptext-B9kxDc2b.cjs} +1 -1
- package/dist/{helptext-RPq_TKzJ.js → helptext-CqnoPodd.js} +5 -5
- package/dist/{icon-BBFK-d-X.js → icon-BEUgV9Wo.js} +18 -17
- package/dist/icon-BOKusjAA.cjs +9 -0
- package/dist/{if-defined-CWHk9Kqm.cjs → if-defined-CpIkv1A4.cjs} +1 -1
- package/dist/{if-defined-u8oGOhnv.js → if-defined-eRX4e5zO.js} +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/{input-element-B6BTwL1q.js → input-element-BK8UkQli.js} +32 -20
- package/dist/input-element-Dtyuf6s8.cjs +1 -0
- package/dist/{input-wrapper-Dqj4uers.cjs → input-wrapper-Bo2_t6pA.cjs} +1 -1
- package/dist/{input-wrapper-D-pEAZaj.js → input-wrapper-DaZZq8c0.js} +6 -6
- package/dist/{link-C_bwx1Ml.cjs → link-1iq0Pmuf.cjs} +1 -1
- package/dist/{link-CDkU7zsB.js → link-D3U0Jkz8.js} +4 -4
- package/dist/{linkcard-C6mZOE0R.cjs → linkcard-2WzDJPZz.cjs} +1 -1
- package/dist/{linkcard-Dr5iKZrV.js → linkcard-CRpo3tiw.js} +3 -3
- package/dist/{loader-ChVEsONa.js → loader-B1edLWTg.js} +5 -5
- package/dist/{loader-DQV1hMM3.cjs → loader-DI74pe25.cjs} +1 -1
- package/dist/{messagebox-BSyLVNas.cjs → messagebox-DQpEMkS2.cjs} +1 -1
- package/dist/{messagebox-Di7LUz4C.js → messagebox-KP-8-tA9.js} +5 -5
- package/dist/{modal-DZUQb_yG.js → modal-kPX8nO_L.js} +5 -5
- package/dist/{modal-CblCiNUi.cjs → modal-ytIJwfr3.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -0
- package/dist/pkt-backlink.js +6 -0
- 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-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.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 +3 -3
- package/dist/pkt-index.js +46 -44
- 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-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-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-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-B6A9UVXS.cjs +21 -0
- package/dist/{progressbar-CuZj4FWi.js → progressbar-D0nxLqHu.js} +14 -13
- package/dist/radiobutton-BWyQgR_x.cjs +24 -0
- package/dist/radiobutton-DLWjvLBO.js +88 -0
- package/dist/ref-2anvRHT4.cjs +13 -0
- package/dist/{ref-BSGI8ogR.js → ref-DbOSDQbk.js} +27 -26
- package/dist/{select-CnizDIYN.js → select-CzuxXKll.js} +6 -6
- package/dist/{select-DJu4Wr1y.cjs → select-DZL6aa2s.cjs} +1 -1
- package/dist/{state-DuS4ffEQ.js → state-CDQk0DFQ.js} +1 -1
- package/dist/{state-B77EXPZ9.cjs → state-HNj0_316.cjs} +1 -1
- package/dist/{tag-BFqxindw.js → tag-CHtPXyP5.js} +5 -5
- package/dist/{tag-B3KEILId.cjs → tag-D6ARkq2Z.cjs} +1 -1
- package/dist/{textarea-uzzCtHtj.js → textarea-BPqWCymU.js} +17 -16
- package/dist/textarea-VG-UTMLP.cjs +49 -0
- package/dist/{textinput-BRupcl9v.cjs → textinput-CEP7QA3E.cjs} +1 -1
- package/dist/{textinput-DRkv93vp.js → textinput-VD74aGzx.js} +8 -8
- package/package.json +3 -3
- package/src/components/backlink/backlink.ts +52 -0
- package/src/components/backlink/index.ts +6 -0
- package/src/components/checkbox/checkbox.ts +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/radiobutton/radiobutton.ts +13 -3
- package/dist/class-map-Dzci3Pfe.cjs +0 -5
- package/dist/datepicker-NbLoqIKZ.cjs +0 -155
- package/dist/icon-DcJIqTIY.cjs +0 -9
- package/dist/input-element-KOSm5htR.cjs +0 -1
- package/dist/progressbar-C_q48_qh.cjs +0 -21
- package/dist/radiobutton-3e105CXX.cjs +0 -24
- package/dist/radiobutton-CcZ2-z8q.js +0 -88
- package/dist/ref-BUWgvhgU.cjs +0 -13
- package/dist/textarea-BKCVcJ6E.cjs +0 -49
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";const $=require("./class-map-Dzci3Pfe.cjs"),k=require("./if-defined-CWHk9Kqm.cjs"),a=require("./element-r-PeQ419.cjs"),T=require("./state-B77EXPZ9.cjs"),g=require("./calendar-DUkAC9Hx.cjs"),S=require("./input-element-KOSm5htR.cjs"),r=require("./ref-BUWgvhgU.cjs");require("./icon-DcJIqTIY.cjs");require("./input-wrapper-Dqj4uers.cjs");require("./tag-B3KEILId.cjs");const P=require("./pkt-slot-controller-Oc32unDk.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const R=(o,e,t)=>{const i=new Map;for(let s=e;s<=t;s++)i.set(o[s],s);return i},I=a.e(class extends a.i{constructor(o){if(super(o),o.type!==a.t$1.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const s=[],n=[];let l=0;for(const c of o)s[l]=i?i(c,l):l,n[l]=t(c,l),l++;return{values:n,keys:s}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,i]){const s=r.p(o),{values:n,keys:l}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=l,n;const c=this.ut??(this.ut=[]),m=[];let b,w,u=0,h=s.length-1,d=0,f=n.length-1;for(;u<=h&&d<=f;)if(s[u]===null)u++;else if(s[h]===null)h--;else if(c[u]===l[d])m[d]=r.v(s[u],n[d]),u++,d++;else if(c[h]===l[f])m[f]=r.v(s[h],n[f]),h--,f--;else if(c[u]===l[f])m[f]=r.v(s[u],n[f]),r.r(o,m[f+1],s[u]),u++,f--;else if(c[h]===l[d])m[d]=r.v(s[h],n[d]),r.r(o,s[u],s[h]),h--,d++;else if(b===void 0&&(b=R(l,d,f),w=R(c,u,h)),b.has(c[u]))if(b.has(c[h])){const v=w.get(l[d]),x=v!==void 0?s[v]:null;if(x===null){const D=r.r(o,s[u]);r.v(D,n[d]),m[d]=D}else m[d]=r.v(x,n[d]),r.r(o,s[u],x),s[v]=null;d++}else r.M(s[h]),h--;else r.M(s[u]),u++;for(;d<=f;){const v=r.r(o,m[f+1]);r.v(v,n[d]),m[d++]=v}for(;u<=h;){const v=s[u++];v!==null&&r.M(v)}return this.ut=l,r.m(o,m),a.T}}),_="pkt-datepicker",O=!0,E={name:{type:"string",name:"Navn",description:"Navn som sendes brukes i skjema ved innsending"},label:{type:"string",name:"Etikett",description:"Tekst som vises over datovelgeren"},helptext:{type:"string",name:"Hjelpetekst",description:"Hjelpetekst som vises over datovelgeren"},helptextDropdown:{type:"string",name:"Utvidet hjelpetekst",description:"Hjelpetekst som vises i en lukket boks man kan åpne"},helptextDropdownButton:{type:"string",name:"Knappetekst for hjelpetekst",description:"Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst",default:"Les mer"},dateformat:{name:"Datoformat",description:"Datoformat for valgte datoer i flervalgsmodus",type:"string",default:"dd.MM.yyyy"},currentmonth:{name:"Nåværende måned",type:"ISOdatestring",description:"Måneden som skal vises i datovelgeren"},value:{name:"Verdi",type:"ISOdatestring",variant:"multiple",reflect:!0,description:"Kommaseparert liste av valgte datoer"},excludeweekdays:{name:"Utelat ukedager",type:"string",description:"Kommaseparert liste over ukedager (1-7) som skal ekskluderes"},excludedates:{name:"Utelat datoer",type:"ISOdatestring",variant:"multiple",description:"Kommaseparert liste over datoer som skal ekskluderes"},min:{name:"Tidligst tillatt",type:"ISOdatestring",default:null,description:"Første tillate dato i datovelgeren"},max:{name:"Senest tillatt",type:"ISOdatestring",default:null,description:"Siste tillate dato i datovelgeren"},weeknumbers:{name:"Vis ukenummer",type:"boolean",reflect:!0,default:!1,description:"Vis ukedager i datovelgerens kalender"},withcontrols:{name:"Med kontroller",type:"boolean",reflect:!0,default:!1,description:"Vis avanserte velgere for måned og år"},multiple:{name:"Flervalg",type:"boolean",reflect:!0,default:!1,description:"Tillat valg av flere enn én dato i samme velger"},maxlength:{name:"Maks antall",description:"Maks valgte datoer i flervalgsmodus",type:"number"},range:{name:"Datotidsrom",type:"boolean",reflect:!0,default:!1,description:"Tillat å velge et tidsrom mellom to datoer i samme velger"},hasError:{type:"boolean",name:"Feil",default:!1,description:"Viser feiltilstand for datovelgeren"},errorMessage:{type:"string",name:"Feilmelding",description:"Tekst som vises under datovelgeren ved feiltilstand"},disabled:{type:"boolean",name:"Deaktivert",default:!1,reflect:!0,description:"Er datovelgeren deaktivert?"},fullwidth:{type:"boolean",name:"Full bredde",default:!1,reflect:!0,description:"Skal datovelgeren ta opp hele bredden?"},required:{type:"boolean",name:"Påkrevd",default:!1,reflect:!0,description:"Er datovelgeren påkrevd?"},requiredTag:{type:"boolean",name:"Vise påkrevd-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er påkrevd"},requiredText:{type:"string",name:"Påkrevd-tekst",default:"Må fylles ut",description:"Tekst som vises i påkrevd-merkingen"},optionalTag:{type:"boolean",name:"Vise valgfritt-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er valgfri"},optionalText:{type:"string",name:"Valgfritt-tekst",default:"Valgfritt",description:"Tekst som vises i valgfritt-merkingen"},useWrapper:{type:"boolean",name:"Bruk wrapper",description:"Indikerer at feltet skal ha synlig label og hjelpetekst",displayAsFalse:!0,default:!0},id:{type:"string",name:"ID",description:"Unik identifikasjon for datovelgeren"}},M={change:{type:"Event",description:"Returnerer valgt dato som streng i ISO-format"},"value-change":{type:"CustomEvent",description:"Returnerer en <code>array</code> med valgte datoer i ISO-format"},toggleHelpText:{type:"CustomEvent",description:"Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"}},y={name:_,"css-class":"pkt-datepicker",isElement:O,props:E,events:M};var B=Object.defineProperty,q=Object.getOwnPropertyDescriptor,p=(o,e,t,i)=>{for(var s=i>1?void 0:i?q(e,t):e,n=o.length-1,l;n>=0;n--)(l=o[n])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&B(e,t,s),s};const C=o=>new Promise(e=>setTimeout(e,o));exports.PktDatepicker=class extends S.PktInputElement{constructor(){super(),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.dateformat=y.props.dateformat.default,this.multiple=y.props.multiple.default,this.maxlength=null,this.range=y.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=y.props.weeknumbers.default,this.withcontrols=y.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.buttonClasses={},this.inputRef=r.e(),this.inputRefTo=r.e(),this.btnRef=r.e(),this.calRef=r.e(),this.popupRef=r.e(),this.helptextSlot=r.e(),this.addToSelected=e=>{const t=e.target;if(!t.value)return;const i=this.min?g.newDate(this.min):null,s=this.max?g.newDate(this.max):null,n=g.newDate(t.value.split(",")[0]);n&&!isNaN(n.getTime())&&(!i||n>=i)&&(!s||n<=s)&&this.calRef.value&&this.calRef.value.handleDateSelect(n),t.value=""},this.slotController=new P.PktSlotController(this,this.helptextSlot)}async connectedCallback(){super.connectedCallback(),this.isMobileSafari=/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),this.inputType=this.isMobileSafari?"text":"date",document&&document.body.addEventListener("click",e=>{var t,i;(t=this.inputRef)!=null&&t.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(e.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(e.target))&&!this.btnRef.value.contains(e.target)&&!e.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||y.props.min.default,this.max=this.max||y.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await C(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",e=>{var t,i;(t=this.inputRef)!=null&&t.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(e.target)&&!this.btnRef.value.contains(e.target)&&this.hideCalendar()})}attributeChangedCallback(e,t,i){if(e==="value"){if(this.range&&(i==null?void 0:i.split(",").length)===1)return;this.value!==t&&this.valueChanged(i,t)}e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(i==null?void 0:i.split(","))??[]),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(i==null?void 0:i.split(","))??[]),super.attributeChangedCallback(e,t,i)}updated(e){if(e.has("value")){if(this.range&&this.value.length===1)return;this.valueChanged(this.value,e.get("value"))}super.updated(e)}renderInput(){return a.x`
|
|
6
|
-
<input
|
|
7
|
-
class="${$.e(this.inputClasses)}"
|
|
8
|
-
.type=${this.inputType}
|
|
9
|
-
id="${this.id}-input"
|
|
10
|
-
.value=${this._value[0]??""}
|
|
11
|
-
min=${k.o(this.min)}
|
|
12
|
-
max=${k.o(this.max)}
|
|
13
|
-
@click=${e=>{e.preventDefault(),this.showCalendar()}}
|
|
14
|
-
?disabled=${this.disabled}
|
|
15
|
-
@keydown=${e=>{var t;(e.key===","||e.key==="Enter")&&((t=this.inputRef.value)==null||t.blur()),(e.key==="Space"||e.key===" ")&&(e.preventDefault(),this.toggleCalendar(e))}}
|
|
16
|
-
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
17
|
-
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
18
|
-
@blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.relatedTarget)||this.onBlur(),this.manageValidity(e.target),this.value=e.target.value}}
|
|
19
|
-
@change=${e=>{e.stopImmediatePropagation()}}
|
|
20
|
-
${r.n(this.inputRef)}
|
|
21
|
-
/>
|
|
22
|
-
`}renderRangeInput(){const e={"pkt-input-prefix":this.showRangeLabels,"pkt-hide":!this.showRangeLabels};return a.x`
|
|
23
|
-
${this.showRangeLabels?a.x` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:a.E}
|
|
24
|
-
<input
|
|
25
|
-
class=${$.e(this.inputClasses)}
|
|
26
|
-
.type=${this.inputType}
|
|
27
|
-
id="${this.id}-input"
|
|
28
|
-
.value=${this._value[0]??""}
|
|
29
|
-
min=${k.o(this.min)}
|
|
30
|
-
max=${k.o(this.max)}
|
|
31
|
-
?disabled=${this.disabled}
|
|
32
|
-
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
33
|
-
@keydown=${t=>{var i;(t.key===","||t.key==="Enter")&&((i=this.inputRef.value)==null||i.blur()),(t.key==="Space"||t.key===" ")&&(t.preventDefault(),this.toggleCalendar(t))}}
|
|
34
|
-
@input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
|
|
35
|
-
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
36
|
-
@blur=${t=>{var i,s;if(t.target.value){this.manageValidity(t.target);const n=g.fromISOToDate(t.target.value);n&&this._value[0]!==t.target.value&&this._value[1]&&(this.clearInputValue(),(s=(i=this.calRef)==null?void 0:i.value)==null||s.handleDateSelect(n))}else this._value[0]&&this.clearInputValue()}}
|
|
37
|
-
@change=${t=>{t.stopImmediatePropagation()}}
|
|
38
|
-
${r.n(this.inputRef)}
|
|
39
|
-
/>
|
|
40
|
-
<div class="${$.e(e)}" id="${this.id}-to-label">
|
|
41
|
-
${this.strings.generic.to}
|
|
42
|
-
</div>
|
|
43
|
-
${this.showRangeLabels?a.E:a.x` <div class="pkt-input-separator">–</div> `}
|
|
44
|
-
<input
|
|
45
|
-
class=${$.e(this.inputClasses)}
|
|
46
|
-
.type=${this.inputType}
|
|
47
|
-
id="${this.id}-to"
|
|
48
|
-
aria-labelledby="${this.id}-to-label"
|
|
49
|
-
.value=${this._value[1]??""}
|
|
50
|
-
min=${k.o(this.min)}
|
|
51
|
-
max=${k.o(this.max)}
|
|
52
|
-
?disabled=${this.disabled}
|
|
53
|
-
@click=${t=>{t.preventDefault(),this.showCalendar()}}
|
|
54
|
-
@keydown=${t=>{var i;(t.key===","||t.key==="Enter")&&((i=this.inputRefTo.value)==null||i.blur()),(t.key==="Space"||t.key===" ")&&(t.preventDefault(),this.toggleCalendar(t))}}
|
|
55
|
-
@input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
|
|
56
|
-
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
57
|
-
@blur=${t=>{var i,s,n;if((i=this.calRef.value)!=null&&i.contains(t.relatedTarget)||this.onBlur(),t.target.value){this.manageValidity(t.target);const l=t.target.value;this.min&&this.min>l?this.internals.setValidity({rangeUnderflow:!0},this.strings.forms.messages.rangeUnderflow,t.target):this.max&&this.max<l&&this.internals.setValidity({rangeOverflow:!0},this.strings.forms.messages.rangeOverflow,t.target);const c=g.fromISOToDate(t.target.value);c&&this._value[1]!==g.formatISODate(c)&&((n=(s=this.calRef)==null?void 0:s.value)==null||n.handleDateSelect(c))}}}
|
|
58
|
-
@change=${t=>{t.stopImmediatePropagation()}}
|
|
59
|
-
${r.n(this.inputRefTo)}
|
|
60
|
-
/>
|
|
61
|
-
`}renderMultipleInput(){return a.x`
|
|
62
|
-
<input
|
|
63
|
-
class=${$.e(this.inputClasses)}
|
|
64
|
-
.type=${this.inputType}
|
|
65
|
-
id="${this.id}-input"
|
|
66
|
-
min=${k.o(this.min)}
|
|
67
|
-
max=${k.o(this.max)}
|
|
68
|
-
?disabled=${this.disabled||this.maxlength&&this._value.length>=this.maxlength}
|
|
69
|
-
@click=${e=>{e.preventDefault(),this.showCalendar()}}
|
|
70
|
-
@blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.relatedTarget)||this.onBlur(),this.addToSelected(e)}}
|
|
71
|
-
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
72
|
-
@focus=${()=>{this.onFocus(),this.isMobileSafari&&this.showCalendar()}}
|
|
73
|
-
@keydown=${e=>{(e.key===","||e.key==="Enter")&&(e.preventDefault(),this.addToSelected(e)),(e.key==="Space"||e.key===" ")&&(e.preventDefault(),this.toggleCalendar(e))}}
|
|
74
|
-
@change=${e=>{e.stopImmediatePropagation()}}
|
|
75
|
-
${r.n(this.inputRef)}
|
|
76
|
-
/>
|
|
77
|
-
`}renderTags(){return a.x`
|
|
78
|
-
<div class="pkt-datepicker__tags" aria-live="polite">
|
|
79
|
-
${this._value[0]?I(this._value??[],e=>e,e=>a.x`
|
|
80
|
-
<pkt-tag
|
|
81
|
-
.id="${this.id+e+"-tag"}"
|
|
82
|
-
closeTag
|
|
83
|
-
ariaLabel="${this.strings.calendar.deleteDate} ${g.fromISOtoLocal(e,this.dateformat)}"
|
|
84
|
-
@close=${()=>{var t;return(t=this.calRef.value)==null?void 0:t.handleDateSelect(g.fromISOToDate(e))}}
|
|
85
|
-
><time datetime="${e}">${g.fromISOtoLocal(e,this.dateformat)}</time></pkt-tag
|
|
86
|
-
>
|
|
87
|
-
`):a.E}
|
|
88
|
-
</div>
|
|
89
|
-
`}renderCalendar(){return a.x`<div
|
|
90
|
-
class="pkt-calendar-popup pkt-${this.calendarOpen?"show":"hide"}"
|
|
91
|
-
@focusout=${e=>{this.calendarOpen&&this.handleFocusOut(e)}}
|
|
92
|
-
id="${this.id}-popup"
|
|
93
|
-
${r.n(this.popupRef)}
|
|
94
|
-
>
|
|
95
|
-
<pkt-calendar
|
|
96
|
-
id="${this.id}-calendar"
|
|
97
|
-
?multiple=${this.multiple}
|
|
98
|
-
?range=${this.range}
|
|
99
|
-
?weeknumbers=${this.weeknumbers}
|
|
100
|
-
?withcontrols=${this.withcontrols}
|
|
101
|
-
.maxMultiple=${this.maxlength}
|
|
102
|
-
.selected=${this._value}
|
|
103
|
-
.earliest=${this.min}
|
|
104
|
-
.latest=${this.max}
|
|
105
|
-
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
106
|
-
.excludeweekdays=${this.excludeweekdays}
|
|
107
|
-
.currentmonth=${this.currentmonth?g.newDate(this.currentmonth):null}
|
|
108
|
-
@date-selected=${e=>{this.value=!this.multiple&&!this.range?e.detail[0]:e.detail,this._value=e.detail,this.inputRef.value&&(this.range&&this.inputRefTo.value?(this.inputRef.value.value=this._value[0]??"",this.inputRefTo.value.value=this._value[1]??""):this.multiple||(this.inputRef.value.value=this._value.length?this._value[0]:""))}}
|
|
109
|
-
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
110
|
-
${r.n(this.calRef)}
|
|
111
|
-
></pkt-calendar>
|
|
112
|
-
</div>`}render(){return this.inputClasses={"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-datepicker--hasrangelabels":this.showRangeLabels,"pkt-datepicker--multiple":this.multiple,"pkt-datepicker--range":this.range},this.buttonClasses={"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0},a.x`
|
|
113
|
-
<pkt-input-wrapper
|
|
114
|
-
label="${this.label}"
|
|
115
|
-
forId="${this.id}-input"
|
|
116
|
-
?counter=${this.multiple&&!!this.maxlength}
|
|
117
|
-
.counterCurrent=${this.value?this._value.length:0}
|
|
118
|
-
.counterMaxLength=${this.maxlength}
|
|
119
|
-
?disabled=${this.disabled}
|
|
120
|
-
?hasError=${this.hasError}
|
|
121
|
-
?required=${this.required}
|
|
122
|
-
?optionalTag=${this.optionalTag}
|
|
123
|
-
?requiredTag=${this.requiredTag}
|
|
124
|
-
?useWrapper=${this.useWrapper}
|
|
125
|
-
.optionalText=${this.optionalText}
|
|
126
|
-
.requiredText=${this.requiredText}
|
|
127
|
-
.errorMessage=${this.errorMessage}
|
|
128
|
-
.helptext=${this.helptext}
|
|
129
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
130
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
131
|
-
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
132
|
-
class="pkt-datepicker"
|
|
133
|
-
>
|
|
134
|
-
<div class="pkt-contents" ${r.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
135
|
-
${this.multiple?this.renderTags():a.E}
|
|
136
|
-
<div
|
|
137
|
-
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
138
|
-
>
|
|
139
|
-
<div class="pkt-input__container">
|
|
140
|
-
${this.range?this.renderRangeInput():this.multiple?this.renderMultipleInput():this.renderInput()}
|
|
141
|
-
<button
|
|
142
|
-
class="${$.e(this.buttonClasses)}"
|
|
143
|
-
type="button"
|
|
144
|
-
@click=${this.toggleCalendar}
|
|
145
|
-
?disabled=${this.disabled}
|
|
146
|
-
${r.n(this.btnRef)}
|
|
147
|
-
>
|
|
148
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
149
|
-
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
150
|
-
</button>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
</pkt-input-wrapper>
|
|
154
|
-
${this.renderCalendar()}
|
|
155
|
-
`}handleCalendarPosition(){var e;if(this.popupRef.value&&this.inputRef.value){const t=this.multiple&&!!this.maxlength,i=((e=this.inputRef.value.parentElement)==null?void 0:e.getBoundingClientRect())||this.inputRef.value.getBoundingClientRect(),s=t?i.height+30:i.height,n=this.popupRef.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";i&&i.top+n>window.innerHeight&&i.top-n>0&&(l=`calc(100% - ${s}px - ${n}px)`),this.popupRef.value.style.top=l}}handleFocusOut(e){this.contains(e.target)||(this.onBlur(),this.hideCalendar())}async showCalendar(){var e;this.calendarOpen=!0,await C(20),this.handleCalendarPosition(),this.isMobileSafari&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){this.calendarOpen=!1}async toggleCalendar(e){e.preventDefault(),this.calendarOpen?this.hideCalendar():this.showCalendar()}};p([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",2);p([a.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);p([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);p([a.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);p([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);p([a.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);p([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);p([a.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);p([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);p([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);p([a.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);p([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);p([a.n({converter:g.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);p([a.n({converter:g.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);p([a.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);p([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);p([a.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);p([T.r()],exports.PktDatepicker.prototype,"inputClasses",2);p([T.r()],exports.PktDatepicker.prototype,"buttonClasses",2);exports.PktDatepicker=p([a.t("pkt-datepicker")],exports.PktDatepicker);
|
package/dist/icon-DcJIqTIY.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./element-r-PeQ419.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/class a extends n.i{constructor(t){if(super(t),this.it=n.E,t.type!==n.t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===n.E||t==null)return this._t=void 0,this.it=t;if(t===n.T)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 s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}a.directiveName="unsafeHTML",a.resultType=1;const w=n.e(a);/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/class u extends a{}u.directiveName="unsafeSVG",u.resultType=2;const d=n.e(u);var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(e,t,s,o)=>{for(var i=o>1?void 0:o?g(t,s):t,h=e.length-1,l;h>=0;h--)(l=e[h])&&(i=(o?l(t,s,i):l(i))||i);return o&&i&&f(t,s,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch;window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/latest/icons/";const v=e=>new Promise(t=>setTimeout(t,e)),c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',p={},P=async(e,t)=>{let s=0;for(;p[t+e+".svg"]==="fetching"&&(s++,!(s>50));)await v(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(p[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(o=>o.ok?o.text():(console.error("Missing icon: "+t+e+".svg"),c)).then(o=>(o!==c&&localStorage.setItem(t+e+".svg",o),p[t+e+".svg"]="fetched",o)))):Promise.resolve(c)};exports.PktIcon=class extends n.PktElement{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=d(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,s,o){super.attributeChangedCallback(t,s,o),(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=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=d(await P(this.name||"",this.path).then(s=>s)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return n.x`${this.name&&this.icon}`}};r([n.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);r([n.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);r([n.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);r([n.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=r([n.t("pkt-icon")],exports.PktIcon);exports.o=w;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./element-r-PeQ419.cjs"),f=require("./state-B77EXPZ9.cjs"),y=require("./stringutils-CkVRq4jP.cjs"),c=require("./input-wrapper-jPnKsfEC.cjs");var m=Object.defineProperty,s=(o,t,r,l)=>{for(var a=void 0,n=o.length-1,h;n>=0;n--)(h=o[n])&&(a=h(t,r,a)||a);return a&&m(t,r,a),a};class i extends e.PktElement{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=y.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=c.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.translations.forms.labels.optional,this.requiredText=e.translations.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var r,l,a,n,h,p,u,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.translations.forms.messages.required,t):(r=t.validity)!=null&&r.typeMismatch||(l=t.validity)!=null&&l.badInput?this.internals.setValidity({typeMismatch:!0},e.translations.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.translations.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.translations.forms.messages.tooShort,t):(h=t.validity)!=null&&h.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.translations.forms.messages.tooLong,t):(p=t.validity)!=null&&p.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.translations.forms.messages.rangeUnderflow,t):(u=t.validity)!=null&&u.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.translations.forms.messages.rangeOverflow,t):(d=t.validity)!=null&&d.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const r=new FormData;t.forEach(l=>{r.append(this.name,l)}),this.internals.setFormValue(r)}else this.internals.setFormValue(t)}valueChecked(t){this.touched&&(typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?this.internals.states.add("--checked"):this.internals.states.delete("--checked"),this.internals.setFormValue(this.checked?this.value:null,this.checked?"checked":"unchecked"),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity())}valueChanged(t,r){(r!==this.value||r!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&r&&r.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(r==null?void 0:r.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){super.firstUpdated(t),this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.setFormValue(this.value),this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}s([e.n()],i.prototype,"defaultValue");s([e.n({type:Boolean,reflect:!0})],i.prototype,"disabled");s([e.n({type:Boolean,reflect:!0})],i.prototype,"readonly");s([e.n({type:Boolean,reflect:!0})],i.prototype,"required");s([e.n({type:Number,reflect:!0})],i.prototype,"max");s([e.n({type:Number,reflect:!0})],i.prototype,"maxlength");s([e.n({type:Number,reflect:!0})],i.prototype,"min");s([e.n({type:Number,reflect:!0})],i.prototype,"minlength");s([e.n({type:String})],i.prototype,"ariaDescribedBy");s([e.n({type:String})],i.prototype,"ariaLabelledby");s([e.n({type:String,reflect:!0})],i.prototype,"name");s([e.n({type:String,reflect:!0})],i.prototype,"pattern");s([e.n({type:String,reflect:!0})],i.prototype,"placeholder");s([e.n({type:String,reflect:!0})],i.prototype,"id");s([e.n({type:Boolean})],i.prototype,"counter");s([e.n({type:Boolean})],i.prototype,"hasError");s([e.n({type:Boolean})],i.prototype,"inline");s([e.n({type:Boolean})],i.prototype,"optionalTag");s([e.n({type:Boolean})],i.prototype,"requiredTag");s([e.n({type:Boolean})],i.prototype,"skipForwardTestid");s([e.n({type:Boolean})],i.prototype,"useWrapper");s([e.n({type:Boolean,reflect:!0})],i.prototype,"fullwidth");s([e.n({type:Number})],i.prototype,"counterMaxLength");s([e.n({type:String})],i.prototype,"errorMessage");s([e.n({type:String})],i.prototype,"helptext");s([e.n({type:String})],i.prototype,"helptextDropdown");s([e.n({type:String})],i.prototype,"helptextDropdownButton");s([e.n({type:String})],i.prototype,"label");s([e.n({type:String})],i.prototype,"optionalText");s([e.n({type:String})],i.prototype,"requiredText");s([e.n({type:String,attribute:"data-testid"})],i.prototype,"dataTestid");s([f.r()],i.prototype,"touched");exports.PktInputElement=i;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./class-map-Dzci3Pfe.cjs"),e=require("./element-r-PeQ419.cjs"),p=require("./state-B77EXPZ9.cjs"),h=require("./ref-BUWgvhgU.cjs"),b=require("./stringutils-CkVRq4jP.cjs");require("./icon-DcJIqTIY.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2018 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const d="important",P=" !"+d,v=e.e(class extends e.i{constructor(l){var t;if(super(l),l.type!==e.t$1.ATTRIBUTE||l.name!=="style"||((t=l.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((t,s)=>{const r=l[s];return r==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(l,[t]){const{style:s}=l.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?s.removeProperty(r):s[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const u=typeof i=="string"&&i.endsWith(P);r.includes("-")||u?s.setProperty(r,u?i.slice(0,-11):i,u?d:""):s[r]=i}}return e.T}});var f=Object.defineProperty,k=Object.getOwnPropertyDescriptor,a=(l,t,s,r)=>{for(var i=r>1?void 0:r?k(t,s):t,u=l.length-1,o;u>=0;u--)(o=l[u])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&f(t,s,i),i};exports.PktProgressbar=class extends e.PktElement{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=b.uuidish(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=h.e(),this.progressBarRef=h.e()}firstUpdated(t){super.firstUpdated(t),this.setComputedValues(),this.syncAttributes()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id),(t.has("statusType")||t.has("id")||t.has("ariaLabelledby"))&&(this.progressbarId=this.id||b.uuidish(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(t.has("ariaValueText")||t.has("valueCurrent")||t.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const t=this.statusType!=="none",s=this.valueMax-this.valueMin,r=this.valueCurrent/s*100,i=this.statusType==="fraction"?Math.round(r):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),u=`${this.valueCurrent} av ${s}`,o=n.e({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),c=n.e({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),g=n.e({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),y=n.e({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return e.x` <div
|
|
6
|
-
class="pkt-progressbar__container"
|
|
7
|
-
.ref=${this.progressBarRef}
|
|
8
|
-
style=${v({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
9
|
-
>
|
|
10
|
-
${this.title?e.x`<p id=${`${this.progressBarId}-title`} class=${c}>${this.title}</p>`:e.E}
|
|
11
|
-
|
|
12
|
-
<div class="pkt-progressbar__bar-wrapper">
|
|
13
|
-
<div class=${o}></div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
${t?e.x`<div class=${g}>
|
|
17
|
-
<span class=${y} ${h.n(this.labelRef)}>
|
|
18
|
-
${this.statusType==="percentage"?`${i}%`:u}
|
|
19
|
-
</span>
|
|
20
|
-
</div>`:e.E}
|
|
21
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||b.uuidish(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(t,s){s==null||s===""?this.removeAttribute(t):this.setAttribute(t,String(s))}};a([e.n({type:String})],exports.PktProgressbar.prototype,"ariaLabel",2);a([e.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabelledby",2);a([e.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaValueText",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"ariaLive",2);a([e.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"id",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"role",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"skin",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"statusPlacement",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"statusType",2);a([e.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"title",2);a([e.n({type:String})],exports.PktProgressbar.prototype,"titlePosition",2);a([e.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueCurrent",2);a([e.n({type:Number})],exports.PktProgressbar.prototype,"valueMax",2);a([e.n({type:Number})],exports.PktProgressbar.prototype,"valueMin",2);a([p.r()],exports.PktProgressbar.prototype,"labelWidth",2);a([p.r()],exports.PktProgressbar.prototype,"progressbarId",2);a([p.r()],exports.PktProgressbar.prototype,"computedAriaLabelledby",2);a([p.r()],exports.PktProgressbar.prototype,"computedAriaValueText",2);exports.PktProgressbar=a([e.t("pkt-progressbar")],exports.PktProgressbar);const m=exports.PktProgressbar;exports.PktProgressbar$1=m;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./element-r-PeQ419.cjs"),l=require("./state-B77EXPZ9.cjs"),r=require("./input-element-KOSm5htR.cjs"),o=require("./ref-BUWgvhgU.cjs"),p=require("./class-map-Dzci3Pfe.cjs");var d=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(n,t,c,h)=>{for(var s=h>1?void 0:h?k(t,c):t,u=n.length-1,a;u>=0;u--)(a=n[u])&&(s=(h?a(t,c,s):a(s))||s);return h&&s&&d(t,c,s),s};exports.PktRadioButton=class extends r.PktInputElement{constructor(){super(...arguments),this.inputRef=o.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=!1,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,c,h){t==="defaultChecked"&&(this._checked=this.defaultChecked),t==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,c,h)}updated(t){super.updated(t)}render(){const t=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return e.x`
|
|
2
|
-
<div class="pkt-input-check">
|
|
3
|
-
<div class=${t}>
|
|
4
|
-
<input
|
|
5
|
-
id=${this.id+"-internal"}
|
|
6
|
-
class=${c}
|
|
7
|
-
type="radio"
|
|
8
|
-
role="radio"
|
|
9
|
-
?disabled=${this.disabled}
|
|
10
|
-
name=${this.name+"-internal"}
|
|
11
|
-
${o.n(this.inputRef)}
|
|
12
|
-
@change=${this.toggleChecked}
|
|
13
|
-
@input=${this.onInput}
|
|
14
|
-
@blur=${this.onBlur}
|
|
15
|
-
@focus=${this.onFocus}
|
|
16
|
-
?checked=${this.checked}
|
|
17
|
-
/>
|
|
18
|
-
<label class="pkt-input-check__input-label" for=${this.id+"-internal"}>
|
|
19
|
-
${this.label}
|
|
20
|
-
${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
|
|
21
|
-
</label>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
`}toggleChecked(t){t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};i([e.n({type:String,reflect:!0})],exports.PktRadioButton.prototype,"value",2);i([e.n({type:String})],exports.PktRadioButton.prototype,"checkHelptext",2);i([e.n({type:Boolean})],exports.PktRadioButton.prototype,"defaultChecked",2);i([e.n({type:Boolean})],exports.PktRadioButton.prototype,"hasTile",2);i([e.n({type:Boolean,reflect:!0})],exports.PktRadioButton.prototype,"checked",2);i([e.n({type:String,reflect:!0})],exports.PktRadioButton.prototype,"type",2);i([l.r()],exports.PktRadioButton.prototype,"_checked",2);exports.PktRadioButton=i([e.t("pkt-radiobutton")],exports.PktRadioButton);
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { x as n, E as u, n as h, a as d } from "./element-D_ZgQsSr.js";
|
|
2
|
-
import { r as k } from "./state-DuS4ffEQ.js";
|
|
3
|
-
import { P as f } from "./input-element-B6BTwL1q.js";
|
|
4
|
-
import { e as _, n as b } from "./ref-BSGI8ogR.js";
|
|
5
|
-
import { e as o } from "./class-map-BYCG9U47.js";
|
|
6
|
-
var v = Object.defineProperty, C = Object.getOwnPropertyDescriptor, c = (e, i, p, l) => {
|
|
7
|
-
for (var s = l > 1 ? void 0 : l ? C(i, p) : i, r = e.length - 1, a; r >= 0; r--)
|
|
8
|
-
(a = e[r]) && (s = (l ? a(i, p, s) : a(s)) || s);
|
|
9
|
-
return l && s && v(i, p, s), s;
|
|
10
|
-
};
|
|
11
|
-
let t = class extends f {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments), this.inputRef = _(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = !1, this.type = "radio", this._checked = !1;
|
|
14
|
-
}
|
|
15
|
-
connectedCallback() {
|
|
16
|
-
super.connectedCallback();
|
|
17
|
-
}
|
|
18
|
-
attributeChangedCallback(e, i, p) {
|
|
19
|
-
e === "defaultChecked" && (this._checked = this.defaultChecked), e === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(e, i, p);
|
|
20
|
-
}
|
|
21
|
-
updated(e) {
|
|
22
|
-
super.updated(e);
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
const e = o({
|
|
26
|
-
"pkt-input-check__input": !0,
|
|
27
|
-
"pkt-input-check__input--tile": this.hasTile,
|
|
28
|
-
"pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
|
|
29
|
-
}), i = o({
|
|
30
|
-
"pkt-input-check__input-checkbox": !0,
|
|
31
|
-
"pkt-input-check__input-checkbox--error": this.hasError
|
|
32
|
-
});
|
|
33
|
-
return n`
|
|
34
|
-
<div class="pkt-input-check">
|
|
35
|
-
<div class=${e}>
|
|
36
|
-
<input
|
|
37
|
-
id=${this.id + "-internal"}
|
|
38
|
-
class=${i}
|
|
39
|
-
type="radio"
|
|
40
|
-
role="radio"
|
|
41
|
-
?disabled=${this.disabled}
|
|
42
|
-
name=${this.name + "-internal"}
|
|
43
|
-
${b(this.inputRef)}
|
|
44
|
-
@change=${this.toggleChecked}
|
|
45
|
-
@input=${this.onInput}
|
|
46
|
-
@blur=${this.onBlur}
|
|
47
|
-
@focus=${this.onFocus}
|
|
48
|
-
?checked=${this.checked}
|
|
49
|
-
/>
|
|
50
|
-
<label class="pkt-input-check__input-label" for=${this.id + "-internal"}>
|
|
51
|
-
${this.label}
|
|
52
|
-
${this.checkHelptext ? n`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : u}
|
|
53
|
-
</label>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
toggleChecked(e) {
|
|
59
|
-
e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
c([
|
|
63
|
-
h({ type: String, reflect: !0 })
|
|
64
|
-
], t.prototype, "value", 2);
|
|
65
|
-
c([
|
|
66
|
-
h({ type: String })
|
|
67
|
-
], t.prototype, "checkHelptext", 2);
|
|
68
|
-
c([
|
|
69
|
-
h({ type: Boolean })
|
|
70
|
-
], t.prototype, "defaultChecked", 2);
|
|
71
|
-
c([
|
|
72
|
-
h({ type: Boolean })
|
|
73
|
-
], t.prototype, "hasTile", 2);
|
|
74
|
-
c([
|
|
75
|
-
h({ type: Boolean, reflect: !0 })
|
|
76
|
-
], t.prototype, "checked", 2);
|
|
77
|
-
c([
|
|
78
|
-
h({ type: String, reflect: !0 })
|
|
79
|
-
], t.prototype, "type", 2);
|
|
80
|
-
c([
|
|
81
|
-
k()
|
|
82
|
-
], t.prototype, "_checked", 2);
|
|
83
|
-
t = c([
|
|
84
|
-
d("pkt-radiobutton")
|
|
85
|
-
], t);
|
|
86
|
-
export {
|
|
87
|
-
t as P
|
|
88
|
-
};
|
package/dist/ref-BUWgvhgU.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./element-r-PeQ419.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const{I:g}=c.Z,a=t=>t.strings===void 0,f=()=>document.createComment(""),p=(t,s,e)=>{var h;const i=t._$AA.parentNode,n=s===void 0?t._$AB:s._$AA;if(e===void 0){const $=i.insertBefore(f(),n),A=i.insertBefore(f(),n);e=new g($,A,t,t.options)}else{const $=e._$AB.nextSibling,A=e._$AM,d=A!==t;if(d){let o;(h=e._$AQ)==null||h.call(e,t),e._$AM=t,e._$AP!==void 0&&(o=t._$AU)!==A._$AU&&e._$AP(o)}if($!==n||d){let o=e._$AA;for(;o!==$;){const v=o.nextSibling;i.insertBefore(o,n),o=v}}}return e},Y=(t,s,e=t)=>(t._$AI(s,e),t),C={},M=(t,s=C)=>t._$AH=s,m=t=>t._$AH,b=t=>{var i;(i=t._$AP)==null||i.call(t,!1,!0);let s=t._$AA;const e=t._$AB.nextSibling;for(;s!==e;){const n=s.nextSibling;s.remove(),s=n}};/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const r=(t,s)=>{var i;const e=t._$AN;if(e===void 0)return!1;for(const n of e)(i=n._$AO)==null||i.call(n,s,!1),r(n,s);return!0},_=t=>{let s,e;do{if((s=t._$AM)===void 0)break;e=s._$AN,e.delete(t),t=s}while((e==null?void 0:e.size)===0)},u=t=>{for(let s;s=t._$AM;t=s){let e=s._$AN;if(e===void 0)s._$AN=e=new Set;else if(e.has(t))break;e.add(t),x(s)}};function N(t){this._$AN!==void 0?(_(this),this._$AM=t,u(this)):this._$AM=t}function w(t,s=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(s)if(Array.isArray(i))for(let h=e;h<i.length;h++)r(i[h],!1),_(i[h]);else i!=null&&(r(i,!1),_(i));else r(this,t)}const x=t=>{t.type==c.t$1.CHILD&&(t._$AP??(t._$AP=w),t._$AQ??(t._$AQ=N))};class B extends c.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(s,e,i){super._$AT(s,e,i),u(this),this.isConnected=s._$AU}_$AO(s,e=!0){var i,n;s!==this.isConnected&&(this.isConnected=s,s?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(r(this,s),_(this))}setValue(s){if(a(this._$Ct))this._$Ct._$AI(s,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=s,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2020 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const y=()=>new H;class H{}const l=new WeakMap,I=c.e(class extends B{render(t){return c.E}update(t,[s]){var i;const e=s!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=s,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),c.E}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const s=this.ht??globalThis;let e=l.get(s);e===void 0&&(e=new WeakMap,l.set(s,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,s;return typeof this.Y=="function"?(t=l.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(s=this.Y)==null?void 0:s.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.M=b;exports.e=y;exports.f=a;exports.m=M;exports.n=I;exports.p=m;exports.r=p;exports.v=Y;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./element-r-PeQ419.cjs"),u=require("./if-defined-CWHk9Kqm.cjs"),p=require("./state-B77EXPZ9.cjs"),n=require("./ref-BUWgvhgU.cjs"),d=require("./class-map-Dzci3Pfe.cjs"),c=require("./input-element-KOSm5htR.cjs"),$=require("./pkt-slot-controller-Oc32unDk.cjs");require("./input-wrapper-Dqj4uers.cjs");require("./icon-DcJIqTIY.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const x=i.e(class extends i.i{constructor(r){if(super(r),r.type!==i.t$1.PROPERTY&&r.type!==i.t$1.ATTRIBUTE&&r.type!==i.t$1.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.f(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===i.T||e===i.E)return e;const s=r.element,t=r.name;if(r.type===i.t$1.PROPERTY){if(e===s[t])return i.T}else if(r.type===i.t$1.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(t))return i.T}else if(r.type===i.t$1.ATTRIBUTE&&s.getAttribute(t)===e+"")return i.T;return n.m(r),e}});var T=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(r,e,s,t)=>{for(var a=t>1?void 0:t?g(e,s):e,l=r.length-1,h;l>=0;l--)(h=r[l])&&(a=(t?h(e,s,a):h(a))||a);return t&&a&&T(e,s,a),a};exports.PktTextarea=class extends c.PktInputElement{constructor(){super(),this.inputRef=n.e(),this.helptextSlot=n.e(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new $.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(e,s,t){e==="value"&&this.value!==s&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,s)),super.attributeChangedCallback(e,s,t)}updated(e){var s;super.updated(e),e.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=d.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),s=this.ariaLabelledby||`${this.id}-input-label`;return i.x`<pkt-input-wrapper
|
|
6
|
-
label=${this.label}
|
|
7
|
-
?counter=${this.counter}
|
|
8
|
-
?disabled=${this.disabled}
|
|
9
|
-
?hasError=${this.hasError}
|
|
10
|
-
?inline=${this.inline}
|
|
11
|
-
?optionalTag=${this.optionalTag}
|
|
12
|
-
?required=${this.required}
|
|
13
|
-
?requiredTag=${this.requiredTag}
|
|
14
|
-
?useWrapper=${this.useWrapper}
|
|
15
|
-
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
16
|
-
.counterCurrent=${this.counterCurrent}
|
|
17
|
-
.counterMaxLength=${this.counterMaxLength}
|
|
18
|
-
.errorMessage=${this.errorMessage}
|
|
19
|
-
.forId="${this.id+"-input"}"
|
|
20
|
-
.helptext=${this.helptext}
|
|
21
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
22
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
23
|
-
.optionalText=${this.optionalText}
|
|
24
|
-
.requiredText=${this.requiredText}
|
|
25
|
-
class="pkt-textarea"
|
|
26
|
-
>
|
|
27
|
-
<div class="pkt-contents" ${n.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
28
|
-
<textarea
|
|
29
|
-
${n.n(this.inputRef)}
|
|
30
|
-
class=${e}
|
|
31
|
-
id=${this.id+"-input"}
|
|
32
|
-
name=${(this.name||this.id)+"-input"}
|
|
33
|
-
placeholder=${u.o(this.placeholder)}
|
|
34
|
-
.value=${x(this.value)}
|
|
35
|
-
minlength=${u.o(this.minlength)}
|
|
36
|
-
maxlength=${u.o(this.maxlength)}
|
|
37
|
-
?readonly=${this.readonly}
|
|
38
|
-
autocomplete=${this.autocomplete}
|
|
39
|
-
aria-labelledby=${s}
|
|
40
|
-
aria-invalid=${this.hasError}
|
|
41
|
-
aria-errormessage=${`${this.id}-error`}
|
|
42
|
-
rows=${this.rows}
|
|
43
|
-
?disabled=${this.disabled}
|
|
44
|
-
@input=${t=>{this.value=t.target.value,this.onInput(),t.stopImmediatePropagation()}}
|
|
45
|
-
@change=${t=>{t.stopImmediatePropagation()}}
|
|
46
|
-
@focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
|
|
47
|
-
@blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
|
|
48
|
-
></textarea>
|
|
49
|
-
</pkt-input-wrapper>`}};o([i.n({type:String,reflect:!0})],exports.PktTextarea.prototype,"value",2);o([i.n({type:String})],exports.PktTextarea.prototype,"autocomplete",2);o([i.n({type:Number})],exports.PktTextarea.prototype,"rows",2);o([p.r()],exports.PktTextarea.prototype,"counterCurrent",2);exports.PktTextarea=o([i.t("pkt-textarea")],exports.PktTextarea);
|