@oslokommune/punkt-elements 12.31.2 → 12.32.0
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/{alert-BDxxRqgi.cjs → alert-D5G5UJuo.cjs} +1 -1
- package/dist/{alert-D0S57u0r.js → alert-gERpVuB7.js} +6 -6
- package/dist/alert.d.ts +32 -0
- package/dist/{backlink-CzpB-ih9.js → backlink-DdNgqA56.js} +2 -2
- package/dist/{backlink-Dn4DfWVR.cjs → backlink-Q2HTG9jm.cjs} +1 -1
- package/dist/backlink.d.ts +32 -0
- package/dist/{button-Beo3c7cx.cjs → button-BPyZeW73.cjs} +1 -1
- package/dist/{button-9NwGr-OS.js → button-rArIL0-j.js} +3 -3
- package/dist/button.d.ts +32 -0
- package/dist/{calendar-BbZNxsKY.js → calendar-1ryAEdX3.js} +4 -4
- package/dist/{calendar-CxBo98iI.cjs → calendar-2DqPLXdD.cjs} +1 -1
- package/dist/calendar.d.ts +32 -0
- package/dist/{card-DQfNKnKl.js → card-BbMBpvJt.js} +7 -7
- package/dist/{card-C63x_nll.cjs → card-ZX09f_ka.cjs} +1 -1
- package/dist/card.d.ts +32 -0
- package/dist/{checkbox-9Zjy_NU7.cjs → checkbox-BnDG6wIO.cjs} +1 -1
- package/dist/{checkbox-CzDpR6_8.js → checkbox-Ceui2TLp.js} +4 -4
- package/dist/checkbox.d.ts +32 -0
- package/dist/{class-map-DWtqmIRS.js → class-map-ChuDQU5C.js} +1 -1
- package/dist/{class-map-Dj5mbCUg.cjs → class-map-D4rXyUxT.cjs} +1 -1
- package/dist/combobox-DH-YlbNh.cjs +115 -0
- package/dist/combobox-DbO6I0GT.js +694 -0
- package/dist/combobox.d.ts +47 -0
- package/dist/{datepicker-CYUvRGhE.js → datepicker-8MOgQsyL.js} +144 -196
- package/dist/datepicker-BRH-59Q9.cjs +153 -0
- package/dist/datepicker.d.ts +32 -0
- package/dist/directive-helpers-D7XIyCQ_.js +45 -0
- package/dist/directive-helpers-mGjAtADc.cjs +5 -0
- package/dist/{element-CzFXQBoS.cjs → element-BBo3JZk5.cjs} +1 -1
- package/dist/{element-C7XjZtLU.js → element-G8JoS0Lj.js} +6 -0
- package/dist/{helptext-B9kxDc2b.cjs → helptext-B4Uc-d56.cjs} +2 -2
- package/dist/{helptext-CqnoPodd.js → helptext-Y4cSgTkd.js} +10 -10
- package/dist/helptext.d.ts +32 -0
- package/dist/{icon-BEUgV9Wo.js → icon-BJnwW0eh.js} +1 -1
- package/dist/{icon-BOKusjAA.cjs → icon-BTUCDPN5.cjs} +1 -1
- package/dist/icon.d.ts +32 -0
- package/dist/{if-defined-CpIkv1A4.cjs → if-defined-C1ZDVzYn.cjs} +1 -1
- package/dist/{if-defined-eRX4e5zO.js → if-defined-rCqT8Od1.js} +1 -1
- package/dist/index.d.ts +208 -14
- package/dist/input-element-AhnBdCb8.cjs +1 -0
- package/dist/{input-element-BK8UkQli.js → input-element-DM2uSYaW.js} +22 -19
- package/dist/input-wrapper-BdZxmQyO.cjs +52 -0
- package/dist/input-wrapper-DQmYzhcy.js +185 -0
- package/dist/input-wrapper.d.ts +32 -0
- package/dist/{link-D3U0Jkz8.js → link-C3lW3z8X.js} +5 -5
- package/dist/{link-1iq0Pmuf.cjs → link-DOVlsg2S.cjs} +1 -1
- package/dist/link.d.ts +32 -0
- package/dist/{linkcard-CRpo3tiw.js → linkcard-CvqqyHVW.js} +4 -4
- package/dist/{linkcard-2WzDJPZz.cjs → linkcard-DDD92XfD.cjs} +1 -1
- package/dist/linkcard.d.ts +32 -0
- package/dist/listbox-BTVnrHWv.cjs +95 -0
- package/dist/listbox-DX-Euxdm.js +360 -0
- package/dist/listbox.d.ts +47 -0
- package/dist/{loader-B1edLWTg.js → loader-BudoV0yd.js} +6 -6
- package/dist/{loader-DI74pe25.cjs → loader-Csq0Yd1k.cjs} +1 -1
- package/dist/loader.d.ts +32 -0
- package/dist/{messagebox-DQpEMkS2.cjs → messagebox-8GwnNqb0.cjs} +1 -1
- package/dist/{messagebox-KP-8-tA9.js → messagebox-D6uexEhg.js} +6 -6
- package/dist/messagebox.d.ts +32 -0
- package/dist/{modal-ytIJwfr3.cjs → modal-CLixB4Dz.cjs} +1 -1
- package/dist/{modal-kPX8nO_L.js → modal-DnYn2Rlg.js} +6 -6
- package/dist/modal.d.ts +32 -0
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -0
- package/dist/pkt-combobox.js +6 -0
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +3 -3
- package/dist/pkt-index.js +45 -43
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -0
- package/dist/pkt-listbox.js +6 -0
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-options-controller-BtU1zEtG.cjs +1 -0
- package/dist/pkt-options-controller-CZplGTgu.js +38 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-slot-controller-CqNvEpFd.cjs +1 -0
- package/dist/{pkt-slot-controller-Clbye6cM.js → pkt-slot-controller-D1DakVrU.js} +17 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-B6A9UVXS.cjs → progressbar-BW_icNId.cjs} +1 -1
- package/dist/{progressbar-D0nxLqHu.js → progressbar-czvExwTL.js} +5 -5
- package/dist/progressbar.d.ts +32 -0
- package/dist/{radiobutton-BWyQgR_x.cjs → radiobutton-BeSuCrbp.cjs} +1 -1
- package/dist/{radiobutton-DLWjvLBO.js → radiobutton-DKo27Stm.js} +5 -5
- package/dist/radiobutton.d.ts +32 -0
- package/dist/ref-DsoUUoPU.cjs +9 -0
- package/dist/ref-cRTOoM4R.js +102 -0
- package/dist/repeat-CArTw6-s.js +61 -0
- package/dist/repeat-kruY8poV.cjs +5 -0
- package/dist/select-DxHhPEgD.js +118 -0
- package/dist/select-lvFnhEVg.cjs +49 -0
- package/dist/select.d.ts +32 -0
- package/dist/{state-HNj0_316.cjs → state-BILlRnrD.cjs} +1 -1
- package/dist/{state-CDQk0DFQ.js → state-gfUuUqVg.js} +1 -1
- package/dist/{tag-CmFcSdOV.js → tag-CWx1XsGR.js} +7 -7
- package/dist/{tag-BeLSOjNh.cjs → tag-DThwKsrg.cjs} +1 -1
- package/dist/tag.d.ts +32 -0
- package/dist/{textarea-BPqWCymU.js → textarea-BNNDbxxO.js} +18 -17
- package/dist/{textarea-VG-UTMLP.cjs → textarea-CDsLbogK.cjs} +6 -6
- package/dist/textarea.d.ts +32 -0
- package/dist/{textinput-CEP7QA3E.cjs → textinput-C3C088Ki.cjs} +5 -4
- package/dist/{textinput-VD74aGzx.js → textinput-M8I4dfoP.js} +25 -24
- package/dist/textinput.d.ts +32 -0
- package/package.json +3 -3
- package/src/components/combobox/combobox.ts +873 -0
- package/src/components/combobox/countrycodes.json +927 -0
- package/src/components/combobox/index.ts +6 -0
- package/src/components/datepicker/datepicker.ts +2 -0
- package/src/components/helptext/helptext.ts +1 -1
- package/src/components/index.ts +7 -0
- package/src/components/input-wrapper/input-wrapper.ts +42 -34
- package/src/components/listbox/index.ts +4 -0
- package/src/components/listbox/listbox.ts +474 -0
- package/src/components/select/select.ts +7 -0
- package/src/components/textinput/textinput.ts +3 -2
- package/dist/datepicker-FuAL0uNU.cjs +0 -155
- package/dist/input-element-Dtyuf6s8.cjs +0 -1
- package/dist/input-wrapper-Bo2_t6pA.cjs +0 -50
- package/dist/input-wrapper-DaZZq8c0.js +0 -172
- package/dist/pkt-slot-controller-Oc32unDk.cjs +0 -1
- package/dist/ref-2anvRHT4.cjs +0 -13
- package/dist/ref-DbOSDQbk.js +0 -143
- package/dist/select-CzuxXKll.js +0 -150
- package/dist/select-DZL6aa2s.cjs +0 -48
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";const s=require("./element-
|
|
1
|
+
"use strict";const s=require("./element-BBo3JZk5.cjs"),p=require("./if-defined-C1ZDVzYn.cjs"),c=require("./state-BILlRnrD.cjs"),l=require("./ref-DsoUUoPU.cjs"),$=require("./class-map-D4rXyUxT.cjs"),a=require("./directive-C_VV3qwo.cjs"),d=require("./directive-helpers-mGjAtADc.cjs"),x=require("./input-element-AhnBdCb8.cjs"),T=require("./pkt-slot-controller-CqNvEpFd.cjs");require("./input-wrapper-BdZxmQyO.cjs");require("./icon-BTUCDPN5.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const g=a.e(class extends a.i{constructor(r){if(super(r),r.type!==a.t.PROPERTY&&r.type!==a.t.ATTRIBUTE&&r.type!==a.t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!d.f(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===s.T||e===s.E)return e;const i=r.element,t=r.name;if(r.type===a.t.PROPERTY){if(e===i[t])return s.T}else if(r.type===a.t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(t))return s.T}else if(r.type===a.t.ATTRIBUTE&&i.getAttribute(t)===e+"")return s.T;return d.m(r),e}});var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,o=(r,e,i,t)=>{for(var n=t>1?void 0:t?f(e,i):e,u=r.length-1,h;u>=0;u--)(h=r[u])&&(n=(t?h(e,i,n):h(n))||n);return t&&n&&v(e,i,n),n};exports.PktTextarea=class extends x.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new T.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(e,i,t){e==="value"&&this.value!==i&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,i)),super.attributeChangedCallback(e,i,t)}updated(e){var i;super.updated(e),e.has("value")&&(this.counterCurrent=((i=this.value)==null?void 0:i.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=$.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}),i=this.ariaLabelledby||`${this.id}-input-label`;return s.x`<pkt-input-wrapper
|
|
6
6
|
label=${this.label}
|
|
7
7
|
?counter=${this.counter}
|
|
8
8
|
?disabled=${this.disabled}
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
.requiredText=${this.requiredText}
|
|
25
25
|
class="pkt-textarea"
|
|
26
26
|
>
|
|
27
|
-
<div class="pkt-contents" ${
|
|
27
|
+
<div class="pkt-contents" ${l.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
28
28
|
<textarea
|
|
29
|
-
${
|
|
29
|
+
${l.n(this.inputRef)}
|
|
30
30
|
class=${e}
|
|
31
31
|
id=${this.id+"-input"}
|
|
32
32
|
name=${(this.name||this.id)+"-input"}
|
|
33
33
|
placeholder=${p.o(this.placeholder)}
|
|
34
|
-
.value=${
|
|
34
|
+
.value=${g(this.value)}
|
|
35
35
|
minlength=${p.o(this.minlength)}
|
|
36
36
|
maxlength=${p.o(this.maxlength)}
|
|
37
37
|
?readonly=${this.readonly}
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
@focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
|
|
47
47
|
@blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
|
|
48
48
|
></textarea>
|
|
49
|
-
</pkt-input-wrapper>`}};
|
|
49
|
+
</pkt-input-wrapper>`}};o([s.n({type:String,reflect:!0})],exports.PktTextarea.prototype,"value",2);o([s.n({type:String})],exports.PktTextarea.prototype,"autocomplete",2);o([s.n({type:Number})],exports.PktTextarea.prototype,"rows",2);o([c.r()],exports.PktTextarea.prototype,"counterCurrent",2);exports.PktTextarea=o([s.t("pkt-textarea")],exports.PktTextarea);
|
package/dist/textarea.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
6
|
+
*
|
|
7
|
+
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
8
|
+
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
9
|
+
*
|
|
10
|
+
* @slot (default) - Options to be rendered as children
|
|
11
|
+
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
4
29
|
declare global {
|
|
5
30
|
interface HTMLElementTagNameMap {
|
|
6
31
|
'pkt-icon': PktIcon;
|
|
@@ -8,6 +33,13 @@ declare global {
|
|
|
8
33
|
}
|
|
9
34
|
|
|
10
35
|
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'pkt-listbox': PktListbox;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
11
43
|
declare global {
|
|
12
44
|
interface Window {
|
|
13
45
|
pktTz: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-BBo3JZk5.cjs"),u=require("./if-defined-C1ZDVzYn.cjs"),l=require("./state-BILlRnrD.cjs"),p=require("./ref-DsoUUoPU.cjs"),c=require("./class-map-D4rXyUxT.cjs"),d=require("./input-element-AhnBdCb8.cjs"),x=require("./pkt-slot-controller-CqNvEpFd.cjs");require("./input-wrapper-BdZxmQyO.cjs");require("./icon-BTUCDPN5.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(o,i,s,n)=>{for(var e=n>1?void 0:n?g(i,s):i,a=o.length-1,h;a>=0;a--)(h=o[a])&&(e=(n?h(i,s,e):h(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=p.e(),this.helptextSlot=p.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new x.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.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,s=c.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}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
label="${this.label}"
|
|
4
4
|
?counter=${this.counter}
|
|
5
5
|
?disabled=${this.disabled}
|
|
6
6
|
?hasError=${this.hasError}
|
|
7
|
+
?hasFieldset=${this.hasFieldset}
|
|
7
8
|
?inline=${this.inline}
|
|
8
9
|
?optionalTag=${this.optionalTag}
|
|
9
10
|
?required=${this.required}
|
|
@@ -26,13 +27,13 @@
|
|
|
26
27
|
${this.prefix?t.x`<div class="pkt-input-prefix">${this.prefix}</div>`:t.E}
|
|
27
28
|
<input
|
|
28
29
|
${p.n(this.inputRef)}
|
|
29
|
-
class=${
|
|
30
|
+
class=${s}
|
|
30
31
|
type=${this.type}
|
|
31
32
|
name=${(this.name||this.id)+"-input"}
|
|
32
33
|
id=${this.id+"-input"}
|
|
33
34
|
placeholder=${u.o(this.placeholder)}
|
|
34
|
-
aria-labelledby=${
|
|
35
|
-
autocomplete=${this.autocomplete}
|
|
35
|
+
aria-labelledby=${n}
|
|
36
|
+
autocomplete=${this.autocomplete||"off"}
|
|
36
37
|
minlength=${u.o(this.minlength)}
|
|
37
38
|
maxlength=${u.o(this.maxlength)}
|
|
38
39
|
?readonly=${this.readonly}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { x as p, E as h, n as o, a as $ } from "./element-
|
|
2
|
-
import { o as c } from "./if-defined-
|
|
3
|
-
import { r as f } from "./state-
|
|
4
|
-
import { e as d, n as m } from "./ref-
|
|
5
|
-
import { e as g } from "./class-map-
|
|
6
|
-
import { P as x } from "./input-element-
|
|
7
|
-
import { P as y } from "./pkt-slot-controller-
|
|
8
|
-
import "./input-wrapper-
|
|
9
|
-
import "./icon-
|
|
10
|
-
var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (
|
|
11
|
-
for (var a = t > 1 ? void 0 : t ? b(
|
|
12
|
-
(u =
|
|
13
|
-
return t && a && v(
|
|
1
|
+
import { x as p, E as h, n as o, a as $ } from "./element-G8JoS0Lj.js";
|
|
2
|
+
import { o as c } from "./if-defined-rCqT8Od1.js";
|
|
3
|
+
import { r as f } from "./state-gfUuUqVg.js";
|
|
4
|
+
import { e as d, n as m } from "./ref-cRTOoM4R.js";
|
|
5
|
+
import { e as g } from "./class-map-ChuDQU5C.js";
|
|
6
|
+
import { P as x } from "./input-element-DM2uSYaW.js";
|
|
7
|
+
import { P as y } from "./pkt-slot-controller-D1DakVrU.js";
|
|
8
|
+
import "./input-wrapper-DQmYzhcy.js";
|
|
9
|
+
import "./icon-BJnwW0eh.js";
|
|
10
|
+
var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (e, i, r, t) => {
|
|
11
|
+
for (var a = t > 1 ? void 0 : t ? b(i, r) : i, l = e.length - 1, u; l >= 0; l--)
|
|
12
|
+
(u = e[l]) && (a = (t ? u(i, r, a) : u(a)) || a);
|
|
13
|
+
return t && a && v(i, r, a), a;
|
|
14
14
|
};
|
|
15
15
|
let s = class extends x {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(), this.inputRef = d(), this.helptextSlot = d(), this.value = "", this.type = "text", this.size = null, this.autocomplete =
|
|
17
|
+
super(), this.inputRef = d(), this.helptextSlot = d(), this.value = "", this.type = "text", this.size = null, this.autocomplete = null, this.iconNameRight = null, this.prefix = null, this.suffix = null, this.omitSearchIcon = !1, this.counterCurrent = 0, this.slotController = new y(this, this.helptextSlot);
|
|
18
18
|
}
|
|
19
|
-
attributeChangedCallback(
|
|
20
|
-
|
|
19
|
+
attributeChangedCallback(e, i, r) {
|
|
20
|
+
e === "value" && this.value !== i && (this.counterCurrent = r ? r.length : 0, this.valueChanged(r, i)), super.attributeChangedCallback(e, i, r);
|
|
21
21
|
}
|
|
22
|
-
updated(
|
|
23
|
-
var
|
|
24
|
-
super.updated(
|
|
22
|
+
updated(e) {
|
|
23
|
+
var i;
|
|
24
|
+
super.updated(e), e.has("value") && (this.counterCurrent = ((i = this.value) == null ? void 0 : i.length) || 0, this.valueChanged(this.value, e.get("value"))), e.has("id") && !this.name && this.id && (this.name = this.id);
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
const
|
|
27
|
+
const e = this.type === "search" && !this.iconNameRight && !this.omitSearchIcon, i = g({
|
|
28
28
|
"pkt-input": !0,
|
|
29
29
|
"pkt-input--fullwidth": this.fullwidth,
|
|
30
30
|
"pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
|
|
@@ -35,6 +35,7 @@ let s = class extends x {
|
|
|
35
35
|
?counter=${this.counter}
|
|
36
36
|
?disabled=${this.disabled}
|
|
37
37
|
?hasError=${this.hasError}
|
|
38
|
+
?hasFieldset=${this.hasFieldset}
|
|
38
39
|
?inline=${this.inline}
|
|
39
40
|
?optionalTag=${this.optionalTag}
|
|
40
41
|
?required=${this.required}
|
|
@@ -57,13 +58,13 @@ let s = class extends x {
|
|
|
57
58
|
${this.prefix ? p`<div class="pkt-input-prefix">${this.prefix}</div>` : h}
|
|
58
59
|
<input
|
|
59
60
|
${m(this.inputRef)}
|
|
60
|
-
class=${
|
|
61
|
+
class=${i}
|
|
61
62
|
type=${this.type}
|
|
62
63
|
name=${(this.name || this.id) + "-input"}
|
|
63
64
|
id=${this.id + "-input"}
|
|
64
65
|
placeholder=${c(this.placeholder)}
|
|
65
66
|
aria-labelledby=${r}
|
|
66
|
-
autocomplete=${this.autocomplete}
|
|
67
|
+
autocomplete=${this.autocomplete || "off"}
|
|
67
68
|
minlength=${c(this.minlength)}
|
|
68
69
|
maxlength=${c(this.maxlength)}
|
|
69
70
|
?readonly=${this.readonly}
|
|
@@ -91,13 +92,13 @@ let s = class extends x {
|
|
|
91
92
|
class="pkt-input-suffix-icon"
|
|
92
93
|
name=${this.iconNameRight}
|
|
93
94
|
></pkt-icon>` : h}
|
|
94
|
-
${
|
|
95
|
+
${e ? p`<pkt-icon
|
|
95
96
|
class="pkt-input-suffix-icon"
|
|
96
97
|
name="magnifying-glass-big"
|
|
97
98
|
></pkt-icon>` : h}
|
|
98
99
|
</div>` : h}
|
|
99
100
|
${!this.suffix && this.iconNameRight ? p`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>` : h}
|
|
100
|
-
${!this.suffix &&
|
|
101
|
+
${!this.suffix && e ? p`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>` : h}
|
|
101
102
|
</div>
|
|
102
103
|
</pkt-input-wrapper>
|
|
103
104
|
`;
|
package/dist/textinput.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
6
|
+
*
|
|
7
|
+
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
8
|
+
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
9
|
+
*
|
|
10
|
+
* @slot (default) - Options to be rendered as children
|
|
11
|
+
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
4
29
|
declare global {
|
|
5
30
|
interface HTMLElementTagNameMap {
|
|
6
31
|
'pkt-icon': PktIcon;
|
|
@@ -8,6 +33,13 @@ declare global {
|
|
|
8
33
|
}
|
|
9
34
|
|
|
10
35
|
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'pkt-listbox': PktListbox;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
11
43
|
declare global {
|
|
12
44
|
interface Window {
|
|
13
45
|
pktTz: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.32.0",
|
|
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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@oslokommune/punkt-assets": "^12.30.1",
|
|
33
|
-
"@oslokommune/punkt-css": "^12.
|
|
33
|
+
"@oslokommune/punkt-css": "^12.32.0",
|
|
34
34
|
"sass": "^1.78.0",
|
|
35
35
|
"typescript": "^5.6.2",
|
|
36
36
|
"vite": "^5.4.4",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
58
58
|
},
|
|
59
59
|
"license": "MIT",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "8d17b2b21d83b498b237d837747e753c64570285"
|
|
61
61
|
}
|