@oslokommune/punkt-elements 12.34.2 → 12.34.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/accordion.d.ts +0 -46
- package/dist/{accordionitem-Cg-LZy7n.js → accordionitem-Db-3WiJS.js} +3 -3
- package/dist/{accordionitem-DDnUkCJP.cjs → accordionitem-cvsySqgK.cjs} +1 -1
- package/dist/{alert-BOvwM-m4.js → alert-B5lVS6Qs.js} +5 -5
- package/dist/{alert-B3HuK30R.cjs → alert-DWIElKEZ.cjs} +1 -1
- package/dist/alert.d.ts +0 -46
- package/dist/{backlink-1p-ADrG8.cjs → backlink-HHM21crL.cjs} +1 -1
- package/dist/{backlink-fjBQGFYt.js → backlink-hvyJmwrO.js} +2 -2
- package/dist/backlink.d.ts +0 -46
- package/dist/{button-Cl6psvlo.js → button-B6uRE7uT.js} +2 -2
- package/dist/{button-5tOMyPEx.cjs → button-BNdVIhUp.cjs} +1 -1
- package/dist/button.d.ts +0 -46
- package/dist/{calendar-Bi49Yxom.js → calendar-mTDcujoj.js} +4 -4
- package/dist/{calendar-BU7DqDLG.cjs → calendar-oX4HJomV.cjs} +1 -1
- package/dist/calendar.d.ts +0 -46
- package/dist/{card-Dphjc_iO.js → card-B5zTEmH1.js} +6 -6
- package/dist/{card-a_Cs18EQ.cjs → card-BDcr3PII.cjs} +1 -1
- package/dist/card.d.ts +0 -46
- package/dist/{checkbox-bsBqWqcn.cjs → checkbox-CqatE-eX.cjs} +1 -1
- package/dist/{checkbox-nAnAn0E5.js → checkbox-CyYfA2fu.js} +4 -4
- package/dist/checkbox.d.ts +0 -46
- package/dist/{class-map-BjTUtIEl.cjs → class-map-DCyaICmy.cjs} +1 -1
- package/dist/{class-map-D4QK1bDP.js → class-map-KyMqi0fa.js} +1 -1
- package/dist/{combobox-CKmkM6tY.js → combobox-CELUAZxF.js} +129 -125
- package/dist/combobox-D9NKnao2.cjs +115 -0
- package/dist/combobox.d.ts +0 -46
- package/dist/{datepicker-DarYkBIy.js → datepicker-B6qk_tTl.js} +11 -11
- package/dist/{datepicker-DW6AdQ9X.cjs → datepicker-CskZMUib.cjs} +1 -1
- package/dist/datepicker.d.ts +0 -46
- package/dist/{directive-helpers-CVAnO9Xf.js → directive-helpers-8uS_Izwn.js} +1 -1
- package/dist/{directive-helpers-CQimZ5PA.cjs → directive-helpers-CG7Oxal3.cjs} +1 -1
- package/dist/element-BSypUpzA.cjs +238 -0
- package/dist/{element-J964Wi0N.js → element-DjjF_tEh.js} +6679 -6673
- package/dist/{helptext-qBgH0lvl.js → helptext-BLHAJ1aC.js} +5 -5
- package/dist/{helptext-OW48aGy8.cjs → helptext-CCnYxYA9.cjs} +1 -1
- package/dist/helptext.d.ts +0 -46
- package/dist/{icon-kSv2VoAB.js → icon-Beoxup8E.js} +1 -1
- package/dist/{icon-Cc4gVHxd.cjs → icon-BnKGwYjj.cjs} +1 -1
- package/dist/icon.d.ts +0 -46
- package/dist/{if-defined-DEXc_i_J.js → if-defined-BErSJCeJ.js} +1 -1
- package/dist/{if-defined-ZR_9IQ1L.cjs → if-defined-a3sotaUr.cjs} +1 -1
- package/dist/index.d.ts +0 -46
- package/dist/{input-element-BoUU9kvo.js → input-element-Bic-t96S.js} +2 -2
- package/dist/{input-element-BYE0qiMh.cjs → input-element-C9ma8cdz.cjs} +1 -1
- package/dist/{input-wrapper-CZI_ibQL.js → input-wrapper-CeeNYbDA.js} +6 -6
- package/dist/{input-wrapper-DmVnotQ2.cjs → input-wrapper-Cn929YTV.cjs} +1 -1
- package/dist/input-wrapper.d.ts +0 -46
- package/dist/{link-D1Nr-VBI.js → link-BYI8VNGd.js} +4 -4
- package/dist/{link-3uccc2MM.cjs → link-CnibgS3c.cjs} +1 -1
- package/dist/link.d.ts +0 -46
- package/dist/{linkcard-CTNdTxvV.js → linkcard--zuuAt_v.js} +3 -3
- package/dist/{linkcard-P1I3dzQb.cjs → linkcard-DPGX1kb1.cjs} +1 -1
- package/dist/linkcard.d.ts +0 -46
- package/dist/{listbox-B4tiuVzB.js → listbox-C1oYnM-t.js} +5 -5
- package/dist/{listbox-BQu6MjAp.cjs → listbox-DqpGh7eq.cjs} +1 -1
- package/dist/listbox.d.ts +0 -46
- package/dist/{loader-CM7wLajY.cjs → loader-BN4q8pSl.cjs} +1 -1
- package/dist/{loader-C0zNKIJ0.js → loader-DgIiyYBl.js} +5 -5
- package/dist/loader.d.ts +0 -46
- package/dist/{messagebox-CD8fS0Ym.cjs → messagebox-BWJr42m9.cjs} +1 -1
- package/dist/{messagebox-DyLx08sr.js → messagebox-cme5VbUM.js} +5 -5
- package/dist/messagebox.d.ts +0 -46
- package/dist/{modal-Dnv6Y4Nv.js → modal-B-varrJT.js} +5 -5
- package/dist/{modal-DOCsiHGv.cjs → modal-cPcTJriW.cjs} +1 -1
- package/dist/modal.d.ts +0 -46
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- 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 -1
- package/dist/pkt-combobox.js +1 -1
- 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 +1 -1
- package/dist/pkt-index.js +27 -27
- 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 -1
- package/dist/pkt-listbox.js +1 -1
- 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-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-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-D3sqQ5g1.js → progressbar-BKt_aj7f.js} +5 -5
- package/dist/{progressbar-BmI-K95y.cjs → progressbar-DiRfScnB.cjs} +1 -1
- package/dist/progressbar.d.ts +0 -46
- package/dist/{radiobutton-CJYNTtFF.cjs → radiobutton-CIW0FvT8.cjs} +1 -1
- package/dist/{radiobutton-Bat-fmTh.js → radiobutton-DtHuz7qn.js} +5 -5
- package/dist/radiobutton.d.ts +0 -46
- package/dist/{ref-BbKbXwub.cjs → ref-BvbyvXRH.cjs} +2 -2
- package/dist/{ref-3rhflVgg.js → ref-iIffqQAI.js} +10 -10
- package/dist/{repeat-DK_E7chz.cjs → repeat-BnuruAat.cjs} +1 -1
- package/dist/{repeat-CTBD0h6a.js → repeat-D4kMediE.js} +2 -2
- package/dist/{select-Swc0c6lZ.cjs → select-BJziJVde.cjs} +1 -1
- package/dist/{select-CVWm9dL1.js → select-DbRLz-7l.js} +6 -6
- package/dist/select.d.ts +0 -46
- package/dist/{state-y7tCw3bg.cjs → state-B5KCNjEd.cjs} +1 -1
- package/dist/{state-fdb9lRrL.js → state-BtbpSrdV.js} +1 -1
- package/dist/{tag-Dizhf3tl.js → tag-CGnj4c1Z.js} +6 -6
- package/dist/{tag-Dg2-c_OZ.cjs → tag-CgkUxA5D.cjs} +1 -1
- package/dist/tag.d.ts +0 -46
- package/dist/{textarea-DkQfMu1d.js → textarea-CiA4IzMs.js} +9 -9
- package/dist/{textarea-go_AyeP-.cjs → textarea-qX4Inr1X.cjs} +1 -1
- package/dist/textarea.d.ts +0 -46
- package/dist/{textinput-FvLq5W70.cjs → textinput-BlsgLNwW.cjs} +1 -1
- package/dist/{textinput-CyJB8IDv.js → textinput-CrxjZNEq.js} +8 -8
- package/dist/textinput.d.ts +0 -46
- package/package.json +5 -5
- package/src/components/combobox/combobox.ts +17 -3
- package/dist/combobox-DqHwVglB.cjs +0 -115
- package/dist/element-BYpg5e6C.cjs +0 -238
package/dist/progressbar.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-BSypUpzA.cjs"),a=require("./state-B5KCNjEd.cjs"),p=require("./input-element-C9ma8cdz.cjs"),d=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var k=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?r(e,c):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(h=(s?l(e,c,h):l(h))||h);return s&&h&&k(e,c,h),h};exports.PktRadioButton=class extends p.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,c,s){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,c,s)}updated(e){e.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(e.get("checked")===""||e.get("checked")==="true"||e.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(e)}render(){const e=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return t.x`
|
|
2
2
|
<div class="pkt-input-check">
|
|
3
3
|
<div class=${e}>
|
|
4
4
|
<input
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as n, x as r, n as s, a as o } from "./element-
|
|
2
|
-
import { r as k } from "./state-
|
|
3
|
-
import { P as f } from "./input-element-
|
|
4
|
-
import { e as _, n as b } from "./ref-
|
|
5
|
-
import { e as a } from "./class-map-
|
|
1
|
+
import { E as n, x as r, n as s, a as o } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { r as k } from "./state-BtbpSrdV.js";
|
|
3
|
+
import { P as f } from "./input-element-Bic-t96S.js";
|
|
4
|
+
import { e as _, n as b } from "./ref-iIffqQAI.js";
|
|
5
|
+
import { e as a } from "./class-map-KyMqi0fa.js";
|
|
6
6
|
var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (e, t, l, p) => {
|
|
7
7
|
for (var h = p > 1 ? void 0 : p ? v(t, l) : t, u = e.length - 1, d; u >= 0; u--)
|
|
8
8
|
(d = e[u]) && (h = (p ? d(t, l, h) : d(h)) || h);
|
package/dist/radiobutton.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const d=require("./element-
|
|
1
|
+
"use strict";const d=require("./element-BSypUpzA.cjs"),a=require("./directive-helpers-CG7Oxal3.cjs"),l=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2020 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const v=()=>new
|
|
9
|
+
*/const v=()=>new G;class G{}const r=new WeakMap,p=l.e(class extends A{render(t){return d.E}update(t,[e]){var i;const s=e!==this.G;return s&&this.G!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),d.E}rt(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let s=r.get(e);s===void 0&&(s=new WeakMap,r.set(e,s)),s.get(this.G)!==void 0&&this.G.call(this.ht,void 0),s.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e;return typeof this.G=="function"?(t=r.get(this.ht??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.e=v;exports.n=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as l } from "./element-
|
|
2
|
-
import { f as $ } from "./directive-helpers-
|
|
1
|
+
import { E as l } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { f as $ } from "./directive-helpers-8uS_Izwn.js";
|
|
3
3
|
import { i as f, t as a, e as _ } from "./directive-oAbCiebi.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
@@ -66,8 +66,8 @@ class p extends f {
|
|
|
66
66
|
* Copyright 2020 Google LLC
|
|
67
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
68
|
*/
|
|
69
|
-
const N = () => new
|
|
70
|
-
class
|
|
69
|
+
const N = () => new G();
|
|
70
|
+
class G {
|
|
71
71
|
}
|
|
72
72
|
const c = /* @__PURE__ */ new WeakMap(), M = _(class extends p {
|
|
73
73
|
render(t) {
|
|
@@ -75,19 +75,19 @@ const c = /* @__PURE__ */ new WeakMap(), M = _(class extends p {
|
|
|
75
75
|
}
|
|
76
76
|
update(t, [s]) {
|
|
77
77
|
var i;
|
|
78
|
-
const e = s !== this.
|
|
79
|
-
return e && this.
|
|
78
|
+
const e = s !== this.G;
|
|
79
|
+
return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = s, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), l;
|
|
80
80
|
}
|
|
81
81
|
rt(t) {
|
|
82
|
-
if (this.isConnected || (t = void 0), typeof this.
|
|
82
|
+
if (this.isConnected || (t = void 0), typeof this.G == "function") {
|
|
83
83
|
const s = this.ht ?? globalThis;
|
|
84
84
|
let e = c.get(s);
|
|
85
|
-
e === void 0 && (e = /* @__PURE__ */ new WeakMap(), c.set(s, e)), e.get(this.
|
|
86
|
-
} else this.
|
|
85
|
+
e === void 0 && (e = /* @__PURE__ */ new WeakMap(), c.set(s, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, t), t !== void 0 && this.G.call(this.ht, t);
|
|
86
|
+
} else this.G.value = t;
|
|
87
87
|
}
|
|
88
88
|
get lt() {
|
|
89
89
|
var t, s;
|
|
90
|
-
return typeof this.
|
|
90
|
+
return typeof this.G == "function" ? (t = c.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.G) : (s = this.G) == null ? void 0 : s.value;
|
|
91
91
|
}
|
|
92
92
|
disconnected() {
|
|
93
93
|
this.lt === this.ct && this.rt(void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const m=require("./element-
|
|
1
|
+
"use strict";const m=require("./element-BSypUpzA.cjs"),x=require("./directive-C7oCP5Bh.cjs"),s=require("./directive-helpers-CG7Oxal3.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as $ } from "./element-
|
|
1
|
+
import { T as $ } from "./element-DjjF_tEh.js";
|
|
2
2
|
import { e as A, i as M, t as b } from "./directive-oAbCiebi.js";
|
|
3
|
-
import { p as j, v as h, r as v, M as x, m as C } from "./directive-helpers-
|
|
3
|
+
import { p as j, v as h, r as v, M as x, m as C } from "./directive-helpers-8uS_Izwn.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2017 Google LLC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./element-
|
|
1
|
+
"use strict";const r=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),o=require("./if-defined-a3sotaUr.cjs"),d=require("./input-element-C9ma8cdz.cjs"),c=require("./pkt-options-controller-TJ1apYGF.cjs"),$=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.cjs");var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(a,e,t,i)=>{for(var s=i>1?void 0:i?v(e,t):e,p=a.length-1,h;p>=0;p--)(h=a[p])&&(s=(i?h(e,t,s):h(s))||s);return i&&s&&b(e,t,s),s};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.options=[],this.value="",this._options=[],this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new $.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback();const e=this.options.length>0,t=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!e&&t?this.optionsController.nodes.forEach(i=>{const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||"",disabled:!!i.getAttribute("disabled")};i.getAttribute("selected")&&!this.value&&(this.value=s.value),this._options.push(s)}):this._options=this.options}attributeChangedCallback(e,t,i){e==="options"&&(this._options=i?JSON.parse(i):[]),e==="value"&&this.value!==t&&this.valueChanged(i,t),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.options.length&&(this._options=this.options)}render(){const e=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return r.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
?counter=${this.counter}
|
|
4
4
|
?disabled=${this.disabled}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { x as h, n as c, a as $ } from "./element-
|
|
2
|
-
import { r as b } from "./state-
|
|
3
|
-
import { e as u, n as d } from "./ref-
|
|
4
|
-
import { o as s } from "./if-defined-
|
|
5
|
-
import { P as v } from "./input-element-
|
|
1
|
+
import { x as h, n as c, a as $ } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { r as b } from "./state-BtbpSrdV.js";
|
|
3
|
+
import { e as u, n as d } from "./ref-iIffqQAI.js";
|
|
4
|
+
import { o as s } from "./if-defined-BErSJCeJ.js";
|
|
5
|
+
import { P as v } from "./input-element-Bic-t96S.js";
|
|
6
6
|
import { P as f } from "./pkt-options-controller-CFmzX4xL.js";
|
|
7
7
|
import { P as m } from "./pkt-slot-controller-DFrc5O93.js";
|
|
8
|
-
import "./input-wrapper-
|
|
8
|
+
import "./input-wrapper-CeeNYbDA.js";
|
|
9
9
|
var g = Object.defineProperty, C = Object.getOwnPropertyDescriptor, a = (e, t, i, o) => {
|
|
10
10
|
for (var r = o > 1 ? void 0 : o ? C(t, i) : t, n = e.length - 1, p; n >= 0; n--)
|
|
11
11
|
(p = e[n]) && (r = (o ? p(t, i, r) : p(r)) || r);
|
package/dist/select.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { e as u } from "./class-map-
|
|
2
|
-
import { P as m, x as l, n as r, a as g } from "./element-
|
|
3
|
-
import { r as k } from "./state-
|
|
1
|
+
import { e as u } from "./class-map-KyMqi0fa.js";
|
|
2
|
+
import { P as m, x as l, n as r, a as g } from "./element-DjjF_tEh.js";
|
|
3
|
+
import { r as k } from "./state-BtbpSrdV.js";
|
|
4
4
|
import { P as y } from "./pkt-slot-controller-DFrc5O93.js";
|
|
5
|
-
import { e as b, n as f } from "./ref-
|
|
6
|
-
import "./icon-
|
|
7
|
-
import { o as d } from "./if-defined-
|
|
5
|
+
import { e as b, n as f } from "./ref-iIffqQAI.js";
|
|
6
|
+
import "./icon-Beoxup8E.js";
|
|
7
|
+
import { o as d } from "./if-defined-BErSJCeJ.js";
|
|
8
8
|
const _ = {
|
|
9
9
|
closeTag: {
|
|
10
10
|
default: !1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const u=require("./class-map-
|
|
1
|
+
"use strict";const u=require("./class-map-DCyaICmy.cjs"),t=require("./element-BSypUpzA.cjs"),k=require("./state-B5KCNjEd.cjs"),g=require("./pkt-slot-controller-plQxXRvV.cjs"),c=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");const h=require("./if-defined-a3sotaUr.cjs"),f={closeTag:{default:!1},size:{default:"medium"},skin:{default:"blue"},type:{default:"button"}},r={props:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(n,e,o,a)=>{for(var s=a>1?void 0:a?y(e,o):e,l=n.length-1,p;l>=0;l--)(p=n[l])&&(s=(a?p(e,o,s):p(s))||s);return a&&s&&d(e,o,s),s};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=r.props.closeTag.default,this.size=r.props.size.default,this.skin=r.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=r.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,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 g.PktSlotController(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var o,a;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const s=(a=(o=this.defaultSlot.value)==null?void 0:o.textContent)==null?void 0:a.trim();s&&(this._ariaDescription=`Klikk for å fjerne ${s}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},o={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"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(o)}
|
|
4
4
|
type=${this.type}
|
package/dist/tag.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { T as l, E as $, x as f, n as d, a as g } from "./element-
|
|
2
|
-
import { o as u } from "./if-defined-
|
|
3
|
-
import { r as x } from "./state-
|
|
4
|
-
import { e as m, n as c } from "./ref-
|
|
5
|
-
import { e as v } from "./class-map-
|
|
1
|
+
import { T as l, E as $, x as f, n as d, a as g } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { o as u } from "./if-defined-BErSJCeJ.js";
|
|
3
|
+
import { r as x } from "./state-BtbpSrdV.js";
|
|
4
|
+
import { e as m, n as c } from "./ref-iIffqQAI.js";
|
|
5
|
+
import { e as v } from "./class-map-KyMqi0fa.js";
|
|
6
6
|
import { e as b, i as T, t as a } from "./directive-oAbCiebi.js";
|
|
7
|
-
import { f as y, m as w } from "./directive-helpers-
|
|
8
|
-
import { P as C } from "./input-element-
|
|
7
|
+
import { f as y, m as w } from "./directive-helpers-8uS_Izwn.js";
|
|
8
|
+
import { P as C } from "./input-element-Bic-t96S.js";
|
|
9
9
|
import { P as E } from "./pkt-slot-controller-DFrc5O93.js";
|
|
10
|
-
import "./input-wrapper-
|
|
11
|
-
import "./icon-
|
|
10
|
+
import "./input-wrapper-CeeNYbDA.js";
|
|
11
|
+
import "./icon-Beoxup8E.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2020 Google LLC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./element-
|
|
1
|
+
"use strict";const s=require("./element-BSypUpzA.cjs"),p=require("./if-defined-a3sotaUr.cjs"),c=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-CG7Oxal3.cjs"),x=require("./input-element-C9ma8cdz.cjs"),T=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.cjs");require("./icon-BnKGwYjj.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/dist/textarea.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-BSypUpzA.cjs"),u=require("./if-defined-a3sotaUr.cjs"),l=require("./state-B5KCNjEd.cjs"),p=require("./ref-BvbyvXRH.cjs"),c=require("./class-map-DCyaICmy.cjs"),d=require("./input-element-C9ma8cdz.cjs"),x=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.cjs");require("./icon-BnKGwYjj.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}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { E as p, x 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-
|
|
1
|
+
import { E as p, x as h, n as o, a as $ } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { o as c } from "./if-defined-BErSJCeJ.js";
|
|
3
|
+
import { r as f } from "./state-BtbpSrdV.js";
|
|
4
|
+
import { e as d, n as m } from "./ref-iIffqQAI.js";
|
|
5
|
+
import { e as g } from "./class-map-KyMqi0fa.js";
|
|
6
|
+
import { P as x } from "./input-element-Bic-t96S.js";
|
|
7
7
|
import { P as y } from "./pkt-slot-controller-DFrc5O93.js";
|
|
8
|
-
import "./input-wrapper-
|
|
9
|
-
import "./icon-
|
|
8
|
+
import "./input-wrapper-CeeNYbDA.js";
|
|
9
|
+
import "./icon-Beoxup8E.js";
|
|
10
10
|
var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (e, i, r, t) => {
|
|
11
11
|
for (var a = t > 1 ? void 0 : t ? b(i, r) : i, l = e.length - 1, u; l >= 0; l--)
|
|
12
12
|
(u = e[l]) && (a = (t ? u(i, r, a) : u(a)) || a);
|
package/dist/textinput.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.34.
|
|
3
|
+
"version": "12.34.4",
|
|
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",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"@date-fns/tz": "^1.2.0",
|
|
25
25
|
"@lit-labs/router": "^0.1.3",
|
|
26
26
|
"date-fns": "^4.1.0",
|
|
27
|
-
"lit": "^3.
|
|
27
|
+
"lit": "^3.3.0",
|
|
28
28
|
"react-dom": ">=18.2.22",
|
|
29
29
|
"urlpattern-polyfill": "^10.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@oslokommune/punkt-assets": "^12.
|
|
33
|
-
"@oslokommune/punkt-css": "^12.34.
|
|
32
|
+
"@oslokommune/punkt-assets": "^12.34.4",
|
|
33
|
+
"@oslokommune/punkt-css": "^12.34.4",
|
|
34
34
|
"sass": "^1.78.0",
|
|
35
35
|
"typescript": "^5.6.2",
|
|
36
36
|
"vite": "^5.4.18",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
58
58
|
},
|
|
59
59
|
"license": "MIT",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "437c77a182d85a710e0d5adbf492ea7585a0d472"
|
|
61
61
|
}
|
|
@@ -159,8 +159,16 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
|
|
|
159
159
|
if (changedProperties.has('options') && this.options.length) {
|
|
160
160
|
this._options = this.options
|
|
161
161
|
this._options.forEach((option) => {
|
|
162
|
+
if (option.value && !option.label) {
|
|
163
|
+
option.label = option.value
|
|
164
|
+
}
|
|
165
|
+
if (option.selected && !this._value.includes(option.value)) {
|
|
166
|
+
const oldValue = [...this._value]
|
|
167
|
+
this._value = [...this._value, option.value]
|
|
168
|
+
this.valueChanged(this._value, oldValue)
|
|
169
|
+
}
|
|
162
170
|
option.fulltext = option.value + option.label + (option.prefix || '')
|
|
163
|
-
option.selected = this._value.includes(option.value)
|
|
171
|
+
option.selected = option.selected || this._value.includes(option.value)
|
|
164
172
|
})
|
|
165
173
|
}
|
|
166
174
|
if (changedProperties.has('_search')) {
|
|
@@ -184,6 +192,12 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
|
|
|
184
192
|
if (name === 'options') {
|
|
185
193
|
this._options = this.options
|
|
186
194
|
this._options.forEach((option) => {
|
|
195
|
+
if (option.value && !option.label) {
|
|
196
|
+
option.label = option.value
|
|
197
|
+
}
|
|
198
|
+
if (option.selected && !this._value.includes(option.value)) {
|
|
199
|
+
this._value = [...this._value, option.value]
|
|
200
|
+
}
|
|
187
201
|
option.fulltext = option.value + option.label + (option.prefix || '')
|
|
188
202
|
})
|
|
189
203
|
this._search = ''
|
|
@@ -340,8 +354,8 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
|
|
|
340
354
|
// Multiple vises som tags
|
|
341
355
|
const multipleValuesContent = repeat(
|
|
342
356
|
this._value,
|
|
343
|
-
(value) => value,
|
|
344
|
-
(value) => {
|
|
357
|
+
(value: string) => value,
|
|
358
|
+
(value: string) => {
|
|
345
359
|
const option = this.findValueInOptions(value)
|
|
346
360
|
const tagSkinColor = this.options.find((o) => o.value === value)?.tagSkinColor
|
|
347
361
|
return html`
|