@oslokommune/punkt-elements 12.17.1 → 12.17.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/{class-map-D-Nmgexv.js → class-map-CBvUV2N3.js} +1 -1
- package/dist/{class-map-BnCpUrtH.cjs → class-map-a5HUzP83.cjs} +1 -1
- package/dist/{helptext-DwN28F32.js → helptext-DBolvFI4.js} +3 -3
- package/dist/{helptext-DDbifEx5.cjs → helptext-_fMLOOCL.cjs} +1 -1
- package/dist/{index-DW4hjYT3.js → index-CFDwiDTU.js} +263 -254
- package/dist/{index-BFZbp2IB.cjs → index-CR7t1zY9.cjs} +29 -29
- package/dist/{index-BZX8Yq1_.cjs → index-CmTjXoAb.cjs} +1 -1
- package/dist/{index-DsPP-K4k.js → index-D2jSRMrn.js} +3 -3
- package/dist/{index-DTJQL9UP.js → index-RwtTBIhT.js} +1 -1
- package/dist/{index-C9PvTVGX.cjs → index-tvpcg-ad.cjs} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/{input-wrapper-cHPCKrs3.js → input-wrapper-6vTrKtsW.js} +5 -5
- package/dist/{input-wrapper-DbOD47ez.cjs → input-wrapper-DX41tnbj.cjs} +1 -1
- package/dist/{linkcard-BX2C_57h.js → linkcard-BlWQ8jOv.js} +3 -3
- package/dist/{linkcard-B99cHv7Z.cjs → linkcard-Det6CJ5D.cjs} +1 -1
- package/dist/{modal-CgsJDZKq.js → modal-3OZTPqee.js} +4 -4
- package/dist/{modal-Cwu6zHyz.cjs → modal-DYTVJjYh.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +6 -6
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +8 -8
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +4 -4
- 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/{ref-DiDJSYtE.cjs → ref-C2yPtMJA.cjs} +1 -1
- package/dist/{ref-1EN04wbN.js → ref-CaiKp3S2.js} +1 -1
- package/dist/{textarea-Dv5nvmK1.cjs → textarea-B45ZZYpx.cjs} +1 -1
- package/dist/{textarea-7hU6CyOU.js → textarea-BTpJjEhO.js} +5 -5
- package/dist/{textinput-BIPqkY2M.cjs → textinput-BIhQEr8z.cjs} +1 -1
- package/dist/{textinput-bRxRV8Dc.js → textinput-CVo5wG14.js} +5 -5
- package/package.json +2 -2
- package/src/components/element/index.ts +17 -0
package/dist/pkt-linkcard.js
CHANGED
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CR7t1zY9.cjs"),c=require("./ref-C2yPtMJA.cjs"),b=require("./class-map-a5HUzP83.cjs"),k=require("./custom-element-B-TlBwRu.cjs");require("./index-CmTjXoAb.cjs");const d="pkt-messagebox",u=!0,m={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},g={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},h={default:{description:"Innholdet i meldingsboksen"}},p={name:d,"css-class":"pkt-messagebox",isElement:u,events:m,props:g,slots:h};var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,o=(i,t,n,l)=>{for(var s=l>1?void 0:l?x(t,n):t,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(l?a(t,n,s):a(s))||s);return l&&s&&f(t,n,s),s};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closable=p.props.closable.default,this.compact=p.props.compact.default,this.title="",this.skin=p.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this.slotController=new c.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.x`<div class=${b.e(t)}>
|
|
2
2
|
${this.closable?e.x`<div class="pkt-messagebox__close">
|
|
3
3
|
<button
|
|
4
4
|
@click=${this.close}
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as b, P as k, x as c, E as d, n } from "./index-
|
|
2
|
-
import { e as u, P as g, n as h } from "./ref-
|
|
3
|
-
import { e as f } from "./class-map-
|
|
1
|
+
import { r as b, P as k, x as c, E as d, n } from "./index-CFDwiDTU.js";
|
|
2
|
+
import { e as u, P as g, n as h } from "./ref-CaiKp3S2.js";
|
|
3
|
+
import { e as f } from "./class-map-CBvUV2N3.js";
|
|
4
4
|
import { t as v } from "./custom-element-CWfU4dcr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
const _ = "pkt-messagebox", x = !0, y = {
|
|
7
7
|
onClose: {
|
|
8
8
|
description: "React: Event som trigges når meldingsboksen lukkes"
|
package/dist/pkt-modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./modal-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./modal-DYTVJjYh.cjs"),t=e.PktModal;Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>e.PktModal});exports.default=t;
|
package/dist/pkt-modal.js
CHANGED
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-a5HUzP83.cjs"),g=require("./custom-element-B-TlBwRu.cjs"),t=require("./index-CR7t1zY9.cjs"),o=require("./ref-C2yPtMJA.cjs");require("./index-CmTjXoAb.cjs");const h="pkt-tag",k=!0,d={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"icon",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",isElement:k,props:d,slots:f};var y=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(n,e,l,r)=>{for(var i=r>1?void 0:r?m(e,l):e,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(r?c(e,l,i):c(i))||i);return r&&i&&y(e,l,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.e(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},l={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
2
2
|
<button
|
|
3
3
|
class=${u.e(l)}
|
|
4
4
|
type=${this.type}
|
package/dist/pkt-tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as h } from "./class-map-
|
|
1
|
+
import { e as h } from "./class-map-CBvUV2N3.js";
|
|
2
2
|
import { t as d } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { r as y, P as g, x as p, n as l } from "./index-
|
|
4
|
-
import { e as m, P as k, n as f } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as y, P as g, x as p, n as l } from "./index-CFDwiDTU.js";
|
|
4
|
+
import { e as m, P as k, n as f } from "./ref-CaiKp3S2.js";
|
|
5
|
+
import "./index-RwtTBIhT.js";
|
|
6
6
|
const b = "pkt-tag", S = !0, $ = {
|
|
7
7
|
closeTag: {
|
|
8
8
|
type: "boolean",
|
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-B45ZZYpx.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-BIhQEr8z.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 A=require("./index-
|
|
1
|
+
"use strict";const A=require("./index-CR7t1zY9.cjs"),$=require("./custom-element-B-TlBwRu.cjs");class N{constructor(e,...t){this.nodes=[],this.host=e,this.host.addController(this),this.slots=t,this.nodes=[],this.observer=new MutationObserver(i=>this.handleMutations(i))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0})}hostDisconnected(){this.observer.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{var i;if(t.nodeType===Node.TEXT_NODE&&((i=t.nodeValue)!=null&&i.trim())){const o=document==null?void 0:document.createElement("template");o.content.appendChild(t),this.nodes.push(o)}else this.isSlotElement(t)||this.nodes.push(t)})}updateSlots(){this.slots.forEach(e=>{if(!e.value)return;const t=e.value.getAttribute("name"),o=this.nodes.flatMap(n=>n.getAttribute&&n.getAttribute("slot")==t?this.nodeFromElement(n,e):[]).filter(n=>e.value&&!e.value.contains(n)&&!n.contains(e.value));o.length>0&&e.value.replaceChildren(...o)})}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(o=>{var h;const n=o.nodeType===Node.ELEMENT_NODE&&!this.isSlotElement(o),l=o.nodeType===Node.TEXT_NODE&&((h=o.nodeValue)==null?void 0:h.trim());if(n)this.nodes.push(o),t=!0;else if(l){const d=document==null?void 0:document.createElement("template");d.content.appendChild(o),this.nodes.push(d),t=!0}}),i.removedNodes.forEach(o=>{this.nodes=this.nodes.filter(n=>n!==o),t=!0}))}),t&&this.updateSlots()}isSlotElement(e){return this.slots.some(t=>t.value===e)}nodeFromElement(e,t){var i;return e===((i=t.value)==null?void 0:i.parentNode)?[]:e instanceof HTMLTemplateElement?Array.from(e.content.childNodes):[e]}}/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-CR7t1zY9.cjs"),s=require("./custom-element-B-TlBwRu.cjs"),u=require("./ref-C2yPtMJA.cjs"),p=require("./class-map-a5HUzP83.cjs");require("./input-wrapper-DX41tnbj.cjs");require("./index-CmTjXoAb.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as l, E as h, r as c, a as $, x as g, n as p } from "./index-
|
|
1
|
+
import { T as l, E as h, r as c, a as $, x as g, n as p } from "./index-CFDwiDTU.js";
|
|
2
2
|
import { e as m, i as f, a as n, t as b } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { f as v, m as x, e as T, n as y } from "./ref-
|
|
4
|
-
import { e as w } from "./class-map-
|
|
5
|
-
import "./input-wrapper-
|
|
6
|
-
import "./index-
|
|
3
|
+
import { f as v, m as x, e as T, n as y } from "./ref-CaiKp3S2.js";
|
|
4
|
+
import { e as w } from "./class-map-CBvUV2N3.js";
|
|
5
|
+
import "./input-wrapper-6vTrKtsW.js";
|
|
6
|
+
import "./index-RwtTBIhT.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2020 Google LLC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./index-
|
|
1
|
+
"use strict";const t=require("./index-CR7t1zY9.cjs"),h=require("./custom-element-B-TlBwRu.cjs"),o=require("./ref-C2yPtMJA.cjs"),l=require("./class-map-a5HUzP83.cjs");require("./input-wrapper-DX41tnbj.cjs");require("./index-CmTjXoAb.cjs");var c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,r=(p,i,n,s)=>{for(var e=s>1?void 0:s?d(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&&c(i,n,e),e};exports.PktTextinput=class extends t.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}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as c, a as d, x as h, E as n, n as p } from "./index-
|
|
1
|
+
import { r as c, a as d, x as h, E as n, n as p } from "./index-CFDwiDTU.js";
|
|
2
2
|
import { t as $ } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { e as g, n as m } from "./ref-
|
|
4
|
-
import { e as f } from "./class-map-
|
|
5
|
-
import "./input-wrapper-
|
|
6
|
-
import "./index-
|
|
3
|
+
import { e as g, n as m } from "./ref-CaiKp3S2.js";
|
|
4
|
+
import { e as f } from "./class-map-CBvUV2N3.js";
|
|
5
|
+
import "./input-wrapper-6vTrKtsW.js";
|
|
6
|
+
import "./index-RwtTBIhT.js";
|
|
7
7
|
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (i, e, r, t) => {
|
|
8
8
|
for (var o = t > 1 ? void 0 : t ? y(e, r) : e, u = i.length - 1, l; u >= 0; u--)
|
|
9
9
|
(l = i[u]) && (o = (t ? l(e, r, o) : l(o)) || o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.17.
|
|
3
|
+
"version": "12.17.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": "998cf96281840a47cba5ba3e0c76e6fa1d2ed10e"
|
|
61
61
|
}
|
|
@@ -154,6 +154,12 @@ export class PktInputElement extends PktElement {
|
|
|
154
154
|
@property({ type: Boolean })
|
|
155
155
|
useWrapper: boolean = true
|
|
156
156
|
|
|
157
|
+
@property({ type: String, attribute: 'data-testid' })
|
|
158
|
+
dataTestid: string = ''
|
|
159
|
+
|
|
160
|
+
@property({ type: Boolean })
|
|
161
|
+
skipForwardTestid: boolean = false
|
|
162
|
+
|
|
157
163
|
@state() touched: boolean = false
|
|
158
164
|
|
|
159
165
|
constructor() {
|
|
@@ -320,6 +326,17 @@ export class PktInputElement extends PktElement {
|
|
|
320
326
|
this.internals.reportValidity()
|
|
321
327
|
}
|
|
322
328
|
|
|
329
|
+
protected updated(_changedProperties: PropertyValues): void {
|
|
330
|
+
if (_changedProperties.has('dataTestid') && this.dataTestid && this.inputRef.value) {
|
|
331
|
+
if (!this.skipForwardTestid) {
|
|
332
|
+
this.inputRef.value.dataset.testid = this.dataTestid
|
|
333
|
+
this.removeAttribute('data-testid')
|
|
334
|
+
} else if (!this.hasAttribute('data-testid')) {
|
|
335
|
+
this.setAttribute('data-testid', this.dataTestid)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
323
340
|
protected firstUpdated(_changedProperties: PropertyValues): void {
|
|
324
341
|
super.firstUpdated(_changedProperties)
|
|
325
342
|
|