@oslokommune/punkt-elements 12.32.0 → 12.32.7
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-C2WKLFow.cjs +27 -0
- package/dist/alert-XGjypFHe.js +115 -0
- package/dist/alert.d.ts +15 -15
- package/dist/{backlink-DdNgqA56.js → backlink-BX8HBhw5.js} +2 -2
- package/dist/{backlink-Q2HTG9jm.cjs → backlink-NJdC0FAO.cjs} +1 -1
- package/dist/backlink.d.ts +15 -15
- package/dist/{button-rArIL0-j.js → button-Bn8jVB0f.js} +33 -33
- package/dist/{button-BPyZeW73.cjs → button-Bpbh8A_a.cjs} +2 -2
- package/dist/button.d.ts +15 -15
- package/dist/{calendar-1ryAEdX3.js → calendar-BNHDEEwT.js} +20 -84
- package/dist/{calendar-2DqPLXdD.cjs → calendar-Ds13AKr5.cjs} +4 -4
- package/dist/calendar.d.ts +15 -15
- package/dist/card-CEv3DL-o.js +94 -0
- package/dist/card-c5EEPaNh.cjs +28 -0
- package/dist/card.d.ts +15 -15
- package/dist/{checkbox-BnDG6wIO.cjs → checkbox-DDBBDM85.cjs} +1 -1
- package/dist/{checkbox-Ceui2TLp.js → checkbox-DoMYxp83.js} +9 -9
- package/dist/checkbox.d.ts +15 -15
- package/dist/{class-map-ChuDQU5C.js → class-map-D4tSZX70.js} +2 -2
- package/dist/{class-map-D4rXyUxT.cjs → class-map-DvBKxTiW.cjs} +1 -1
- package/dist/combobox-BflWORVa.cjs +115 -0
- package/dist/combobox-l7LmWQYu.js +491 -0
- package/dist/combobox.d.ts +15 -15
- package/dist/datepicker-Bkiyh5P5.cjs +153 -0
- package/dist/datepicker-nWd89NwP.js +449 -0
- package/dist/datepicker.d.ts +15 -15
- package/dist/directive-C7oCP5Bh.cjs +5 -0
- package/dist/directive-helpers-BmXIK-1b.js +45 -0
- package/dist/directive-helpers-donnvcEO.cjs +5 -0
- package/dist/{directive-B76A7YXI.js → directive-oAbCiebi.js} +4 -4
- package/dist/element-DJpGVXjq.cjs +238 -0
- package/dist/{element-G8JoS0Lj.js → element-DiqKrDty.js} +8845 -8847
- package/dist/{helptext-Y4cSgTkd.js → helptext-DfRusn5R.js} +9 -9
- package/dist/{helptext-B4Uc-d56.cjs → helptext-aHD9icur.cjs} +1 -1
- package/dist/helptext.d.ts +15 -15
- package/dist/{icon-BJnwW0eh.js → icon-BdY52BIt.js} +2 -2
- package/dist/{icon-BTUCDPN5.cjs → icon-UtDKPH3R.cjs} +1 -1
- package/dist/icon.d.ts +15 -15
- package/dist/{if-defined-C1ZDVzYn.cjs → if-defined-CoBDkDGb.cjs} +1 -1
- package/dist/{if-defined-rCqT8Od1.js → if-defined-DeANa4n5.js} +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/{input-element-DM2uSYaW.js → input-element-C4mmTk6h.js} +3 -3
- package/dist/{input-element-AhnBdCb8.cjs → input-element-VNai8bsq.cjs} +1 -1
- package/dist/input-wrapper-8iKEzDRZ.js +40 -0
- package/dist/{input-wrapper-BdZxmQyO.cjs → input-wrapper-DWOw7Yn-.cjs} +1 -1
- package/dist/input-wrapper-EoSAbU-U.cjs +1 -0
- package/dist/{input-wrapper-DQmYzhcy.js → input-wrapper-P_oEi6dk.js} +8 -8
- package/dist/input-wrapper.d.ts +15 -15
- package/dist/link-D9dJ6F-R.js +73 -0
- package/dist/link-DBxXqsnP.cjs +8 -0
- package/dist/link.d.ts +15 -15
- package/dist/{linkcard-DDD92XfD.cjs → linkcard-D5O1hR7N.cjs} +1 -1
- package/dist/{linkcard-CvqqyHVW.js → linkcard-DcEE9IVw.js} +4 -4
- package/dist/linkcard.d.ts +15 -15
- package/dist/{listbox-BTVnrHWv.cjs → listbox-CK1GmwCE.cjs} +1 -1
- package/dist/{listbox-DX-Euxdm.js → listbox-CfJWJDrc.js} +5 -5
- package/dist/listbox.d.ts +15 -15
- package/dist/{loader-BudoV0yd.js → loader-DZvOlXzI.js} +6 -6
- package/dist/{loader-Csq0Yd1k.cjs → loader-SDXJp58K.cjs} +1 -1
- package/dist/loader.d.ts +15 -15
- package/dist/messagebox-Ce5e1gga.js +79 -0
- package/dist/messagebox-D2_-WZQG.cjs +12 -0
- package/dist/messagebox.d.ts +15 -15
- package/dist/modal-CCtUsYKk.cjs +33 -0
- package/dist/{modal-DnYn2Rlg.js → modal-CdgIOp8Q.js} +51 -94
- package/dist/modal.d.ts +15 -15
- 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-options-controller-CZplGTgu.js → pkt-options-controller-BkWE4pZe.js} +1 -1
- package/dist/{pkt-options-controller-BtU1zEtG.cjs → pkt-options-controller-TJ1apYGF.cjs} +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-slot-controller-BtVLTZb7.js +79 -0
- package/dist/pkt-slot-controller-plQxXRvV.cjs +1 -0
- 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-czvExwTL.js → progressbar-DvFz9KBo.js} +6 -6
- package/dist/{progressbar-BW_icNId.cjs → progressbar-jASTnhti.cjs} +1 -1
- package/dist/progressbar.d.ts +15 -15
- package/dist/{radiobutton-BeSuCrbp.cjs → radiobutton-C-Xd5sSq.cjs} +1 -1
- package/dist/{radiobutton-DKo27Stm.js → radiobutton-D03aN4yn.js} +5 -5
- package/dist/radiobutton.d.ts +15 -15
- package/dist/{ref-cRTOoM4R.js → ref-B70YZNXm.js} +11 -11
- package/dist/{ref-DsoUUoPU.cjs → ref-CLqTsViF.cjs} +3 -3
- package/dist/{repeat-CArTw6-s.js → repeat-CNLpCTun.js} +3 -3
- package/dist/{repeat-kruY8poV.cjs → repeat-t2oms1o6.cjs} +1 -1
- package/dist/{select-DxHhPEgD.js → select-BLDaK5Rd.js} +8 -8
- package/dist/{select-lvFnhEVg.cjs → select-Dvds7MzS.cjs} +1 -1
- package/dist/select.d.ts +15 -15
- package/dist/{state-BILlRnrD.cjs → state-C4LdlTYO.cjs} +1 -1
- package/dist/{state-gfUuUqVg.js → state-CDwPbiQj.js} +1 -1
- package/dist/tag-C52KeBmR.cjs +18 -0
- package/dist/{tag-CWx1XsGR.js → tag-DoS5S2Bq.js} +28 -77
- package/dist/tag.d.ts +15 -15
- package/dist/{textarea-BNNDbxxO.js → textarea-C9EvdPGi.js} +11 -11
- package/dist/{textarea-CDsLbogK.cjs → textarea-DJvNBmEL.cjs} +1 -1
- package/dist/textarea.d.ts +15 -15
- package/dist/{textinput-C3C088Ki.cjs → textinput-Cg3ObBuw.cjs} +1 -1
- package/dist/{textinput-M8I4dfoP.js → textinput-CxRSSYaN.js} +20 -20
- package/dist/textinput.d.ts +15 -15
- package/package.json +4 -4
- package/src/components/button/button.ts +3 -2
- package/src/components/datepicker/datepicker.ts +4 -4
- package/src/components/tag/tag.ts +1 -1
- package/dist/alert-D5G5UJuo.cjs +0 -27
- package/dist/alert-gERpVuB7.js +0 -163
- package/dist/card-BbMBpvJt.js +0 -176
- package/dist/card-ZX09f_ka.cjs +0 -28
- package/dist/combobox-DH-YlbNh.cjs +0 -115
- package/dist/combobox-DbO6I0GT.js +0 -694
- package/dist/datepicker-8MOgQsyL.js +0 -611
- package/dist/datepicker-BRH-59Q9.cjs +0 -153
- package/dist/directive-C_VV3qwo.cjs +0 -5
- package/dist/directive-helpers-D7XIyCQ_.js +0 -45
- package/dist/directive-helpers-mGjAtADc.cjs +0 -5
- package/dist/element-BBo3JZk5.cjs +0 -238
- package/dist/input-wrapper-Bw9tARAD.js +0 -125
- package/dist/input-wrapper-jPnKsfEC.cjs +0 -1
- package/dist/link-C3lW3z8X.js +0 -109
- package/dist/link-DOVlsg2S.cjs +0 -8
- package/dist/messagebox-8GwnNqb0.cjs +0 -12
- package/dist/messagebox-D6uexEhg.js +0 -114
- package/dist/modal-CLixB4Dz.cjs +0 -33
- package/dist/pkt-slot-controller-CqNvEpFd.cjs +0 -1
- package/dist/pkt-slot-controller-D1DakVrU.js +0 -95
- package/dist/tag-DThwKsrg.cjs +0 -18
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { P as d, x as a,
|
|
2
|
-
import { e as f, n as m } from "./ref-
|
|
3
|
-
import { o as x } from "./icon-
|
|
4
|
-
import { e as _ } from "./class-map-
|
|
5
|
-
import { r as w } from "./state-
|
|
1
|
+
import { P as d, x as a, E as u, n as i, a as c } from "./element-DiqKrDty.js";
|
|
2
|
+
import { e as f, n as m } from "./ref-B70YZNXm.js";
|
|
3
|
+
import { o as x } from "./icon-BdY52BIt.js";
|
|
4
|
+
import { e as _ } from "./class-map-D4tSZX70.js";
|
|
5
|
+
import { r as w } from "./state-CDwPbiQj.js";
|
|
6
6
|
import { u as v } from "./stringutils-DJjRa8dG.js";
|
|
7
|
-
import { s as k } from "./input-wrapper-
|
|
8
|
-
import { P as b } from "./pkt-slot-controller-
|
|
7
|
+
import { s as k } from "./input-wrapper-8iKEzDRZ.js";
|
|
8
|
+
import { P as b } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
9
9
|
var D = Object.defineProperty, O = Object.getOwnPropertyDescriptor, n = (r, o, s, t) => {
|
|
10
10
|
for (var e = t > 1 ? void 0 : t ? O(o, s) : o, l = r.length - 1, h; l >= 0; l--)
|
|
11
11
|
(h = r[l]) && (e = (t ? h(o, s, e) : h(e)) || e);
|
|
@@ -45,7 +45,7 @@ let p = class extends d {
|
|
|
45
45
|
>
|
|
46
46
|
${x(this.helptextDropdown)}
|
|
47
47
|
</div>
|
|
48
|
-
</div>` :
|
|
48
|
+
</div>` : u;
|
|
49
49
|
return a`${a`<div class="pkt-inputwrapper__helptext-container">
|
|
50
50
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
51
51
|
<div class="pkt-contents" ${m(this.defaultSlot)} name="helptext"></div>
|
|
@@ -71,7 +71,7 @@ n([
|
|
|
71
71
|
w()
|
|
72
72
|
], p.prototype, "isHelpTextOpen", 2);
|
|
73
73
|
p = n([
|
|
74
|
-
|
|
74
|
+
c("pkt-helptext")
|
|
75
75
|
], p);
|
|
76
76
|
export {
|
|
77
77
|
p as P
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-DJpGVXjq.cjs"),x=require("./ref-CLqTsViF.cjs"),h=require("./icon-UtDKPH3R.cjs"),u=require("./class-map-DvBKxTiW.cjs"),c=require("./state-C4LdlTYO.cjs"),a=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-plQxXRvV.cjs");var _=Object.defineProperty,w=Object.getOwnPropertyDescriptor,r=(s,p,l,n)=>{for(var t=n>1?void 0:n?w(p,l):p,o=s.length-1,i;o>=0;o--)(i=s[o])&&(t=(n?i(p,l,t):i(t))||t);return n&&t&&_(p,l,t),t};exports.PktHelptext=class extends e.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=a.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const p=()=>{const t=!this.isHelpTextOpen;this.isHelpTextOpen=t,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:t}}))},l=()=>this.helptextDropdown?e.x`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
2
|
<button
|
|
3
3
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
4
|
type="button"
|
package/dist/helptext.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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
4
|
declare global {
|
|
16
5
|
interface HTMLElementTagNameMap {
|
|
17
|
-
'pkt-
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
18
7
|
}
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
|
|
22
11
|
declare global {
|
|
23
12
|
interface HTMLElementTagNameMap {
|
|
24
|
-
'pkt-
|
|
13
|
+
'pkt-icon': PktIcon;
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
|
|
29
18
|
declare global {
|
|
30
19
|
interface HTMLElementTagNameMap {
|
|
31
|
-
'pkt-
|
|
20
|
+
'pkt-listbox': PktListbox;
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
|
|
35
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
36
|
declare global {
|
|
37
37
|
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-
|
|
38
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as f, T as v, P as m, x as y, n as h, a as P } from "./element-
|
|
2
|
-
import {
|
|
1
|
+
import { E as f, T as v, P as m, x as y, n as h, a as P } from "./element-DiqKrDty.js";
|
|
2
|
+
import { e as g, i as k, t as _ } from "./directive-oAbCiebi.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright 2017 Google LLC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-
|
|
1
|
+
"use strict";const o=require("./element-DJpGVXjq.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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
4
|
declare global {
|
|
16
5
|
interface HTMLElementTagNameMap {
|
|
17
|
-
'pkt-
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
18
7
|
}
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
|
|
22
11
|
declare global {
|
|
23
12
|
interface HTMLElementTagNameMap {
|
|
24
|
-
'pkt-
|
|
13
|
+
'pkt-icon': PktIcon;
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
|
|
29
18
|
declare global {
|
|
30
19
|
interface HTMLElementTagNameMap {
|
|
31
|
-
'pkt-
|
|
20
|
+
'pkt-listbox': PktListbox;
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
|
|
35
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
36
|
declare global {
|
|
37
37
|
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-
|
|
38
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
package/dist/index.d.ts
CHANGED
|
@@ -266,6 +266,7 @@ export declare class PktBackLink extends PktElement<IPktBackLink> implements IPk
|
|
|
266
266
|
export declare class PktButton extends PktElement<IPktButton> implements IPktButton {
|
|
267
267
|
static formAssociated: boolean;
|
|
268
268
|
private internals;
|
|
269
|
+
slotController: PktSlotController;
|
|
269
270
|
defaultSlot: Ref<HTMLElement>;
|
|
270
271
|
constructor();
|
|
271
272
|
iconName: string;
|
|
@@ -913,7 +914,7 @@ declare class PktSlotController implements ReactiveController {
|
|
|
913
914
|
private handleSlotMutations;
|
|
914
915
|
}
|
|
915
916
|
|
|
916
|
-
export declare class PktTag extends PktElement implements IPktTag {
|
|
917
|
+
export declare class PktTag extends PktElement<IPktTag> implements IPktTag {
|
|
917
918
|
slotController: PktSlotController;
|
|
918
919
|
defaultSlot: Ref<HTMLElement>;
|
|
919
920
|
constructor();
|
|
@@ -1072,41 +1073,41 @@ export declare type TTagType = 'button' | 'reset' | 'submit';
|
|
|
1072
1073
|
export { }
|
|
1073
1074
|
|
|
1074
1075
|
|
|
1075
|
-
/**
|
|
1076
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
1077
|
-
*
|
|
1078
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
1079
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
1080
|
-
*
|
|
1081
|
-
* @slot (default) - Options to be rendered as children
|
|
1082
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
*/
|
|
1086
1076
|
declare global {
|
|
1087
1077
|
interface HTMLElementTagNameMap {
|
|
1088
|
-
'pkt-
|
|
1078
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
1089
1079
|
}
|
|
1090
1080
|
}
|
|
1091
1081
|
|
|
1092
1082
|
|
|
1093
1083
|
declare global {
|
|
1094
1084
|
interface HTMLElementTagNameMap {
|
|
1095
|
-
'pkt-
|
|
1085
|
+
'pkt-icon': PktIcon;
|
|
1096
1086
|
}
|
|
1097
1087
|
}
|
|
1098
1088
|
|
|
1099
1089
|
|
|
1100
1090
|
declare global {
|
|
1101
1091
|
interface HTMLElementTagNameMap {
|
|
1102
|
-
'pkt-
|
|
1092
|
+
'pkt-listbox': PktListbox;
|
|
1103
1093
|
}
|
|
1104
1094
|
}
|
|
1105
1095
|
|
|
1106
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
1099
|
+
*
|
|
1100
|
+
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
1101
|
+
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
1102
|
+
*
|
|
1103
|
+
* @slot (default) - Options to be rendered as children
|
|
1104
|
+
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
1105
|
+
*
|
|
1106
|
+
*
|
|
1107
|
+
*/
|
|
1107
1108
|
declare global {
|
|
1108
1109
|
interface HTMLElementTagNameMap {
|
|
1109
|
-
'pkt-
|
|
1110
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
1110
1111
|
}
|
|
1111
1112
|
}
|
|
1112
1113
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as c } from "./state-
|
|
1
|
+
import { P as y, t as l, n as s } from "./element-DiqKrDty.js";
|
|
2
|
+
import { r as c } from "./state-CDwPbiQj.js";
|
|
3
3
|
import { u as m } from "./stringutils-DJjRa8dG.js";
|
|
4
|
-
import { s as g } from "./input-wrapper-
|
|
4
|
+
import { s as g } from "./input-wrapper-8iKEzDRZ.js";
|
|
5
5
|
var v = Object.defineProperty, e = (p, t, r, n) => {
|
|
6
6
|
for (var a = void 0, h = p.length - 1, o; h >= 0; h--)
|
|
7
7
|
(o = p[h]) && (a = o(t, r, a) || a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-DJpGVXjq.cjs"),f=require("./state-C4LdlTYO.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),y=require("./input-wrapper-EoSAbU-U.cjs");var m=Object.defineProperty,s=(o,t,r,n)=>{for(var a=void 0,l=o.length-1,h;l>=0;l--)(h=o[l])&&(a=h(t,r,a)||a);return a&&m(t,r,a),a};class i extends e.PktElement{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=c.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!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=y.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.translations.forms.labels.optional,this.requiredText=e.translations.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var r,n,a,l,h,u,p,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.translations.forms.messages.required,t):(r=t.validity)!=null&&r.typeMismatch||(n=t.validity)!=null&&n.badInput?this.internals.setValidity({typeMismatch:!0},e.translations.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.translations.forms.messages.invalidPattern,t):(l=t.validity)!=null&&l.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.translations.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},e.translations.forms.messages.tooLong,t):(u=t.validity)!=null&&u.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.translations.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.translations.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(n=>{r.append(this.name,n)}),this.internals.setFormValue(r)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const r=this.internals.form||this.closest("form");r&&r.querySelectorAll(`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue("",""),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}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=this.multiple||this.range?t:t[0],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){if(super.firstUpdated(t),this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const r=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=r,this.internals.setFormValue(r?this.value||"on":"",r?this.value||"on":"")}else 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()],i.prototype,"defaultValue");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,"hasFieldset");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,reflect:!1})],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,reflect:!1})],i.prototype,"helptextDropdownButton");s([e.n({type:String})],i.prototype,"label");s([e.n({type:String,reflect:!1})],i.prototype,"optionalText");s([e.n({type:String,reflect:!1})],i.prototype,"requiredText");s([e.n({type:String,attribute:"data-testid"})],i.prototype,"dataTestid");s([f.r()],i.prototype,"touched");exports.PktInputElement=i;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
helptextDropdownButton: {
|
|
3
|
+
default: "Les mer <span class='pkt-sr-only'>om feltet</span>"
|
|
4
|
+
},
|
|
5
|
+
counter: {
|
|
6
|
+
default: !1
|
|
7
|
+
},
|
|
8
|
+
optionalTag: {
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
optionalText: {
|
|
12
|
+
default: "Valgfritt"
|
|
13
|
+
},
|
|
14
|
+
requiredTag: {
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
requiredText: {
|
|
18
|
+
default: "Må fylles ut"
|
|
19
|
+
},
|
|
20
|
+
hasError: {
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
inline: {
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
hasFieldset: {
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
useWrapper: {
|
|
33
|
+
default: !0
|
|
34
|
+
}
|
|
35
|
+
}, a = {
|
|
36
|
+
props: e
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
a as s
|
|
40
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-DJpGVXjq.cjs"),b=require("./pkt-slot-controller-plQxXRvV.cjs"),a=require("./ref-CLqTsViF.cjs"),y=require("./icon-UtDKPH3R.cjs"),c=require("./class-map-DvBKxTiW.cjs"),f=require("./state-C4LdlTYO.cjs"),$=require("./stringutils-CkVRq4jP.cjs"),p=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-aHD9icur.cjs");var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,e=(u,r,i,o)=>{for(var s=o>1?void 0:o?P(r,i):r,n=u.length-1,l;n>=0;n--)(l=u[n])&&(s=(o?l(r,i,s):l(s))||s);return o&&s&&I(r,i,s),s};exports.PktInputWrapper=class extends t.PktElement{constructor(){super(),this.defaultSlot=a.e(),this.helptextSlot=a.e(),this.hasHelptextSlot=!0,this.forId=$.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=p.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=p.specs.props.optionalTag.default,this.optionalText=p.specs.props.optionalText.default,this.requiredTag=p.specs.props.requiredTag.default,this.requiredText=p.specs.props.requiredText.default,this.hasError=p.specs.props.hasError.default,this.errorMessage="",this.disabled=p.specs.props.disabled.default,this.inline=p.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=p.specs.props.hasFieldset.default,this.useWrapper=p.specs.props.useWrapper.default,this.role="group",this.slotController=new b.PktSlotController(this,this.defaultSlot,this.helptextSlot)}updateSlots(r){this.hasHelptextSlot=r.has("helptext"),this.requestUpdate()}updated(r){super.updated(r)}render(){const r={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},i={"pkt-tag":!0,"pkt-tag--small":!0,"pkt-tag--thin-text":!0,"pkt-tag--blue-light":this.optionalTag,"pkt-tag--beige":!this.optionalTag&&this.requiredTag},o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.E,s=()=>this.optionalTag||this.requiredTag?t.x`<span class=${c.e(i)}
|
|
2
2
|
>${this.optionalTag?this.optionalText:this.requiredTag?this.requiredText:t.E}</span
|
|
3
3
|
>`:t.E,n=()=>this.useWrapper?this.hasFieldset?t.x`<legend
|
|
4
4
|
class="pkt-inputwrapper__legend"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},t={props:e};exports.specs=t;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as m, E as s, x as p, n as r, a as k } from "./element-
|
|
2
|
-
import { P as v } from "./pkt-slot-controller-
|
|
3
|
-
import { e as f, n as g } from "./ref-
|
|
4
|
-
import { o as w } from "./icon-
|
|
5
|
-
import { e as b } from "./class-map-
|
|
6
|
-
import { r as S } from "./state-
|
|
1
|
+
import { P as m, E as s, x as p, n as r, a as k } from "./element-DiqKrDty.js";
|
|
2
|
+
import { P as v } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
3
|
+
import { e as f, n as g } from "./ref-B70YZNXm.js";
|
|
4
|
+
import { o as w } from "./icon-BdY52BIt.js";
|
|
5
|
+
import { e as b } from "./class-map-D4tSZX70.js";
|
|
6
|
+
import { r as S } from "./state-CDwPbiQj.js";
|
|
7
7
|
import { u as T } from "./stringutils-DJjRa8dG.js";
|
|
8
|
-
import { s as i } from "./input-wrapper-
|
|
9
|
-
import "./helptext-
|
|
8
|
+
import { s as i } from "./input-wrapper-8iKEzDRZ.js";
|
|
9
|
+
import "./helptext-DfRusn5R.js";
|
|
10
10
|
var E = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (o, h, a, n) => {
|
|
11
11
|
for (var l = n > 1 ? void 0 : n ? _(h, a) : h, u = o.length - 1, d; u >= 0; u--)
|
|
12
12
|
(d = o[u]) && (l = (n ? d(h, a, l) : d(l)) || l);
|
package/dist/input-wrapper.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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
4
|
declare global {
|
|
16
5
|
interface HTMLElementTagNameMap {
|
|
17
|
-
'pkt-
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
18
7
|
}
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
|
|
22
11
|
declare global {
|
|
23
12
|
interface HTMLElementTagNameMap {
|
|
24
|
-
'pkt-
|
|
13
|
+
'pkt-icon': PktIcon;
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
|
|
29
18
|
declare global {
|
|
30
19
|
interface HTMLElementTagNameMap {
|
|
31
|
-
'pkt-
|
|
20
|
+
'pkt-listbox': PktListbox;
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
|
|
35
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
36
|
declare global {
|
|
37
37
|
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-
|
|
38
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { P as f, E as u, x as h, n as i, a as k } from "./element-DiqKrDty.js";
|
|
2
|
+
import { P as m } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
3
|
+
import { e as d, n as P } from "./ref-B70YZNXm.js";
|
|
4
|
+
import { e as g } from "./class-map-D4tSZX70.js";
|
|
5
|
+
import "./icon-BdY52BIt.js";
|
|
6
|
+
const v = {
|
|
7
|
+
href: {
|
|
8
|
+
default: "#"
|
|
9
|
+
},
|
|
10
|
+
target: {
|
|
11
|
+
default: "_self"
|
|
12
|
+
},
|
|
13
|
+
external: {
|
|
14
|
+
default: !1
|
|
15
|
+
}
|
|
16
|
+
}, c = {
|
|
17
|
+
props: v
|
|
18
|
+
};
|
|
19
|
+
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (o, n, l, s) => {
|
|
20
|
+
for (var t = s > 1 ? void 0 : s ? y(n, l) : n, a = o.length - 1, p; a >= 0; a--)
|
|
21
|
+
(p = o[a]) && (t = (s ? p(n, l, t) : p(t)) || t);
|
|
22
|
+
return s && t && x(n, l, t), t;
|
|
23
|
+
};
|
|
24
|
+
let e = class extends f {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(), this.defaultSlot = d(), this.href = c.props.href.default, this.iconName = void 0, this.iconPosition = void 0, this.external = c.props.external.default, this.target = c.props.target.default, this.slotController = new m(this, this.defaultSlot);
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const o = {
|
|
30
|
+
"pkt-link": !0,
|
|
31
|
+
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
32
|
+
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
33
|
+
"pkt-link--external": this.external
|
|
34
|
+
};
|
|
35
|
+
return h`<a
|
|
36
|
+
class=${g(o)}
|
|
37
|
+
href=${this.href}
|
|
38
|
+
@click=${this.handleClick}
|
|
39
|
+
.target=${this.target}
|
|
40
|
+
.rel=${this.external ? "noopener noreferrer" : u}
|
|
41
|
+
>${this.iconName ? h`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${P(this.defaultSlot)}>Link</span></a
|
|
42
|
+
>`;
|
|
43
|
+
}
|
|
44
|
+
handleClick() {
|
|
45
|
+
this.dispatchEvent(
|
|
46
|
+
new CustomEvent("click", {
|
|
47
|
+
detail: "pkt-link-clicked",
|
|
48
|
+
bubbles: !0
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
r([
|
|
54
|
+
i({ type: String, reflect: !0 })
|
|
55
|
+
], e.prototype, "href", 2);
|
|
56
|
+
r([
|
|
57
|
+
i({ type: String, reflect: !0 })
|
|
58
|
+
], e.prototype, "iconName", 2);
|
|
59
|
+
r([
|
|
60
|
+
i({ type: String, reflect: !0 })
|
|
61
|
+
], e.prototype, "iconPosition", 2);
|
|
62
|
+
r([
|
|
63
|
+
i({ type: Boolean, reflect: !0 })
|
|
64
|
+
], e.prototype, "external", 2);
|
|
65
|
+
r([
|
|
66
|
+
i({ type: String, reflect: !0 })
|
|
67
|
+
], e.prototype, "target", 2);
|
|
68
|
+
e = r([
|
|
69
|
+
k("pkt-link")
|
|
70
|
+
], e);
|
|
71
|
+
export {
|
|
72
|
+
e as P
|
|
73
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";const t=require("./element-DJpGVXjq.cjs"),k=require("./pkt-slot-controller-plQxXRvV.cjs"),p=require("./ref-CLqTsViF.cjs"),h=require("./class-map-DvBKxTiW.cjs");require("./icon-UtDKPH3R.cjs");const f={href:{default:"#"},target:{default:"_self"},external:{default:!1}},a={props:f};var u=Object.defineProperty,P=Object.getOwnPropertyDescriptor,n=(o,i,s,r)=>{for(var e=r>1?void 0:r?P(i,s):i,l=o.length-1,c;l>=0;l--)(c=o[l])&&(e=(r?c(i,s,e):c(e))||e);return r&&e&&u(i,s,e),e};exports.PktLink=class extends t.PktElement{constructor(){super(),this.defaultSlot=p.e(),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=a.props.external.default,this.target=a.props.target.default,this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const i={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return t.x`<a
|
|
2
|
+
class=${h.e(i)}
|
|
3
|
+
href=${this.href}
|
|
4
|
+
@click=${this.handleClick}
|
|
5
|
+
.target=${this.target}
|
|
6
|
+
.rel=${this.external?"noopener noreferrer":t.E}
|
|
7
|
+
>${this.iconName?t.x`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${p.n(this.defaultSlot)}>Link</span></a
|
|
8
|
+
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);n([t.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=n([t.t("pkt-link")],exports.PktLink);
|
package/dist/link.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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
4
|
declare global {
|
|
16
5
|
interface HTMLElementTagNameMap {
|
|
17
|
-
'pkt-
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
18
7
|
}
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
|
|
22
11
|
declare global {
|
|
23
12
|
interface HTMLElementTagNameMap {
|
|
24
|
-
'pkt-
|
|
13
|
+
'pkt-icon': PktIcon;
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
|
|
29
18
|
declare global {
|
|
30
19
|
interface HTMLElementTagNameMap {
|
|
31
|
-
'pkt-
|
|
20
|
+
'pkt-listbox': PktListbox;
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
|
|
35
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
36
|
declare global {
|
|
37
37
|
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-
|
|
38
|
+
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-DJpGVXjq.cjs"),k=require("./ref-CLqTsViF.cjs"),p=require("./pkt-slot-controller-plQxXRvV.cjs");require("./icon-UtDKPH3R.cjs");var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(s,n,i,l)=>{for(var e=l>1?void 0:l?h(n,i):n,o=s.length-1,a;o>=0;o--)(a=s[o])&&(e=(l?a(n,i,e):a(e))||e);return l&&e&&c(n,i,e),e};exports.PktLinkCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=k.e(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new p.PktSlotController(this,this.defaultSlot)}render(){const n=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),i=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return t.x`
|
|
2
2
|
<a
|
|
3
3
|
href=${this.href}
|
|
4
4
|
class=${n}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as f, x as c, n, a as h } from "./element-
|
|
2
|
-
import { e as k, n as m } from "./ref-
|
|
3
|
-
import { P as u } from "./pkt-slot-controller-
|
|
4
|
-
import "./icon-
|
|
1
|
+
import { P as f, x as c, n, a as h } from "./element-DiqKrDty.js";
|
|
2
|
+
import { e as k, n as m } from "./ref-B70YZNXm.js";
|
|
3
|
+
import { P as u } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
4
|
+
import "./icon-BdY52BIt.js";
|
|
5
5
|
var _ = Object.defineProperty, d = Object.getOwnPropertyDescriptor, r = (l, i, s, o) => {
|
|
6
6
|
for (var e = o > 1 ? void 0 : o ? d(i, s) : i, a = l.length - 1, p; a >= 0; a--)
|
|
7
7
|
(p = l[a]) && (e = (o ? p(i, s, e) : p(e)) || e);
|