@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.
- package/dist/{datepicker-iNCYioZ9.js → datepicker-BhavwiBZ.js} +1 -1
- package/dist/{datepicker-BHepKxof.cjs → datepicker-vX74tb3R.cjs} +1 -1
- package/dist/{input-element-D1Vls6A5.js → input-element-BQTCZtNQ.js} +24 -23
- package/dist/input-element-DNklGY_O.cjs +1 -0
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +3 -3
- 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/{textarea-BiUrhAlk.cjs → textarea-BFWHQHLs.cjs} +1 -1
- package/dist/{textarea-BAGWR1Hi.js → textarea-BYtGXst8.js} +1 -1
- package/dist/{textinput-CHOR5PPp.cjs → textinput-33wZwZ4O.cjs} +1 -1
- package/dist/{textinput-pJ3N8m6g.js → textinput-IgHewJDJ.js} +1 -1
- package/package.json +2 -2
- package/dist/input-element-DPKoFVwJ.cjs +0 -1
|
@@ -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-
|
|
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-
|
|
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
|
|
2
|
-
import { r as
|
|
3
|
-
import { u as
|
|
4
|
-
import { s as
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
(
|
|
8
|
-
return
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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 },
|
|
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
|
-
|
|
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
|
-
|
|
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((
|
|
37
|
-
r.append(this.name,
|
|
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.
|
|
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
|
-
|
|
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;
|
package/dist/pkt-datepicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-
|
|
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;
|
package/dist/pkt-datepicker.js
CHANGED
package/dist/pkt-index.cjs
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
20
|
-
import { P as rt } from "./textinput-
|
|
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);
|
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-
|
|
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;
|
package/dist/pkt-textarea.js
CHANGED
package/dist/pkt-textinput.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-
|
|
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;
|
package/dist/pkt-textinput.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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": "
|
|
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;
|