@oslokommune/punkt-elements 12.42.12 → 12.42.13
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 +17 -0
- package/dist/{accordionitem-Be6vyX31.js → accordionitem-C9FI-NXW.js} +7 -8
- package/dist/{accordionitem-ogt0KNGP.cjs → accordionitem-DjAWPtsn.cjs} +5 -5
- package/dist/{alert-CZyqekhG.js → alert-B0OUR9oD.js} +21 -22
- package/dist/alert-BH0lJ2ny.cjs +32 -0
- package/dist/{backlink-C3dfam09.js → backlink-B13JTp9D.js} +11 -12
- package/dist/backlink-C5jQRMwJ.cjs +13 -0
- package/dist/button-CDocR7iN.cjs +19 -0
- package/dist/{button-OoC1RGJL.js → button-DrrEvUy9.js} +7 -8
- package/dist/calendar-BZe2D4Sr.cjs +108 -0
- package/dist/{calendar-qEV4u3xs.js → calendar-DevQhOup.js} +10 -11
- package/dist/{card-CJue0Esh.cjs → card-Bx36j0q4.cjs} +1 -1
- package/dist/{card-p-fcc7Wh.js → card-Djnd-pgo.js} +8 -9
- package/dist/{checkbox-iLywLQwL.cjs → checkbox-CJ4tK9RC.cjs} +1 -1
- package/dist/{checkbox-BLI7dfpW.js → checkbox-cD_5LDzV.js} +4 -4
- package/dist/{class-map-dph2jLEp.cjs → class-map-BBG2gMX4.cjs} +1 -1
- package/dist/{class-map-DO0E7GkW.js → class-map-BpTj9gtz.js} +1 -1
- package/dist/{combobox-BJOVpwAW.cjs → combobox-Cv6i7BEk.cjs} +1 -1
- package/dist/{combobox-C_Zj-ZxE.js → combobox-kWGI4RHI.js} +11 -11
- package/dist/{consent-C0pd0E2Q.js → consent-CftYu8Di.js} +5 -6
- package/dist/consent-DrS71kvz.cjs +11 -0
- package/dist/{datepicker--I3DF-Ci.cjs → datepicker-BJe92Vor.cjs} +1 -1
- package/dist/{datepicker-Y6-ORa5u.js → datepicker-LpbYHx8L.js} +11 -11
- package/dist/{directive-helpers-lOXMtxMR.cjs → directive-helpers-BBbxqP2W.cjs} +2 -2
- package/dist/{directive-helpers-D2BEk_ct.js → directive-helpers-r-kOS_Mf.js} +1 -1
- package/dist/element-6DBpyGQm.cjs +238 -0
- package/dist/{element-Cfyyg4nF.js → element-CgEWt74-.js} +9272 -9157
- package/dist/heading-BRE_iFtR.cjs +1 -0
- package/dist/{heading-BWV1JThP.js → heading-D6jXE_Mz.js} +4 -4
- package/dist/{helptext-C7oP6VRp.js → helptext-B7eI0iBQ.js} +18 -19
- package/dist/helptext-CzQX6YVE.cjs +24 -0
- package/dist/{icon-RJ9Op-BB.cjs → icon-B_ryAy4Q.cjs} +3 -3
- package/dist/{icon-DPnB79MP.js → icon-CC1js8eR.js} +11 -12
- package/dist/{if-defined-I-IZkUY2.js → if-defined-CmuO4Vz9.js} +1 -1
- package/dist/if-defined-Cni-RHLS.cjs +5 -0
- package/dist/index.d.ts +27 -27
- package/dist/input-element-CHjLWeKt.cjs +1 -0
- package/dist/input-element-Cco4PA2M.js +700 -0
- package/dist/{input-wrapper-DrJgi10C.cjs → input-wrapper-BxZf8wEP.cjs} +4 -4
- package/dist/{input-wrapper-BDm0DwAW.js → input-wrapper-gz7ppKrK.js} +13 -14
- package/dist/{link-BzKHhT3c.js → link-C76H6Qf1.js} +11 -12
- package/dist/link-DTkjNlmy.cjs +7 -0
- package/dist/{linkcard-CyepaY-g.js → linkcard-BVEsUPwG.js} +13 -14
- package/dist/{linkcard-Czsb01sQ.cjs → linkcard-BlMhPNry.cjs} +1 -1
- package/dist/{listbox-BIcmMiAK.cjs → listbox-C4supLfR.cjs} +7 -7
- package/dist/{listbox-Br7v_BsA.js → listbox-CLsSW32I.js} +10 -11
- package/dist/loader-CHPxY9c6.cjs +11 -0
- package/dist/{loader-Co35Rkbv.js → loader-Da4IOk_T.js} +15 -16
- package/dist/messagebox-CqUBJs_D.cjs +12 -0
- package/dist/{messagebox-CQXmoqzD.js → messagebox-DwGdcdm7.js} +17 -18
- package/dist/modal-BdA5aWGU.cjs +36 -0
- package/dist/{modal-DuubDFPT.js → modal-DcXPnFus.js} +26 -27
- 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 +1 -1
- 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 +3 -3
- package/dist/pkt-index.js +62 -63
- 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-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-DF8IG5IY.cjs → progressbar-DhMBXkww.cjs} +7 -7
- package/dist/{progressbar-B75UwwRZ.js → progressbar-Dj_mI_A6.js} +13 -14
- package/dist/{radiobutton-DUpADoLc.cjs → radiobutton-0vVqu-GU.cjs} +1 -1
- package/dist/{radiobutton-CDO-HMP_.js → radiobutton-BcFRJFvI.js} +5 -5
- package/dist/{ref-DX488m2G.js → ref-BBYSqgeW.js} +2 -2
- package/dist/{ref-BMQZJJEo.cjs → ref-iJtiv3o2.cjs} +1 -1
- package/dist/{repeat-Dl4RVQIF.js → repeat-C8BeHwYx.js} +2 -2
- package/dist/{repeat-B93vZu9q.cjs → repeat-CDsZqct8.cjs} +1 -1
- package/dist/{select-q7qkLeW4.js → select-BaLHLuvH.js} +20 -20
- package/dist/select-CFpdOlDE.cjs +48 -0
- package/dist/{state-P2J1I2ny.js → state-Bo2bck5_.js} +1 -1
- package/dist/{state-y-GU-VH8.cjs → state-DPobt-Yz.cjs} +1 -1
- package/dist/{tag-OSIRLJc0.js → tag-BWm6s48d.js} +20 -21
- package/dist/tag-DPk3fpEg.cjs +18 -0
- package/dist/{textarea-BuhpS5Jj.cjs → textarea-CViiuZdR.cjs} +1 -1
- package/dist/{textarea-BIvwbRBK.js → textarea-EIFo7GZz.js} +22 -22
- package/dist/{textinput-BFbenR3I.js → textinput-BHS7b-Jt.js} +8 -8
- package/dist/{textinput-BUMlqXQC.cjs → textinput-_ZdyMA9O.cjs} +1 -1
- package/package.json +3 -3
- package/src/components/heading/heading.ts +3 -2
- package/dist/alert-DifeONO7.cjs +0 -32
- package/dist/backlink-C9qmM67k.cjs +0 -13
- package/dist/button-zO41ySZl.cjs +0 -19
- package/dist/calendar-BYYJH15O.cjs +0 -108
- package/dist/consent-BkgHuZ37.cjs +0 -11
- package/dist/element-DUJa1sRq.cjs +0 -212
- package/dist/heading-C6U6xiqH.cjs +0 -1
- package/dist/helptext-BxHMB-XH.cjs +0 -24
- package/dist/if-defined-BQOEcjlp.cjs +0 -5
- package/dist/input-element-B2JauW-Y.cjs +0 -1
- package/dist/input-element-CaCDNzdI.js +0 -230
- package/dist/link-Dhs4dS0S.cjs +0 -7
- package/dist/lit-element-DHqqtYbj.cjs +0 -27
- package/dist/lit-element-DcUrSbRH.js +0 -595
- package/dist/loader-5lt2W9RX.cjs +0 -11
- package/dist/messagebox-BSUbetVQ.cjs +0 -12
- package/dist/modal-5PZ-TDkV.cjs +0 -36
- package/dist/select-CE5L--Xw.cjs +0 -48
- package/dist/tag-sEPrma2U.cjs +0 -18
package/dist/select-CE5L--Xw.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./lit-element-DHqqtYbj.cjs"),p=require("./state-y-GU-VH8.cjs"),h=require("./ref-BMQZJJEo.cjs"),o=require("./if-defined-BQOEcjlp.cjs"),d=require("./input-element-B2JauW-Y.cjs"),c=require("./pkt-options-controller-CiuBG6Lt.cjs"),v=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-DrJgi10C.cjs");var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,a=(u,t,e,s)=>{for(var i=s>1?void 0:s?b(t,e):t,l=u.length-1,n;l>=0;l--)(n=u[l])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&f(t,e,i),i};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.options=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new v.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback();const t=this.options.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(s=>{const i={value:s.hasAttribute("value")?s.getAttribute("value")??"":s.textContent??"",label:s.textContent||s.getAttribute("value")||"",disabled:s.hasAttribute("disabled"),hidden:s.hasAttribute("data-hidden")};s.getAttribute("selected")&&!this.value&&(this.value=i.value),this._options.push(i)}):(this._options=this.options,this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)}))}add(t,e){var s,i,l;(s=this.inputRef.value)==null||s.add(t,e),this._options.push({value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled}),t.selected&&(this.value=t.value||t.text,this.selectedIndex=this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex),this.selectedOptions=(l=this.inputRef.value)==null?void 0:l.selectedOptions),this.requestUpdate()}remove(t){var e,s;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),(s=this.inputRef.value)==null||s.remove(t))}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){var t;(t=this.inputRef.value)==null||t.showPicker()}attributeChangedCallback(t,e,s){var i,l;t==="options"&&(this._options=s?JSON.parse(s):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this.options.findIndex(n=>n.value===s),this.selectedOptions=(l=this.inputRef.value)==null?void 0:l.selectedOptions,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}update(t){var e,s;super.update(t),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this.options.findIndex(i=>i.value===this.value),this.selectedOptions=(s=this.inputRef.value)==null?void 0:s.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this.options.length&&(this._options=this.options),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(s=>s.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return r.x`
|
|
2
|
-
<pkt-input-wrapper
|
|
3
|
-
?counter=${this.counter}
|
|
4
|
-
?disabled=${this.disabled}
|
|
5
|
-
?hasError=${this.hasError}
|
|
6
|
-
?hasFieldset=${this.hasFieldset}
|
|
7
|
-
?inline=${this.inline}
|
|
8
|
-
?optionalTag=${this.optionalTag}
|
|
9
|
-
?requiredTag=${this.requiredTag}
|
|
10
|
-
?useWrapper=${this.useWrapper}
|
|
11
|
-
ariaDescribedBy=${o.o(this.ariaDescribedBy)}
|
|
12
|
-
class="pkt-select"
|
|
13
|
-
errorMessage=${o.o(this.errorMessage)}
|
|
14
|
-
forId=${this.id+"-input"}
|
|
15
|
-
helptext=${o.o(this.helptext)}
|
|
16
|
-
helptextDropdown=${o.o(this.helptextDropdown)}
|
|
17
|
-
helptextDropdownButton=${o.o(this.helptextDropdownButton)}
|
|
18
|
-
label=${o.o(this.label)}
|
|
19
|
-
optionalText=${o.o(this.optionalText)}
|
|
20
|
-
requiredText=${o.o(this.requiredText)}
|
|
21
|
-
>
|
|
22
|
-
<select
|
|
23
|
-
class=${t}
|
|
24
|
-
aria-invalid=${this.hasError}
|
|
25
|
-
aria-errormessage=${`${this.id}-error`}
|
|
26
|
-
aria-labelledby=${o.o(this.ariaLabelledby)}
|
|
27
|
-
?disabled=${this.disabled}
|
|
28
|
-
id=${this.id+"-input"}
|
|
29
|
-
name=${(this.name||this.id)+"-input"}
|
|
30
|
-
value=${this.value}
|
|
31
|
-
@change=${e=>{this.touched=!0,this.value=e.target.value,e.stopImmediatePropagation()}}
|
|
32
|
-
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
33
|
-
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
34
|
-
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
35
|
-
${h.n(this.inputRef)}
|
|
36
|
-
>
|
|
37
|
-
${this._options.length>0&&this._options.map(e=>r.x`<option
|
|
38
|
-
value=${e.value}
|
|
39
|
-
?selected=${this.value==e.value||e.selected}
|
|
40
|
-
?disabled=${e.disabled}
|
|
41
|
-
?hidden=${e.hidden}
|
|
42
|
-
>
|
|
43
|
-
${e.label}
|
|
44
|
-
</option>`)}
|
|
45
|
-
</select>
|
|
46
|
-
<div class="pkt-contents" ${h.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
47
|
-
</pkt-input-wrapper>
|
|
48
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};a([r.n({type:Array})],exports.PktSelect.prototype,"options",2);a([r.n({type:String})],exports.PktSelect.prototype,"value",2);a([p.r()],exports.PktSelect.prototype,"_options",2);exports.PktSelect=a([r.t("pkt-select")],exports.PktSelect);
|
package/dist/tag-sEPrma2U.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("./class-map-dph2jLEp.cjs"),t=require("./lit-element-DHqqtYbj.cjs"),k=require("./state-y-GU-VH8.cjs"),g=require("./element-DUJa1sRq.cjs"),f=require("./pkt-slot-controller-BzddBp7z.cjs"),c=require("./ref-BMQZJJEo.cjs");require("./icon-RJ9Op-BB.cjs");const h=require("./if-defined-BQOEcjlp.cjs"),d={closeTag:{default:!1},size:{default:"medium"},skin:{default:"blue"},type:{default:"button"}},r={props:d};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,i=(n,e,o,a)=>{for(var s=a>1?void 0:a?b(e,o):e,l=n.length-1,p;l>=0;l--)(p=n[l])&&(s=(a?p(e,o,s):p(s))||s);return a&&s&&y(e,o,s),s};exports.PktTag=class extends g.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=r.props.closeTag.default,this.size=r.props.size.default,this.skin=r.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=r.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new f.PktSlotController(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var o,a;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const s=(a=(o=this.defaultSlot.value)==null?void 0:o.textContent)==null?void 0:a.trim();s&&(this._ariaDescription=`Klikk for å fjerne ${s}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},o={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
2
|
-
<button
|
|
3
|
-
class=${u.e(o)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
@click=${this.close}
|
|
6
|
-
aria-label=${h.o(this.ariaLabel||void 0)}
|
|
7
|
-
aria-description=${h.o(this._ariaDescription||void 0)}
|
|
8
|
-
>
|
|
9
|
-
${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
10
|
-
<span ${c.n(this.defaultSlot)}></span>
|
|
11
|
-
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
12
|
-
</button>
|
|
13
|
-
`:t.x`
|
|
14
|
-
<span class=${u.e(e)}>
|
|
15
|
-
${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
16
|
-
<span ${c.n(this.defaultSlot)}></span>
|
|
17
|
-
</span>
|
|
18
|
-
`}};i([t.n({type:Boolean,reflect:!0})],exports.PktTag.prototype,"closeTag",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"size",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"skin",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"textStyle",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"iconName",2);i([t.n({type:String})],exports.PktTag.prototype,"type",2);i([t.n({type:String})],exports.PktTag.prototype,"ariaLabel",2);i([k.r()],exports.PktTag.prototype,"_isClosed",2);i([k.r()],exports.PktTag.prototype,"_ariaDescription",2);exports.PktTag=i([t.t("pkt-tag")],exports.PktTag);
|