@oslokommune/punkt-elements 13.18.1 → 13.18.3
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/{card-Cf-UcGAP.cjs → card-Byrpi1pD.cjs} +1 -1
- package/dist/{card-M1X36b6i.js → card-D-tsyQx5.js} +1 -1
- package/dist/{checkbox-CqoOG2KJ.cjs → checkbox-BP5zOlPy.cjs} +1 -1
- package/dist/{checkbox-CCmRUWTH.js → checkbox-CfXOh6Lw.js} +1 -1
- package/dist/{combobox-CtHgl1n2.js → combobox-BK9xei07.js} +3 -3
- package/dist/{combobox-6WP1urZS.cjs → combobox-DMBUiR8Z.cjs} +2 -2
- package/dist/{datepicker-DEO1C69C.cjs → datepicker-C1Virx9Z.cjs} +2 -2
- package/dist/{datepicker-q9haFM81.js → datepicker-p2LxVkLS.js} +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/{input-element-Dqu8udwd.js → input-element-B0VPRK_E.js} +91 -83
- package/dist/input-element-BmXkhljw.cjs +1 -0
- 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-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +9 -9
- 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/{radiobutton-FwxpKELo.cjs → radiobutton-BuKXgQm_.cjs} +1 -1
- package/dist/{radiobutton-DuAo3CdN.js → radiobutton-C_MzK8dE.js} +1 -1
- package/dist/{select-wak-jukY.js → select-BHEtNwcz.js} +2 -2
- package/dist/{select-BbmLn1qh.cjs → select-BWnw7CJy.cjs} +2 -2
- package/dist/{tag-EFUKrc8q.cjs → tag-CWj979b6.cjs} +5 -5
- package/dist/{tag-CqMgt01I.js → tag-DDfymBgc.js} +13 -13
- package/dist/{textarea-CzN0E0TV.cjs → textarea-BC962syN.cjs} +2 -2
- package/dist/{textarea-CIb4VWtN.js → textarea-O0r9TzqP.js} +2 -2
- package/dist/{textinput-D5_RTkRY.js → textinput-COK0LcXj.js} +2 -2
- package/dist/{textinput-D8v6D6ie.cjs → textinput-DdcR7OZ-.cjs} +2 -2
- package/package.json +2 -2
- package/src/components/combobox/combobox.ts +1 -1
- package/src/components/datepicker/datepicker.ts +1 -1
- package/src/components/select/select.ts +1 -1
- package/src/components/tag/tag.ts +2 -2
- package/src/components/textarea/textarea.ts +1 -1
- package/src/components/textinput/textinput.ts +1 -1
- package/dist/input-element-KUsQQ-1d.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [13.18.3](https://github.com/oslokommune/punkt/compare/13.18.2...13.18.3) (2026-01-15)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [13.18.2](https://github.com/oslokommune/punkt/compare/13.18.1...13.18.2) (2026-01-12)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
Ingen
|
|
35
|
+
|
|
36
|
+
### Chores
|
|
37
|
+
Ingen
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
8
42
|
## [13.18.0](https://github.com/oslokommune/punkt/compare/13.17.0...13.18.0) (2025-12-22)
|
|
9
43
|
|
|
10
44
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const p=require("./class-map-C_erArZz.cjs"),h=require("./if-defined-Bc9-_I01.cjs"),t=require("./element-CJ_QKaki.cjs"),g=require("./pkt-slot-controller-BzddBp7z.cjs"),c=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./tag-
|
|
1
|
+
"use strict";const p=require("./class-map-C_erArZz.cjs"),h=require("./if-defined-Bc9-_I01.cjs"),t=require("./element-CJ_QKaki.cjs"),g=require("./pkt-slot-controller-BzddBp7z.cjs"),c=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./tag-CWj979b6.cjs");require("./heading--JKFppLS.cjs");const k={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},o={props:k};var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(i,a,s,n)=>{for(var r=n>1?void 0:n?m(a,s):a,d=i.length-1,l;d>=0;d--)(l=i[d])&&(r=(n?l(a,s,r):l(r))||r);return n&&r&&u(a,s,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=o.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=o.props.padding.default,this.skin=o.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new g.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var r,d;const a={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},s=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return t.x`
|
|
2
2
|
<article
|
|
3
3
|
class=${p.e(a)}
|
|
4
4
|
aria-label=${h.o(this.clickCardLink?s:n)}
|
|
@@ -4,7 +4,7 @@ import { P as u, E as d, x as t, n as r, a as m } from "./element-CRDRygXu.js";
|
|
|
4
4
|
import { P as $ } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
5
5
|
import { e as y, n as _ } from "./ref-Xa5dbh--.js";
|
|
6
6
|
import "./icon-1dy7UZcu.js";
|
|
7
|
-
import "./tag-
|
|
7
|
+
import "./tag-DDfymBgc.js";
|
|
8
8
|
import "./heading-Cs5yGnJg.js";
|
|
9
9
|
const b = { layout: { default: "vertical" }, skin: { type: ["outlined", "outlined-beige", "gray", "blue", "beige", "green"], default: "outlined" }, padding: { default: "default" } }, p = {
|
|
10
10
|
props: b
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-
|
|
1
|
+
"use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-BmXkhljw.cjs"),r=require("./ref-BFa5Utho.cjs"),p=require("./class-map-C_erArZz.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.x`
|
|
2
2
|
${this.tagText?t.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
|
|
3
3
|
${this.optionalTag?t.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
|
|
4
4
|
${this.requiredTag?t.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as r, x as p, n as s, a as d } from "./element-CRDRygXu.js";
|
|
2
|
-
import { P as k } from "./input-element-
|
|
2
|
+
import { P as k } from "./input-element-B0VPRK_E.js";
|
|
3
3
|
import { e as f, n as b } from "./ref-Xa5dbh--.js";
|
|
4
4
|
import { e as u } from "./class-map-wy7PUk0P.js";
|
|
5
5
|
var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (t, a, n, l) => {
|
|
@@ -4,12 +4,12 @@ import { r as c } from "./state-DS_kr2Fy.js";
|
|
|
4
4
|
import { e as _, n as v } from "./ref-Xa5dbh--.js";
|
|
5
5
|
import { e as k } from "./class-map-wy7PUk0P.js";
|
|
6
6
|
import { c as R } from "./repeat-CJ79egkN.js";
|
|
7
|
-
import { P as V } from "./input-element-
|
|
7
|
+
import { P as V } from "./input-element-B0VPRK_E.js";
|
|
8
8
|
import { P as A } from "./pkt-options-controller-CZO1nxZ8.js";
|
|
9
9
|
import { P as C } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
10
10
|
import "./input-wrapper-Wu3Yv-bn.js";
|
|
11
11
|
import "./icon-1dy7UZcu.js";
|
|
12
|
-
import "./tag-
|
|
12
|
+
import "./tag-DDfymBgc.js";
|
|
13
13
|
import "./listbox-mvKKzH-v.js";
|
|
14
14
|
const S = { displayValueAs: { default: "label" } }, T = {
|
|
15
15
|
props: S
|
|
@@ -93,7 +93,7 @@ let o = class extends V {
|
|
|
93
93
|
?requiredTag=${this.requiredTag}
|
|
94
94
|
.requiredText=${this.requiredText}
|
|
95
95
|
.tagText=${this.tagText}
|
|
96
|
-
|
|
96
|
+
useWrapper=${this.useWrapper}
|
|
97
97
|
.forId=${this.allowUserInput || this.typeahead ? this.id + "-input" : this.id + "-arrow"}
|
|
98
98
|
class="pkt-combobox__wrapper"
|
|
99
99
|
@labelClick=${this.handleInputClick}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-
|
|
1
|
+
"use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-BmXkhljw.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");require("./tag-CWj979b6.cjs");require("./listbox-DnoqOo5u.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,e,t,i)=>{for(var s=i>1?void 0:i?A(e,t):e,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const s=(e.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
?requiredTag=${this.requiredTag}
|
|
15
15
|
.requiredText=${this.requiredText}
|
|
16
16
|
.tagText=${this.tagText}
|
|
17
|
-
|
|
17
|
+
useWrapper=${this.useWrapper}
|
|
18
18
|
.forId=${this.allowUserInput||this.typeahead?this.id+"-input":this.id+"-arrow"}
|
|
19
19
|
class="pkt-combobox__wrapper"
|
|
20
20
|
@labelClick=${this.handleInputClick}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./element-CJ_QKaki.cjs"),_=require("./state-DSjcvzDN.cjs"),u=require("./calendar-Dz1Cnzx5.cjs"),I=require("./input-element-
|
|
1
|
+
"use strict";const a=require("./element-CJ_QKaki.cjs"),_=require("./state-DSjcvzDN.cjs"),u=require("./calendar-Dz1Cnzx5.cjs"),I=require("./input-element-BmXkhljw.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-B-Qseywc.cjs");const f=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs");require("./tag-CWj979b6.cjs");const S=require("./utils-byXsEz1u.cjs"),y=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs");var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,w=(i,e,t,s)=>{for(var n=s>1?void 0:s?M(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&A(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=S.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
|
|
2
2
|
<div class=${f.e(this.classes)} aria-live="polite">
|
|
3
3
|
${Array.isArray(this.dates)&&this.dates[0]?O.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return a.x` <pkt-tag
|
|
4
4
|
id=${this.idBase+e+"-tag"}
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
?required=${this.required}
|
|
261
261
|
?optionalTag=${this.optionalTag}
|
|
262
262
|
?requiredTag=${this.requiredTag}
|
|
263
|
-
|
|
263
|
+
useWrapper=${this.useWrapper}
|
|
264
264
|
.optionalText=${this.optionalText}
|
|
265
265
|
.requiredText=${this.requiredText}
|
|
266
266
|
.tagText=${this.tagText}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { P as I, E as A, x as d, n as a, a as R } from "./element-CRDRygXu.js";
|
|
2
2
|
import { r as q } from "./state-DS_kr2Fy.js";
|
|
3
3
|
import { s as U, f as N, n as j, a as W, i as H, b as L, v as O, d as G, e as J, p as Q, g as z } from "./calendar-Bz27nuTP.js";
|
|
4
|
-
import { P as X } from "./input-element-
|
|
4
|
+
import { P as X } from "./input-element-B0VPRK_E.js";
|
|
5
5
|
import { e as u, n as c } from "./ref-Xa5dbh--.js";
|
|
6
6
|
import "./icon-1dy7UZcu.js";
|
|
7
7
|
import "./input-wrapper-Wu3Yv-bn.js";
|
|
8
8
|
import { e as k } from "./class-map-wy7PUk0P.js";
|
|
9
9
|
import { c as Y } from "./repeat-CJ79egkN.js";
|
|
10
|
-
import "./tag-
|
|
10
|
+
import "./tag-DDfymBgc.js";
|
|
11
11
|
import { u as Z, s as tt } from "./utils-DznhwRXm.js";
|
|
12
12
|
import { o as C } from "./if-defined-BWZGb3bh.js";
|
|
13
13
|
import { P as et } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
@@ -1217,7 +1217,7 @@ let p = class extends X {
|
|
|
1217
1217
|
?required=${this.required}
|
|
1218
1218
|
?optionalTag=${this.optionalTag}
|
|
1219
1219
|
?requiredTag=${this.requiredTag}
|
|
1220
|
-
|
|
1220
|
+
useWrapper=${this.useWrapper}
|
|
1221
1221
|
.optionalText=${this.optionalText}
|
|
1222
1222
|
.requiredText=${this.requiredText}
|
|
1223
1223
|
.tagText=${this.tagText}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ declare type Booleanish = boolean | 'true' | 'false';
|
|
|
11
11
|
|
|
12
12
|
declare type Booleanish_2 = boolean | 'true' | 'false';
|
|
13
13
|
|
|
14
|
+
declare type Booleanish_3 = boolean | 'true' | 'false';
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* We define all props as optional. Native HTML attributes are optional by default,
|
|
16
18
|
* but the TS definition require either null or value. This way we can support showing a value as optional
|
|
@@ -959,7 +961,7 @@ declare class PktInputElement<T = {}> extends PktElement<Props_2 & T> {
|
|
|
959
961
|
optionalTag: boolean;
|
|
960
962
|
requiredTag: boolean;
|
|
961
963
|
skipForwardTestid: boolean;
|
|
962
|
-
useWrapper:
|
|
964
|
+
useWrapper: Booleanish_2;
|
|
963
965
|
fullwidth: boolean;
|
|
964
966
|
counterMaxLength: number;
|
|
965
967
|
errorMessage: string;
|
|
@@ -1017,7 +1019,7 @@ export declare class PktInputWrapper extends PktElement<Props_6> {
|
|
|
1017
1019
|
ariaDescribedby: string | undefined;
|
|
1018
1020
|
hasFieldset: boolean;
|
|
1019
1021
|
role: string | null;
|
|
1020
|
-
useWrapper:
|
|
1022
|
+
useWrapper: Booleanish_3;
|
|
1021
1023
|
protected updated(changedProperties: PropertyValues): void;
|
|
1022
1024
|
render(): TemplateResult<1>;
|
|
1023
1025
|
private toggleDropdown;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { r as
|
|
1
|
+
import { P as Ce, t as b, n as d } from "./element-CRDRygXu.js";
|
|
2
|
+
import { r as Fe } from "./state-DS_kr2Fy.js";
|
|
3
3
|
import { u as Te } from "./utils-DznhwRXm.js";
|
|
4
|
-
import { s as
|
|
4
|
+
import { s as Ae } from "./input-wrapper-CDgenrYA.js";
|
|
5
5
|
var oe = {}, le;
|
|
6
|
-
function
|
|
6
|
+
function Se() {
|
|
7
7
|
return le || (le = 1, (function() {
|
|
8
|
-
(function(
|
|
9
|
-
const s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(),
|
|
8
|
+
(function(f) {
|
|
9
|
+
const s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), L = {
|
|
10
10
|
ariaAtomic: "aria-atomic",
|
|
11
11
|
ariaAutoComplete: "aria-autocomplete",
|
|
12
12
|
ariaBusy: "aria-busy",
|
|
@@ -59,7 +59,7 @@ function Ae() {
|
|
|
59
59
|
return a;
|
|
60
60
|
},
|
|
61
61
|
set(n) {
|
|
62
|
-
a = n, t.isConnected ? k(t, r, n) :
|
|
62
|
+
a = n, t.isConnected ? k(t, r, n) : C.set(t, e);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -91,31 +91,31 @@ function Ae() {
|
|
|
91
91
|
t.forEach((e) => {
|
|
92
92
|
const { addedNodes: i, removedNodes: a } = e, r = Array.from(i), n = Array.from(a);
|
|
93
93
|
r.forEach((o) => {
|
|
94
|
-
var
|
|
95
|
-
if (u.has(o) && o.constructor.formAssociated && K(o),
|
|
96
|
-
const
|
|
97
|
-
Object.keys(L).filter((
|
|
98
|
-
k(o, L[
|
|
99
|
-
}),
|
|
94
|
+
var y;
|
|
95
|
+
if (u.has(o) && o.constructor.formAssociated && K(o), C.has(o)) {
|
|
96
|
+
const p = C.get(o);
|
|
97
|
+
Object.keys(L).filter((w) => p[w] !== null).forEach((w) => {
|
|
98
|
+
k(o, L[w], p[w]);
|
|
99
|
+
}), C.delete(o);
|
|
100
100
|
}
|
|
101
101
|
if (I.has(o)) {
|
|
102
|
-
const
|
|
103
|
-
k(o, "internals-valid",
|
|
102
|
+
const p = I.get(o);
|
|
103
|
+
k(o, "internals-valid", p.validity.valid.toString()), k(o, "internals-invalid", (!p.validity.valid).toString()), k(o, "aria-invalid", (!p.validity.valid).toString()), I.delete(o);
|
|
104
104
|
}
|
|
105
105
|
if (o.localName === "form") {
|
|
106
|
-
const
|
|
106
|
+
const p = v.get(o), M = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, {
|
|
107
107
|
acceptNode($) {
|
|
108
|
-
return u.has($) && $.constructor.formAssociated && !(
|
|
108
|
+
return u.has($) && $.constructor.formAssociated && !(p && p.has($)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
-
let
|
|
112
|
-
for (;
|
|
113
|
-
K(
|
|
111
|
+
let w = M.nextNode();
|
|
112
|
+
for (; w; )
|
|
113
|
+
K(w), w = M.nextNode();
|
|
114
114
|
}
|
|
115
|
-
o.localName === "fieldset" && ((
|
|
115
|
+
o.localName === "fieldset" && ((y = N.observe) === null || y === void 0 || y.call(N, o, G), j(o, !0));
|
|
116
116
|
}), n.forEach((o) => {
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const y = u.get(o);
|
|
118
|
+
y && m.get(y) && J(y), F.has(o) && F.get(o).disconnect();
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
}
|
|
@@ -142,15 +142,15 @@ function Ae() {
|
|
|
142
142
|
}, W = (t, e) => {
|
|
143
143
|
t.toggleAttribute("internals-disabled", e), e ? k(t, "aria-disabled", "true") : t.removeAttribute("aria-disabled"), t.formDisabledCallback && t.formDisabledCallback.apply(t, [e]);
|
|
144
144
|
}, J = (t) => {
|
|
145
|
-
|
|
145
|
+
m.get(t).forEach((i) => {
|
|
146
146
|
i.remove();
|
|
147
|
-
}),
|
|
147
|
+
}), m.set(t, []);
|
|
148
148
|
}, Q = (t, e) => {
|
|
149
149
|
const i = document.createElement("input");
|
|
150
|
-
return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i),
|
|
150
|
+
return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), m.get(e).push(i), i;
|
|
151
151
|
}, ue = (t, e) => {
|
|
152
152
|
var i;
|
|
153
|
-
|
|
153
|
+
m.set(e, []), (i = N.observe) === null || i === void 0 || i.call(N, t, G);
|
|
154
154
|
}, X = (t, e) => {
|
|
155
155
|
if (e.length) {
|
|
156
156
|
Array.from(e).forEach((a) => a.addEventListener("click", t.click.bind(t)));
|
|
@@ -158,7 +158,7 @@ function Ae() {
|
|
|
158
158
|
e[0].id || (i = `${e[0].htmlFor}_Label`, e[0].id = i), k(t, "aria-labelledby", i);
|
|
159
159
|
}
|
|
160
160
|
}, R = (t) => {
|
|
161
|
-
const e = Array.from(t.elements).filter((n) => !n.tagName.includes("-") && n.validity).map((n) => n.validity.valid), i =
|
|
161
|
+
const e = Array.from(t.elements).filter((n) => !n.tagName.includes("-") && n.validity).map((n) => n.validity.valid), i = v.get(t) || [], a = Array.from(i).filter((n) => n.isConnected).map((n) => u.get(n).validity.valid), r = [...e, ...a].includes(!1);
|
|
162
162
|
t.toggleAttribute("internals-invalid", r), t.toggleAttribute("internals-valid", !r);
|
|
163
163
|
}, fe = (t) => {
|
|
164
164
|
R(O(t.target));
|
|
@@ -168,25 +168,25 @@ function Ae() {
|
|
|
168
168
|
const e = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${t.id ? `,${i}[form='${t.id}']` : ""}`).join(",");
|
|
169
169
|
t.addEventListener("click", (i) => {
|
|
170
170
|
if (i.target.closest(e)) {
|
|
171
|
-
const r =
|
|
171
|
+
const r = v.get(t);
|
|
172
172
|
if (t.noValidate)
|
|
173
173
|
return;
|
|
174
|
-
r.size && Array.from(r).reverse().map((
|
|
174
|
+
r.size && Array.from(r).reverse().map((y) => u.get(y).reportValidity()).includes(!1) && i.preventDefault();
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}, ye = (t) => {
|
|
178
|
-
const e =
|
|
178
|
+
const e = v.get(t.target);
|
|
179
179
|
e && e.size && e.forEach((i) => {
|
|
180
180
|
i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
|
|
181
181
|
});
|
|
182
182
|
}, Y = (t, e, i) => {
|
|
183
183
|
if (e) {
|
|
184
|
-
const a =
|
|
184
|
+
const a = v.get(e);
|
|
185
185
|
if (a)
|
|
186
186
|
a.add(t);
|
|
187
187
|
else {
|
|
188
188
|
const r = /* @__PURE__ */ new Set();
|
|
189
|
-
r.add(t),
|
|
189
|
+
r.add(t), v.set(e, r), me(e), e.addEventListener("reset", ye), e.addEventListener("input", fe), e.addEventListener("change", pe);
|
|
190
190
|
}
|
|
191
191
|
V.set(e, { ref: t, internals: i }), t.constructor.formAssociated && t.formAssociatedCallback && setTimeout(() => {
|
|
192
192
|
t.formAssociatedCallback.apply(t, [e]);
|
|
@@ -195,11 +195,11 @@ function Ae() {
|
|
|
195
195
|
}, O = (t) => {
|
|
196
196
|
let e = t.parentNode;
|
|
197
197
|
return e && e.tagName !== "FORM" && (e = O(e)), e;
|
|
198
|
-
},
|
|
198
|
+
}, E = (t, e, i = DOMException) => {
|
|
199
199
|
if (!t.constructor.formAssociated)
|
|
200
200
|
throw new i(e);
|
|
201
201
|
}, Z = (t, e, i) => {
|
|
202
|
-
const a =
|
|
202
|
+
const a = v.get(t);
|
|
203
203
|
return a && a.size && a.forEach((r) => {
|
|
204
204
|
u.get(r)[i]() || (e = !1);
|
|
205
205
|
}), e;
|
|
@@ -302,11 +302,11 @@ function Ae() {
|
|
|
302
302
|
const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
303
303
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
304
304
|
get(...n) {
|
|
305
|
-
const o = r.call(this, ...n),
|
|
306
|
-
if (
|
|
305
|
+
const o = r.call(this, ...n), y = Array.from(v.get(this) || []);
|
|
306
|
+
if (y.length === 0)
|
|
307
307
|
return o;
|
|
308
|
-
const
|
|
309
|
-
return new Me(
|
|
308
|
+
const p = Array.from(o).concat(y).sort((M, w) => M.compareDocumentPosition ? M.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
|
|
309
|
+
return new Me(p);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}
|
|
@@ -322,7 +322,7 @@ function Ae() {
|
|
|
322
322
|
}
|
|
323
323
|
checkValidity() {
|
|
324
324
|
const e = s.get(this);
|
|
325
|
-
if (
|
|
325
|
+
if (E(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
326
326
|
return !0;
|
|
327
327
|
const i = h.get(this);
|
|
328
328
|
if (!i.valid) {
|
|
@@ -337,28 +337,28 @@ function Ae() {
|
|
|
337
337
|
}
|
|
338
338
|
get form() {
|
|
339
339
|
const e = s.get(this);
|
|
340
|
-
|
|
340
|
+
E(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
341
341
|
let i;
|
|
342
342
|
return e.constructor.formAssociated === !0 && (i = O(e)), i;
|
|
343
343
|
}
|
|
344
344
|
get labels() {
|
|
345
345
|
const e = s.get(this);
|
|
346
|
-
|
|
346
|
+
E(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
347
347
|
const i = e.getAttribute("id"), a = e.getRootNode();
|
|
348
348
|
return a && i ? a.querySelectorAll(`[for="${i}"]`) : [];
|
|
349
349
|
}
|
|
350
350
|
reportValidity() {
|
|
351
351
|
const e = s.get(this);
|
|
352
|
-
if (
|
|
352
|
+
if (E(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
353
353
|
return !0;
|
|
354
|
-
const i = this.checkValidity(), a =
|
|
354
|
+
const i = this.checkValidity(), a = S.get(this);
|
|
355
355
|
if (a && !e.constructor.formAssociated)
|
|
356
356
|
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
357
357
|
return !i && a && (e.focus(), a.focus()), i;
|
|
358
358
|
}
|
|
359
359
|
setFormValue(e) {
|
|
360
360
|
const i = s.get(this);
|
|
361
|
-
if (
|
|
361
|
+
if (E(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), J(this), e != null && !(e instanceof FormData)) {
|
|
362
362
|
if (i.getAttribute("name")) {
|
|
363
363
|
const a = Q(i, this);
|
|
364
364
|
a.value = e;
|
|
@@ -373,35 +373,35 @@ function Ae() {
|
|
|
373
373
|
}
|
|
374
374
|
setValidity(e, i, a) {
|
|
375
375
|
const r = s.get(this);
|
|
376
|
-
if (
|
|
376
|
+
if (E(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e)
|
|
377
377
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
378
|
-
|
|
378
|
+
S.set(this, a);
|
|
379
379
|
const n = h.get(this), o = {};
|
|
380
|
-
for (const
|
|
381
|
-
o[
|
|
380
|
+
for (const M in e)
|
|
381
|
+
o[M] = e[M];
|
|
382
382
|
Object.keys(o).length === 0 && be(n);
|
|
383
|
-
const
|
|
384
|
-
delete
|
|
385
|
-
const { valid:
|
|
386
|
-
if (!
|
|
383
|
+
const y = Object.assign(Object.assign({}, n), o);
|
|
384
|
+
delete y.valid;
|
|
385
|
+
const { valid: p } = ve(n, y, this.form);
|
|
386
|
+
if (!p && !i)
|
|
387
387
|
throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
|
|
388
|
-
|
|
388
|
+
g.set(this, p ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !p), r.toggleAttribute("internals-valid", p), k(r, "aria-invalid", `${!p}`)) : I.set(r, this);
|
|
389
389
|
}
|
|
390
390
|
get shadowRoot() {
|
|
391
|
-
const e = s.get(this), i =
|
|
391
|
+
const e = s.get(this), i = A.get(e);
|
|
392
392
|
return i || null;
|
|
393
393
|
}
|
|
394
394
|
get validationMessage() {
|
|
395
395
|
const e = s.get(this);
|
|
396
|
-
return
|
|
396
|
+
return E(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), g.get(this);
|
|
397
397
|
}
|
|
398
398
|
get validity() {
|
|
399
399
|
const e = s.get(this);
|
|
400
|
-
return
|
|
400
|
+
return E(e, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), h.get(this);
|
|
401
401
|
}
|
|
402
402
|
get willValidate() {
|
|
403
403
|
const e = s.get(this);
|
|
404
|
-
return
|
|
404
|
+
return E(e, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(e.disabled || e.hasAttribute("disabled") || e.hasAttribute("readonly"));
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function Ve() {
|
|
@@ -460,9 +460,9 @@ function Ae() {
|
|
|
460
460
|
}), typeof Element < "u") {
|
|
461
461
|
let e = function(...a) {
|
|
462
462
|
const r = i.apply(this, a);
|
|
463
|
-
if (
|
|
463
|
+
if (A.set(this, r), D()) {
|
|
464
464
|
const n = new MutationObserver(P);
|
|
465
|
-
window.ShadyDOM ? n.observe(this, H) : n.observe(r, H),
|
|
465
|
+
window.ShadyDOM ? n.observe(this, H) : n.observe(r, H), F.set(this, n);
|
|
466
466
|
}
|
|
467
467
|
return r;
|
|
468
468
|
};
|
|
@@ -472,45 +472,53 @@ function Ae() {
|
|
|
472
472
|
D() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, H), typeof HTMLFormElement < "u" && ke(), (t || typeof window < "u" && !window.CustomStateSet) && q();
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
return !!customElements.polyfillWrapFlushCallback || (Ve() ? typeof window < "u" && !window.CustomStateSet && q(HTMLElement.prototype.attachInternals) : ne(!1)),
|
|
475
|
+
return !!customElements.polyfillWrapFlushCallback || (Ve() ? typeof window < "u" && !window.CustomStateSet && q(HTMLElement.prototype.attachInternals) : ne(!1)), f.forceCustomStateSetPolyfill = q, f.forceElementInternalsPolyfill = ne, Object.defineProperty(f, "__esModule", { value: !0 }), f;
|
|
476
476
|
})({});
|
|
477
477
|
})()), oe;
|
|
478
478
|
}
|
|
479
|
-
|
|
480
|
-
var xe = Object.defineProperty, l = (
|
|
481
|
-
for (var u = void 0,
|
|
482
|
-
(V =
|
|
479
|
+
Se();
|
|
480
|
+
var xe = Object.defineProperty, l = (f, s, h, m) => {
|
|
481
|
+
for (var u = void 0, g = f.length - 1, V; g >= 0; g--)
|
|
482
|
+
(V = f[g]) && (u = V(s, h, u) || u);
|
|
483
483
|
return u && xe(s, h, u), u;
|
|
484
484
|
};
|
|
485
|
-
|
|
485
|
+
const Ie = {
|
|
486
|
+
fromAttribute(f) {
|
|
487
|
+
return f == null ? !1 : f === "" || f === "true" || f === !0 ? !0 : f === "false" || f === !1 ? !1 : !!f;
|
|
488
|
+
},
|
|
489
|
+
toAttribute(f) {
|
|
490
|
+
return f ? "true" : "false";
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
class c extends Ce {
|
|
486
494
|
constructor() {
|
|
487
|
-
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = Te(), this.counter = !1, this.hasError = !1, this.inline = !1, this.hasFieldset = !1, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton =
|
|
495
|
+
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = Te(), this.counter = !1, this.hasError = !1, this.inline = !1, this.hasFieldset = !1, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = Ae.props.helptextDropdownButton.default, this.label = null, this.optionalText = b.forms.labels.optional, this.requiredText = b.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
|
|
488
496
|
}
|
|
489
497
|
static get formAssociated() {
|
|
490
498
|
return !0;
|
|
491
499
|
}
|
|
492
500
|
manageValidity(s) {
|
|
493
|
-
var h,
|
|
494
|
-
s && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 },
|
|
501
|
+
var h, m, u, g, V, F, v, T, C, A, S;
|
|
502
|
+
s && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, b.forms.messages.required, s) : (h = s.validity) != null && h.typeMismatch || (m = s.validity) != null && m.badInput ? this.internals.setValidity({ typeMismatch: !0 }, b.forms.messages.invalid, s) : (u = s.validity) != null && u.patternMismatch ? this.internals.setValidity(
|
|
495
503
|
{ patternMismatch: !0 },
|
|
496
|
-
|
|
504
|
+
b.forms.messages.invalidPattern,
|
|
497
505
|
s
|
|
498
|
-
) : (
|
|
506
|
+
) : (g = s.validity) != null && g.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, b.forms.messages.tooShort, s) : (V = s.validity) != null && V.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, b.forms.messages.tooLong, s) : (F = s.validity) != null && F.rangeUnderflow ? this.internals.setValidity(
|
|
499
507
|
{ rangeUnderflow: !0 },
|
|
500
|
-
this.min ?
|
|
508
|
+
this.min ? b.forms.messages.rangeUnderflowMin.replace("{min}", (v = this.min) == null ? void 0 : v.toString()) : b.forms.messages.rangeUnderflow,
|
|
501
509
|
s
|
|
502
|
-
) : (T = s.validity) != null && T.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 },
|
|
510
|
+
) : (T = s.validity) != null && T.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, b.forms.messages.invalid, s) : (C = s.validity) != null && C.rangeOverflow ? this.internals.setValidity(
|
|
503
511
|
{ rangeOverflow: !0 },
|
|
504
|
-
this.max ?
|
|
512
|
+
this.max ? b.forms.messages.rangeOverflowMax.replace("{max}", (A = this.max) == null ? void 0 : A.toString()) : b.forms.messages.rangeOverflow,
|
|
505
513
|
s
|
|
506
|
-
) : (
|
|
514
|
+
) : (S = s.validity) != null && S.customError ? this.internals.setValidity({ customError: !0 }, s.validationMessage, s) : this.internals.setValidity({}));
|
|
507
515
|
}
|
|
508
516
|
setFormValue(s) {
|
|
509
517
|
if (this.internals)
|
|
510
518
|
if (Array.isArray(s)) {
|
|
511
519
|
const h = new FormData();
|
|
512
|
-
s.forEach((
|
|
513
|
-
h.append(this.name,
|
|
520
|
+
s.forEach((m) => {
|
|
521
|
+
h.append(this.name, m);
|
|
514
522
|
}), this.internals.setFormValue(h);
|
|
515
523
|
} else
|
|
516
524
|
this.internals.setFormValue(s);
|
|
@@ -519,13 +527,13 @@ class c extends Fe {
|
|
|
519
527
|
// Do not use valueChanged or onChange for radios and checkboxes!
|
|
520
528
|
valueChecked(s) {
|
|
521
529
|
if (!this.touched) return;
|
|
522
|
-
const h = this.internals.form || this.closest("form"),
|
|
530
|
+
const h = this.internals.form || this.closest("form"), m = h ? new FormData(h) : null;
|
|
523
531
|
h && h.querySelectorAll(
|
|
524
532
|
`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`
|
|
525
533
|
).forEach((u) => {
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
}), typeof s == "string" ? (this.checked = s === "true", this.internals.ariaChecked = s === "true") : typeof s == "boolean" && (this.checked = s, this.internals.ariaChecked = s), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"),
|
|
534
|
+
const g = u;
|
|
535
|
+
g.name === this.name && g.value !== this.value && g.checked && (g.checked = !1);
|
|
536
|
+
}), typeof s == "string" ? (this.checked = s === "true", this.internals.ariaChecked = s === "true") : typeof s == "boolean" && (this.checked = s, this.internals.ariaChecked = s), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), m && m.append(this.name, this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue(null, null), m && m.delete(this.name), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
|
|
529
537
|
new CustomEvent("value-change", {
|
|
530
538
|
detail: this.checked,
|
|
531
539
|
bubbles: !0,
|
|
@@ -664,7 +672,7 @@ l([
|
|
|
664
672
|
d({ type: Boolean })
|
|
665
673
|
], c.prototype, "skipForwardTestid");
|
|
666
674
|
l([
|
|
667
|
-
d({ type: Boolean, reflect: !
|
|
675
|
+
d({ type: Boolean, reflect: !0, converter: Ie })
|
|
668
676
|
], c.prototype, "useWrapper");
|
|
669
677
|
l([
|
|
670
678
|
d({ type: Boolean, reflect: !0 })
|
|
@@ -700,7 +708,7 @@ l([
|
|
|
700
708
|
d({ type: String, attribute: "data-testid" })
|
|
701
709
|
], c.prototype, "dataTestid");
|
|
702
710
|
l([
|
|
703
|
-
|
|
711
|
+
Fe()
|
|
704
712
|
], c.prototype, "touched");
|
|
705
713
|
export {
|
|
706
714
|
c as P
|