@oslokommune/punkt-elements 12.18.1 → 12.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { o as k } from "./if-defined-ZFE4ti2t.js";
3
3
  import { e as L, i as j, b as F, T as q, x as v, E as T, n as u, t as H } from "./icon-wUXeHiBk.js";
4
4
  import { r as V } from "./state-BfyXV7EL.js";
5
5
  import { n as D, f as _, a as N, b as E, d as A } from "./calendar-BUqcNvfI.js";
6
- import { P as U } from "./input-element-D1Vls6A5.js";
6
+ import { P as U } from "./input-element-BQTCZtNQ.js";
7
7
  import { p as K, v as y, r as w, M as I, m as W, e as R, n as $ } from "./ref-DuFGTLVX.js";
8
8
  import "./input-wrapper-BTQk3W8T.js";
9
9
  import "./tag-DGFgUF3l.js";
@@ -1,4 +1,4 @@
1
- "use strict";const $=require("./class-map-Boa7BqCc.cjs"),k=require("./if-defined-DEDlGbAc.cjs"),s=require("./icon-CdMQ6zBT.cjs"),T=require("./state-SKYD8kRO.cjs"),g=require("./calendar-QSulz7im.cjs"),S=require("./input-element-DPKoFVwJ.cjs"),r=require("./ref-DCOsLZQg.cjs");require("./input-wrapper-D-PNRJB_.cjs");require("./tag-CGy2mSLE.cjs");/**
1
+ "use strict";const $=require("./class-map-Boa7BqCc.cjs"),k=require("./if-defined-DEDlGbAc.cjs"),s=require("./icon-CdMQ6zBT.cjs"),T=require("./state-SKYD8kRO.cjs"),g=require("./calendar-QSulz7im.cjs"),S=require("./input-element-DNklGY_O.cjs"),r=require("./ref-DCOsLZQg.cjs");require("./input-wrapper-D-PNRJB_.cjs");require("./tag-CGy2mSLE.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,40 +1,41 @@
1
- import { n as s, P as d, s as a } from "./icon-wUXeHiBk.js";
2
- import { r as u } from "./state-BfyXV7EL.js";
3
- import { u as y } from "./stringutils-DJjRa8dG.js";
4
- import { s as f } from "./helptext--4FLdAWi.js";
5
- var m = Object.defineProperty, e = (n, t, r, h) => {
6
- for (var o = void 0, l = n.length - 1, p; l >= 0; l--)
7
- (p = n[l]) && (o = p(t, r, o) || o);
8
- return o && m(t, r, o), o;
1
+ import { n as s, P as f, s as o } from "./icon-wUXeHiBk.js";
2
+ import { r as m } from "./state-BfyXV7EL.js";
3
+ import { u as g } from "./stringutils-DJjRa8dG.js";
4
+ import { s as c } from "./helptext--4FLdAWi.js";
5
+ var v = Object.defineProperty, e = (p, t, r, l) => {
6
+ for (var a = void 0, n = p.length - 1, h; n >= 0; n--)
7
+ (h = p[n]) && (a = h(t, r, a) || a);
8
+ return a && v(t, r, a), a;
9
9
  };
10
- class i extends d {
10
+ class i extends f {
11
11
  constructor() {
12
- super(), this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = 0, this.min = null, this.minlength = 0, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = "", this.placeholder = "", this.id = y(), 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 = f.props.helptextDropdownButton.default, this.label = null, this.optionalText = a.forms.labels.optional, this.requiredText = a.forms.labels.required, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
12
+ super(), this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = 0, this.min = null, this.minlength = 0, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = "", this.placeholder = "", this.id = g(), 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.props.helptextDropdownButton.default, this.label = null, this.optionalText = o.forms.labels.optional, this.requiredText = o.forms.labels.required, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
13
13
  }
14
14
  static get formAssociated() {
15
15
  return !0;
16
16
  }
17
17
  manageValidity(t) {
18
- this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, a.forms.messages.required, t) : t.validity.typeMismatch || t.validity.badInput ? this.internals.setValidity({ typeMismatch: !0 }, a.forms.messages.invalid, t) : t.validity.patternMismatch ? this.internals.setValidity(
18
+ var r, l, a, n, h, u, d, y;
19
+ t && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, o.forms.messages.required, t) : (r = t.validity) != null && r.typeMismatch || (l = t.validity) != null && l.badInput ? this.internals.setValidity({ typeMismatch: !0 }, o.forms.messages.invalid, t) : (a = t.validity) != null && a.patternMismatch ? this.internals.setValidity(
19
20
  { patternMismatch: !0 },
20
- a.forms.messages.invalidPattern,
21
+ o.forms.messages.invalidPattern,
21
22
  t
22
- ) : t.validity.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, a.forms.messages.tooShort, t) : t.validity.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, a.forms.messages.tooLong, t) : t.validity.rangeUnderflow ? this.internals.setValidity(
23
+ ) : (n = t.validity) != null && n.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, o.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 }, o.forms.messages.tooLong, t) : (u = t.validity) != null && u.rangeUnderflow ? this.internals.setValidity(
23
24
  { rangeUnderflow: !0 },
24
- a.forms.messages.rangeUnderflow,
25
+ o.forms.messages.rangeUnderflow,
25
26
  t
26
- ) : t.validity.rangeOverflow ? this.internals.setValidity(
27
+ ) : (d = t.validity) != null && d.rangeOverflow ? this.internals.setValidity(
27
28
  { rangeOverflow: !0 },
28
- a.forms.messages.rangeOverflow,
29
+ o.forms.messages.rangeOverflow,
29
30
  t
30
- ) : t.validity.customError ? this.internals.setValidity({ customError: !0 }, t.validationMessage, t) : this.internals.setValidity({});
31
+ ) : (y = t.validity) != null && y.customError ? this.internals.setValidity({ customError: !0 }, t.validationMessage, t) : this.internals.setValidity({}));
31
32
  }
32
33
  setFormValue(t) {
33
34
  if (this.internals)
34
35
  if (Array.isArray(t)) {
35
36
  const r = new FormData();
36
- t.forEach((h) => {
37
- r.append(this.name, h);
37
+ t.forEach((l) => {
38
+ r.append(this.name, l);
38
39
  }), this.internals.setFormValue(r);
39
40
  } else
40
41
  this.internals.setFormValue(t);
@@ -71,7 +72,7 @@ class i extends d {
71
72
  this.touched = !0, t && this.setFormValue(t);
72
73
  return;
73
74
  }
74
- 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.inputRef2 && this.manageValidity(this.inputRef2.value), this.dispatchEvent(new Event("change")), this.dispatchEvent(
75
+ 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(
75
76
  new CustomEvent("value-change", {
76
77
  detail: t,
77
78
  bubbles: !0,
@@ -80,10 +81,10 @@ class i extends d {
80
81
  ), this.internals.reportValidity());
81
82
  }
82
83
  updated(t) {
83
- 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")));
84
+ 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")));
84
85
  }
85
86
  firstUpdated(t) {
86
- super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.internals.setFormValue(this.value), this.inputRef.value && this.manageValidity(this.inputRef.value);
87
+ super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.internals.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));
87
88
  }
88
89
  }
89
90
  e([
@@ -177,7 +178,7 @@ e([
177
178
  s({ type: String, attribute: "data-testid" })
178
179
  ], i.prototype, "dataTestid");
179
180
  e([
180
- u()
181
+ m()
181
182
  ], i.prototype, "touched");
182
183
  export {
183
184
  i as P
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./icon-CdMQ6zBT.cjs"),y=require("./state-SKYD8kRO.cjs"),f=require("./stringutils-CkVRq4jP.cjs"),g=require("./helptext-iZEgxz2U.cjs");var m=Object.defineProperty,s=(h,t,r,o)=>{for(var a=void 0,n=h.length-1,l;n>=0;n--)(l=h[n])&&(a=l(t,r,a)||a);return a&&m(t,r,a),a};class i extends e.PktElement{constructor(){super(),this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=0,this.min=null,this.minlength=0,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern="",this.placeholder="",this.id=f.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=g.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.strings.forms.labels.optional,this.requiredText=e.strings.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var r,o,a,n,l,p,u,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.strings.forms.messages.required,t):(r=t.validity)!=null&&r.typeMismatch||(o=t.validity)!=null&&o.badInput?this.internals.setValidity({typeMismatch:!0},e.strings.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.strings.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.strings.forms.messages.tooShort,t):(l=t.validity)!=null&&l.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.strings.forms.messages.tooLong,t):(p=t.validity)!=null&&p.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.strings.forms.messages.rangeUnderflow,t):(u=t.validity)!=null&&u.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.strings.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(o=>{r.append(this.name,o)}),this.internals.setFormValue(r)}else this.internals.setFormValue(t)}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.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.internals.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({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([y.r()],i.prototype,"touched");exports.PktInputElement=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-BHepKxof.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-vX74tb3R.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./datepicker-iNCYioZ9.js";
1
+ import { P as t } from "./datepicker-BhavwiBZ.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktDatepicker,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alert-BbVWu2lm.cjs"),u=require("./calendar-QSulz7im.cjs"),d=require("./card-B0GPdG5M.cjs"),t=require("./icon-CdMQ6zBT.cjs"),k=require("./pkt-slot-controller-Ckk_yV0j.cjs"),i=require("./ref-DCOsLZQg.cjs"),P=require("./class-map-Boa7BqCc.cjs"),h=require("./datepicker-BHepKxof.cjs"),g=require("./helptext-iZEgxz2U.cjs"),b=require("./input-wrapper-D-PNRJB_.cjs"),m=require("./link-BpqavGSD.cjs"),f=require("./linkcard-DSu3A4Yx.cjs"),y=require("./messagebox-C1aWoQbu.cjs"),v=require("./modal-Avai5eVz.cjs"),x=require("./progressbar-CuXkbAhJ.cjs"),C=require("./tag-CGy2mSLE.cjs"),O=require("./textarea-BiUrhAlk.cjs"),j=require("./textinput-CHOR5PPp.cjs");var q=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(a,e,r,s)=>{for(var n=s>1?void 0:s?S(e,r):e,l=a.length-1,p;l>=0;l--)(p=a[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&q(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=i.e(),this.namedSlot=i.e(),this.slotController=new k.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alert-BbVWu2lm.cjs"),u=require("./calendar-QSulz7im.cjs"),d=require("./card-B0GPdG5M.cjs"),t=require("./icon-CdMQ6zBT.cjs"),k=require("./pkt-slot-controller-Ckk_yV0j.cjs"),i=require("./ref-DCOsLZQg.cjs"),P=require("./class-map-Boa7BqCc.cjs"),h=require("./datepicker-vX74tb3R.cjs"),g=require("./helptext-iZEgxz2U.cjs"),b=require("./input-wrapper-D-PNRJB_.cjs"),m=require("./link-BpqavGSD.cjs"),f=require("./linkcard-DSu3A4Yx.cjs"),y=require("./messagebox-C1aWoQbu.cjs"),v=require("./modal-Avai5eVz.cjs"),x=require("./progressbar-CuXkbAhJ.cjs"),C=require("./tag-CGy2mSLE.cjs"),O=require("./textarea-BFWHQHLs.cjs"),j=require("./textinput-33wZwZ4O.cjs");var q=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(a,e,r,s)=>{for(var n=s>1?void 0:s?S(e,r):e,l=a.length-1,p;l>=0;l--)(p=a[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&q(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=i.e(),this.namedSlot=i.e(),this.slotController=new k.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${P.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -7,7 +7,7 @@ import { a as D } from "./icon-wUXeHiBk.js";
7
7
  import { P as x } from "./pkt-slot-controller-RJvOnbF4.js";
8
8
  import { e as m, n as d } from "./ref-DuFGTLVX.js";
9
9
  import { e as u } from "./class-map-hz16xq5a.js";
10
- import { P as G } from "./datepicker-iNCYioZ9.js";
10
+ import { P as G } from "./datepicker-BhavwiBZ.js";
11
11
  import { P as M } from "./helptext--4FLdAWi.js";
12
12
  import { P as B } from "./input-wrapper-BTQk3W8T.js";
13
13
  import { P as N } from "./link-Bx9nVgZi.js";
@@ -16,8 +16,8 @@ import { P as z } from "./messagebox-LpiVQIoM.js";
16
16
  import { P as J } from "./modal-Co1YFmHi.js";
17
17
  import { P as V } from "./progressbar-BS_oawSB.js";
18
18
  import { P as Y } from "./tag-DGFgUF3l.js";
19
- import { P as tt } from "./textarea-BAGWR1Hi.js";
20
- import { P as rt } from "./textinput-pJ3N8m6g.js";
19
+ import { P as tt } from "./textarea-BYtGXst8.js";
20
+ import { P as rt } from "./textinput-IgHewJDJ.js";
21
21
  var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (t, e, i, a) => {
22
22
  for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, l; p >= 0; p--)
23
23
  (l = t[p]) && (r = (a ? l(e, i, r) : l(r)) || r);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-BiUrhAlk.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-BFWHQHLs.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as a } from "./textarea-BAGWR1Hi.js";
1
+ import { P as a } from "./textarea-BYtGXst8.js";
2
2
  const e = a;
3
3
  export {
4
4
  a as PktTextarea,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-CHOR5PPp.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-33wZwZ4O.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./textinput-pJ3N8m6g.js";
1
+ import { P as t } from "./textinput-IgHewJDJ.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktTextinput,
@@ -1,4 +1,4 @@
1
- "use strict";const r=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),o=require("./ref-DCOsLZQg.cjs"),p=require("./class-map-Boa7BqCc.cjs"),d=require("./input-element-DPKoFVwJ.cjs");require("./input-wrapper-D-PNRJB_.cjs");/**
1
+ "use strict";const r=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),o=require("./ref-DCOsLZQg.cjs"),p=require("./class-map-Boa7BqCc.cjs"),d=require("./input-element-DNklGY_O.cjs");require("./input-wrapper-D-PNRJB_.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -2,7 +2,7 @@ import { e as c, i as $, b as n, T as l, E as h, x as m, n as p, t as g } from "
2
2
  import { r as f } from "./state-BfyXV7EL.js";
3
3
  import { f as b, m as v, e as x, n as T } from "./ref-DuFGTLVX.js";
4
4
  import { e as y } from "./class-map-hz16xq5a.js";
5
- import { P as w } from "./input-element-D1Vls6A5.js";
5
+ import { P as w } from "./input-element-BQTCZtNQ.js";
6
6
  import "./input-wrapper-BTQk3W8T.js";
7
7
  /**
8
8
  * @license
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),o=require("./ref-DCOsLZQg.cjs"),l=require("./class-map-Boa7BqCc.cjs"),c=require("./input-element-DPKoFVwJ.cjs");require("./input-wrapper-D-PNRJB_.cjs");var d=Object.defineProperty,x=Object.getOwnPropertyDescriptor,r=(p,i,n,s)=>{for(var e=s>1?void 0:s?x(i,n):i,a=p.length-1,u;a>=0;a--)(u=p[a])&&(e=(s?u(i,n,e):u(e))||e);return s&&e&&d(i,n,e),e};exports.PktTextinput=class extends c.PktInputElement{constructor(){super(...arguments),this.value="",this.type="text",this.size=null,this.autocomplete="off",this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.inputRef=o.e()}attributeChangedCallback(i,n,s){i==="value"&&this.value!==n&&(this.counterCurrent=s?s.length:0,this.valueChanged(s,n)),super.attributeChangedCallback(i,n,s)}updated(i){var n;super.updated(i),i.has("value")&&(this.counterCurrent=((n=this.value)==null?void 0:n.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,n=l.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 t.x`
1
+ "use strict";const t=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),o=require("./ref-DCOsLZQg.cjs"),l=require("./class-map-Boa7BqCc.cjs"),c=require("./input-element-DNklGY_O.cjs");require("./input-wrapper-D-PNRJB_.cjs");var d=Object.defineProperty,x=Object.getOwnPropertyDescriptor,r=(p,i,n,s)=>{for(var e=s>1?void 0:s?x(i,n):i,a=p.length-1,u;a>=0;a--)(u=p[a])&&(e=(s?u(i,n,e):u(e))||e);return s&&e&&d(i,n,e),e};exports.PktTextinput=class extends c.PktInputElement{constructor(){super(...arguments),this.value="",this.type="text",this.size=null,this.autocomplete="off",this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.inputRef=o.e()}attributeChangedCallback(i,n,s){i==="value"&&this.value!==n&&(this.counterCurrent=s?s.length:0,this.valueChanged(s,n)),super.attributeChangedCallback(i,n,s)}updated(i){var n;super.updated(i),i.has("value")&&(this.counterCurrent=((n=this.value)==null?void 0:n.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,n=l.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 t.x`
2
2
  <pkt-input-wrapper
3
3
  label="${this.label}"
4
4
  ?counter=${this.counter}
@@ -2,7 +2,7 @@ import { x as h, E as n, n as o, t as c } from "./icon-wUXeHiBk.js";
2
2
  import { r as d } from "./state-BfyXV7EL.js";
3
3
  import { e as $, n as g } from "./ref-DuFGTLVX.js";
4
4
  import { e as m } from "./class-map-hz16xq5a.js";
5
- import { P as f } from "./input-element-D1Vls6A5.js";
5
+ import { P as f } from "./input-element-BQTCZtNQ.js";
6
6
  import "./input-wrapper-BTQk3W8T.js";
7
7
  var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (i, e, r, t) => {
8
8
  for (var p = t > 1 ? void 0 : t ? y(e, r) : e, u = i.length - 1, l; u >= 0; u--)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.18.1",
3
+ "version": "12.18.2",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -57,5 +57,5 @@
57
57
  "url": "https://github.com/oslokommune/punkt/issues"
58
58
  },
59
59
  "license": "MIT",
60
- "gitHead": "6ae85b68cc5757ecef1c2a851cc4450e5e27f3db"
60
+ "gitHead": "f61cae2389adc17b73a7e9dcb876b7a27e6f5cf7"
61
61
  }
@@ -1 +0,0 @@
1
- "use strict";const e=require("./icon-CdMQ6zBT.cjs"),p=require("./state-SKYD8kRO.cjs"),u=require("./stringutils-CkVRq4jP.cjs"),d=require("./helptext-iZEgxz2U.cjs");var y=Object.defineProperty,s=(n,t,r,l)=>{for(var a=void 0,o=n.length-1,h;o>=0;o--)(h=n[o])&&(a=h(t,r,a)||a);return a&&y(t,r,a),a};class i extends e.PktElement{constructor(){super(),this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=0,this.min=null,this.minlength=0,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern="",this.placeholder="",this.id=u.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=d.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.strings.forms.labels.optional,this.requiredText=e.strings.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.strings.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},e.strings.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.strings.forms.messages.invalidPattern,t):t.validity.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.strings.forms.messages.tooShort,t):t.validity.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.strings.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.strings.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.strings.forms.messages.rangeOverflow,t):t.validity.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)}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.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}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.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.inputRef.value&&this.manageValidity(this.inputRef.value)}}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([p.r()],i.prototype,"touched");exports.PktInputElement=i;