@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
package/dist/linkcard.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 s=require("./element-
|
|
1
|
+
"use strict";const s=require("./element-DJpGVXjq.cjs"),p=require("./state-C4LdlTYO.cjs"),h=require("./if-defined-CoBDkDGb.cjs"),u=require("./repeat-t2oms1o6.cjs"),c=require("./class-map-DvBKxTiW.cjs"),d=require("./stringutils-CkVRq4jP.cjs");var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(r,e,t,i)=>{for(var a=i>1?void 0:i?f(e,t):e,o=r.length-1,l;o>=0;o--)(l=r[o])&&(a=(i?l(e,t,a):l(a))||a);return i&&a&&b(e,t,a),a};exports.PktListbox=class extends s.PktElement{constructor(){super(...arguments),this.id=d.uuidish(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return s.x`
|
|
2
2
|
<div
|
|
3
3
|
class=${c.e({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
4
4
|
role="listbox"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as u, x as r, E as p, t as b, n as l, a as f } from "./element-
|
|
2
|
-
import { r as m } from "./state-
|
|
3
|
-
import { o as y } from "./if-defined-
|
|
4
|
-
import { c as k } from "./repeat-
|
|
5
|
-
import { e as d } from "./class-map-
|
|
1
|
+
import { P as u, x as r, E as p, t as b, n as l, a as f } from "./element-DiqKrDty.js";
|
|
2
|
+
import { r as m } from "./state-CDwPbiQj.js";
|
|
3
|
+
import { o as y } from "./if-defined-DeANa4n5.js";
|
|
4
|
+
import { c as k } from "./repeat-CNLpCTun.js";
|
|
5
|
+
import { e as d } from "./class-map-D4tSZX70.js";
|
|
6
6
|
import { u as x } from "./stringutils-DJjRa8dG.js";
|
|
7
7
|
var O = Object.defineProperty, g = Object.getOwnPropertyDescriptor, a = (e, t, s, o) => {
|
|
8
8
|
for (var n = o > 1 ? void 0 : o ? g(t, s) : t, c = e.length - 1, h; c >= 0; c--)
|
package/dist/listbox.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,9 +1,9 @@
|
|
|
1
|
-
import { P as u,
|
|
2
|
-
import { e as h } from "./class-map-
|
|
3
|
-
import { r as m } from "./state-
|
|
4
|
-
import { e as f, n as v } from "./ref-
|
|
5
|
-
import { P as _ } from "./pkt-slot-controller-
|
|
6
|
-
import "./icon-
|
|
1
|
+
import { P as u, E as y, x as d, n as o, a as c } from "./element-DiqKrDty.js";
|
|
2
|
+
import { e as h } from "./class-map-D4tSZX70.js";
|
|
3
|
+
import { r as m } from "./state-CDwPbiQj.js";
|
|
4
|
+
import { e as f, n as v } from "./ref-B70YZNXm.js";
|
|
5
|
+
import { P as _ } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
6
|
+
import "./icon-BdY52BIt.js";
|
|
7
7
|
var g = Object.defineProperty, L = Object.getOwnPropertyDescriptor, s = (e, a, l, r) => {
|
|
8
8
|
for (var i = r > 1 ? void 0 : r ? L(a, l) : a, p = e.length - 1, n; p >= 0; p--)
|
|
9
9
|
(n = e[p]) && (i = (r ? n(a, l, i) : n(i)) || i);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-DJpGVXjq.cjs"),d=require("./class-map-DvBKxTiW.cjs"),u=require("./state-C4LdlTYO.cjs"),p=require("./ref-CLqTsViF.cjs"),h=require("./pkt-slot-controller-plQxXRvV.cjs");require("./icon-UtDKPH3R.cjs");var c=Object.defineProperty,y=Object.getOwnPropertyDescriptor,s=(o,t,r,i)=>{for(var a=i>1?void 0:i?y(t,r):t,l=o.length-1,n;l>=0;l--)(n=o[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&c(t,r,a),a};exports.PktLoader=class extends e.PktElement{constructor(){super(),this.defaultSlot=p.e(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this._shouldDisplayLoader=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=d.e({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),r=d.e({"pkt-contents":!0,"pkt-hide":this.isLoading});return e.x`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${t}>
|
|
2
2
|
${this.isLoading&&this._shouldDisplayLoader?e.x`<div class="pkt-loader__spinner">
|
|
3
3
|
<pkt-icon
|
|
4
4
|
name=${this.getVariant(this.variant)}
|
package/dist/loader.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,79 @@
|
|
|
1
|
+
import { P as b, E as u, x as n, n as p, a as m } from "./element-DiqKrDty.js";
|
|
2
|
+
import { P as h } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
3
|
+
import { e as f, n as k } from "./ref-B70YZNXm.js";
|
|
4
|
+
import { e as _ } from "./class-map-D4tSZX70.js";
|
|
5
|
+
import { r as v } from "./state-CDwPbiQj.js";
|
|
6
|
+
import "./icon-BdY52BIt.js";
|
|
7
|
+
import { u as g } from "./classutils-RQs1k6D9.js";
|
|
8
|
+
const x = {
|
|
9
|
+
skin: {
|
|
10
|
+
default: "beige"
|
|
11
|
+
},
|
|
12
|
+
compact: {
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
closable: {
|
|
16
|
+
default: !1
|
|
17
|
+
}
|
|
18
|
+
}, d = {
|
|
19
|
+
props: x
|
|
20
|
+
};
|
|
21
|
+
var C = Object.defineProperty, y = Object.getOwnPropertyDescriptor, o = (t, l, a, i) => {
|
|
22
|
+
for (var s = i > 1 ? void 0 : i ? y(l, a) : l, r = t.length - 1, c; r >= 0; r--)
|
|
23
|
+
(c = t[r]) && (s = (i ? c(l, a, s) : c(s)) || s);
|
|
24
|
+
return i && s && C(l, a, s), s;
|
|
25
|
+
};
|
|
26
|
+
let e = class extends b {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(), this.defaultSlot = f(), this.closable = d.props.closable.default, this.compact = d.props.compact.default, this.title = "", this.skin = d.props.skin.default, this._isClosed = !1, this.close = (t) => {
|
|
29
|
+
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", { detail: { origin: t }, bubbles: !0 })), this.dispatchEvent(new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0 }));
|
|
30
|
+
}, this.slotController = new h(this, this.defaultSlot), this._isClosed = !1;
|
|
31
|
+
}
|
|
32
|
+
// Lifecycle
|
|
33
|
+
updated(t) {
|
|
34
|
+
super.updated(t), t.has("_isClosed") && g(this, "pkt-hide", this._isClosed);
|
|
35
|
+
}
|
|
36
|
+
// Render
|
|
37
|
+
render() {
|
|
38
|
+
const t = {
|
|
39
|
+
"pkt-messagebox": !0,
|
|
40
|
+
"pkt-messagebox--compact": this.compact,
|
|
41
|
+
[`pkt-messagebox--${this.skin}`]: this.skin,
|
|
42
|
+
"pkt-messagebox--closable": this.closable,
|
|
43
|
+
"pkt-hide": this._isClosed
|
|
44
|
+
};
|
|
45
|
+
return n`<div class=${_(t)}>
|
|
46
|
+
${this.closable ? n`<div class="pkt-messagebox__close">
|
|
47
|
+
<button
|
|
48
|
+
@click=${this.close}
|
|
49
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
50
|
+
>
|
|
51
|
+
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
52
|
+
</button>
|
|
53
|
+
</div>` : u}
|
|
54
|
+
${this.title ? n`<div class="pkt-messagebox__title">${this.title}</div>` : u}
|
|
55
|
+
<div class="pkt-messagebox__text" ${k(this.defaultSlot)}></div>
|
|
56
|
+
</div>`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
o([
|
|
60
|
+
p({ type: Boolean, reflect: !0 })
|
|
61
|
+
], e.prototype, "closable", 2);
|
|
62
|
+
o([
|
|
63
|
+
p({ type: Boolean, reflect: !0 })
|
|
64
|
+
], e.prototype, "compact", 2);
|
|
65
|
+
o([
|
|
66
|
+
p({ type: String, reflect: !0 })
|
|
67
|
+
], e.prototype, "title", 2);
|
|
68
|
+
o([
|
|
69
|
+
p({ type: String, reflect: !0 })
|
|
70
|
+
], e.prototype, "skin", 2);
|
|
71
|
+
o([
|
|
72
|
+
v()
|
|
73
|
+
], e.prototype, "_isClosed", 2);
|
|
74
|
+
e = o([
|
|
75
|
+
m("pkt-messagebox")
|
|
76
|
+
], e);
|
|
77
|
+
export {
|
|
78
|
+
e as P
|
|
79
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";const e=require("./element-DJpGVXjq.cjs"),u=require("./pkt-slot-controller-plQxXRvV.cjs"),n=require("./ref-CLqTsViF.cjs"),b=require("./class-map-DvBKxTiW.cjs"),d=require("./state-C4LdlTYO.cjs");require("./icon-UtDKPH3R.cjs");const k=require("./classutils-BwNK82ZQ.cjs"),h={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},p={props:h};var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,o=(i,t,a,l)=>{for(var s=l>1?void 0:l?x(t,a):t,r=i.length-1,c;r>=0;r--)(c=i[r])&&(s=(l?c(t,a,s):c(s))||s);return l&&s&&f(t,a,s),s};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=n.e(),this.closable=p.props.closable.default,this.compact=p.props.compact.default,this.title="",this.skin=p.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this.slotController=new u.PktSlotController(this,this.defaultSlot),this._isClosed=!1}updated(t){super.updated(t),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.x`<div class=${b.e(t)}>
|
|
2
|
+
${this.closable?e.x`<div class="pkt-messagebox__close">
|
|
3
|
+
<button
|
|
4
|
+
@click=${this.close}
|
|
5
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
6
|
+
>
|
|
7
|
+
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
8
|
+
</button>
|
|
9
|
+
</div>`:e.E}
|
|
10
|
+
${this.title?e.x`<div class="pkt-messagebox__title">${this.title}</div>`:e.E}
|
|
11
|
+
<div class="pkt-messagebox__text" ${n.n(this.defaultSlot)}></div>
|
|
12
|
+
</div>`}};o([e.n({type:Boolean,reflect:!0})],exports.PktMessagebox.prototype,"closable",2);o([e.n({type:Boolean,reflect:!0})],exports.PktMessagebox.prototype,"compact",2);o([e.n({type:String,reflect:!0})],exports.PktMessagebox.prototype,"title",2);o([e.n({type:String,reflect:!0})],exports.PktMessagebox.prototype,"skin",2);o([d.r()],exports.PktMessagebox.prototype,"_isClosed",2);exports.PktMessagebox=o([e.t("pkt-messagebox")],exports.PktMessagebox);
|
package/dist/messagebox.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,33 @@
|
|
|
1
|
+
"use strict";const d=require("./class-map-DvBKxTiW.cjs"),i=require("./element-DJpGVXjq.cjs"),h=require("./state-C4LdlTYO.cjs"),k=require("./pkt-slot-controller-plQxXRvV.cjs"),r=require("./ref-CLqTsViF.cjs");require("./icon-UtDKPH3R.cjs");const m={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},p={props:m};var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,l=(c,e,t,s)=>{for(var o=s>1?void 0:s?v(e,t):e,n=c.length-1,a;n>=0;n--)(a=c[n])&&(o=(s?a(e,t,o):a(o))||o);return s&&o&&f(e,t,o),o};exports.PktModal=class extends i.PktElement{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=p.props.hideCloseButton.default,this.closeOnBackdropClick=p.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=p.props.size.default,this.defaultSlot=r.e(),this.dialogRef=r.e(),this._isOpen=!1,this.close=(e,t=!1)=>{var o;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const s=document.activeElement;s&&!this.isElementInViewport(s)&&s.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(o=this.dialogRef.value)==null||o.close(),this.requestUpdate()},this.showModal=e=>{var s;this._isOpen=!0,(s=this.dialogRef.value)==null||s.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var o;this.dialogRef.value&&((o=this.dialogRef.value)==null||o.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new k.PktSlotController(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("click",this.handleBackdropClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,[`pkt-modal--${this.size}`]:this.size!==void 0},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},s={"pkt-modal__content":!0,"pkt-txt-18-light":!0},o=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},a={"pkt-btn":!0,[`pkt-btn--${o?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return i.x`
|
|
2
|
+
<dialog
|
|
3
|
+
class=${d.e(e)}
|
|
4
|
+
${r.n(this.dialogRef)}
|
|
5
|
+
aria-labelledby="pkt-modal__headingText"
|
|
6
|
+
aria-describedby="pkt-modal__content"
|
|
7
|
+
@close=${u=>this.close(u,!0)}
|
|
8
|
+
>
|
|
9
|
+
<div class="pkt-modal__header">
|
|
10
|
+
<div class="pkt-modal__header-background"></div>
|
|
11
|
+
${this.headingText?i.x`<h1 id="pkt-modal__headingText" class=${d.e(t)}>
|
|
12
|
+
${this.headingText}
|
|
13
|
+
</h1>`:i.E}
|
|
14
|
+
${this.hideCloseButton?i.E:i.x`<div class="${d.e(n)}">
|
|
15
|
+
<pkt-button
|
|
16
|
+
@click=${u=>this.close(u)}
|
|
17
|
+
class=${d.e(a)}
|
|
18
|
+
aria-label="close"
|
|
19
|
+
iconname="close"
|
|
20
|
+
variant="icon-only"
|
|
21
|
+
>
|
|
22
|
+
</pkt-button>
|
|
23
|
+
</div>`}
|
|
24
|
+
</div>
|
|
25
|
+
<div class="pkt-modal__container">
|
|
26
|
+
<div
|
|
27
|
+
id="pkt-modal__content"
|
|
28
|
+
class=${d.e(s)}
|
|
29
|
+
${r.n(this.defaultSlot)}
|
|
30
|
+
></div>
|
|
31
|
+
</div>
|
|
32
|
+
</dialog>
|
|
33
|
+
`}};l([i.n({type:String,reflect:!0})],exports.PktModal.prototype,"headingText",2);l([i.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"removePadding",2);l([i.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"hideCloseButton",2);l([i.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"closeOnBackdropClick",2);l([i.n({type:String,reflect:!0})],exports.PktModal.prototype,"closeButtonSkin",2);l([i.n({type:String,reflect:!0})],exports.PktModal.prototype,"size",2);l([h.r()],exports.PktModal.prototype,"_isOpen",2);exports.PktModal=l([i.t("pkt-modal")],exports.PktModal);
|
|
@@ -1,91 +1,48 @@
|
|
|
1
|
-
import { e as c } from "./class-map-
|
|
2
|
-
import { P as f,
|
|
3
|
-
import { r as
|
|
4
|
-
import { P as
|
|
5
|
-
import { e as m, n as
|
|
6
|
-
import "./icon-
|
|
7
|
-
const
|
|
8
|
-
"background-click": {
|
|
9
|
-
description: "Event som trigges når bakgrunnen trykkes på"
|
|
10
|
-
},
|
|
11
|
-
close: {
|
|
12
|
-
description: "Event som trigges når meldingsboksen lukkes"
|
|
13
|
-
}
|
|
14
|
-
}, B = {
|
|
15
|
-
headingText: {
|
|
16
|
-
name: "Heading text",
|
|
17
|
-
description: "Heading tekst på modalen",
|
|
18
|
-
type: "string"
|
|
19
|
-
},
|
|
1
|
+
import { e as c } from "./class-map-D4tSZX70.js";
|
|
2
|
+
import { P as f, E as h, x as p, n as d, a as v } from "./element-DiqKrDty.js";
|
|
3
|
+
import { r as g } from "./state-CDwPbiQj.js";
|
|
4
|
+
import { P as _ } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
5
|
+
import { e as m, n as k } from "./ref-B70YZNXm.js";
|
|
6
|
+
import "./icon-BdY52BIt.js";
|
|
7
|
+
const b = {
|
|
20
8
|
hideCloseButton: {
|
|
21
|
-
name: "Gjem 'Lukk'-knapp",
|
|
22
|
-
description: "Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.",
|
|
23
|
-
type: "boolean",
|
|
24
9
|
default: !1
|
|
25
10
|
},
|
|
26
11
|
closeOnBackdropClick: {
|
|
27
|
-
name: "Lukk modalen når bakgrunnen trykkes på",
|
|
28
|
-
description: "Lukk modalen når bakgrunnen trykkes på",
|
|
29
|
-
type: "boolean",
|
|
30
12
|
default: !1
|
|
31
13
|
},
|
|
32
|
-
closeButtonSkin: {
|
|
33
|
-
name: "Stil på lukkeknappen",
|
|
34
|
-
description: "Stil på lukkeknappen",
|
|
35
|
-
type: [
|
|
36
|
-
"blue",
|
|
37
|
-
"yellow-filled"
|
|
38
|
-
],
|
|
39
|
-
default: "blue"
|
|
40
|
-
},
|
|
41
14
|
size: {
|
|
42
|
-
name: "Størrelse",
|
|
43
|
-
description: "Størrelsen på modalen",
|
|
44
|
-
type: [
|
|
45
|
-
"small",
|
|
46
|
-
"medium",
|
|
47
|
-
"large"
|
|
48
|
-
],
|
|
49
15
|
default: "medium"
|
|
50
16
|
}
|
|
51
|
-
}, w = {
|
|
52
|
-
default: {
|
|
53
|
-
description: "Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen."
|
|
54
|
-
}
|
|
55
17
|
}, u = {
|
|
56
|
-
|
|
57
|
-
"css-class": "pkt-modal",
|
|
58
|
-
isElements: _,
|
|
59
|
-
events: C,
|
|
60
|
-
props: B,
|
|
61
|
-
slots: w
|
|
18
|
+
props: b
|
|
62
19
|
};
|
|
63
|
-
var
|
|
64
|
-
for (var
|
|
65
|
-
(a = t[
|
|
66
|
-
return
|
|
20
|
+
var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, n = (t, e, o, s) => {
|
|
21
|
+
for (var i = s > 1 ? void 0 : s ? C(e, o) : e, r = t.length - 1, a; r >= 0; r--)
|
|
22
|
+
(a = t[r]) && (i = (s ? a(e, o, i) : a(i)) || i);
|
|
23
|
+
return s && i && y(e, o, i), i;
|
|
67
24
|
};
|
|
68
|
-
let
|
|
25
|
+
let l = class extends f {
|
|
69
26
|
constructor() {
|
|
70
27
|
super(), this.headingText = "", this.removePadding = !1, this.hideCloseButton = u.props.hideCloseButton.default, this.closeOnBackdropClick = u.props.closeOnBackdropClick.default, this.closeButtonSkin = "blue", this.size = u.props.size.default, this.defaultSlot = m(), this.dialogRef = m(), this._isOpen = !1, this.close = (t, e = !1) => {
|
|
71
|
-
var
|
|
28
|
+
var s;
|
|
72
29
|
if (!this._isOpen) return;
|
|
73
30
|
this._isOpen = !1, document.body.classList.remove("pkt-modal--open");
|
|
74
31
|
const o = document.activeElement;
|
|
75
32
|
o && !this.isElementInViewport(o) && o.scrollIntoView({ behavior: "smooth", block: "nearest" }), this.dispatchEvent(
|
|
76
33
|
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
77
|
-
), e || (
|
|
34
|
+
), e || (s = this.dialogRef.value) == null || s.close(), this.requestUpdate();
|
|
78
35
|
}, this.showModal = (t) => {
|
|
79
36
|
var o;
|
|
80
37
|
this._isOpen = !0, (o = this.dialogRef.value) == null || o.showModal();
|
|
81
38
|
const e = document.querySelector(".pkt-modal");
|
|
82
39
|
requestAnimationFrame(() => {
|
|
83
|
-
var
|
|
84
|
-
this.dialogRef.value && ((
|
|
40
|
+
var s;
|
|
41
|
+
this.dialogRef.value && ((s = this.dialogRef.value) == null || s.focus());
|
|
85
42
|
}), e && document.body.classList.add("pkt-modal--open"), this.dispatchEvent(
|
|
86
43
|
new CustomEvent("showModal", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
87
44
|
), this.requestUpdate();
|
|
88
|
-
}, this.slotController = new
|
|
45
|
+
}, this.slotController = new _(this, this.defaultSlot), this._isOpen = !1;
|
|
89
46
|
}
|
|
90
47
|
async connectedCallback() {
|
|
91
48
|
super.connectedCallback(), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("click", this.handleBackdropClick);
|
|
@@ -117,19 +74,19 @@ let i = class extends f {
|
|
|
117
74
|
}, o = {
|
|
118
75
|
"pkt-modal__content": !0,
|
|
119
76
|
"pkt-txt-18-light": !0
|
|
120
|
-
},
|
|
77
|
+
}, s = this.closeButtonSkin === "blue", i = {
|
|
121
78
|
"pkt-modal__closeButton": !0,
|
|
122
79
|
[`pkt-modal__closeButton--${this.closeButtonSkin}`]: !0
|
|
123
|
-
},
|
|
80
|
+
}, r = {
|
|
124
81
|
"pkt-btn": !0,
|
|
125
|
-
[`pkt-btn--${
|
|
82
|
+
[`pkt-btn--${s ? "tertiary" : "primary"}`]: !0,
|
|
126
83
|
"pkt-btn--icon-only": !0,
|
|
127
84
|
"pkt-btn--medium": !0
|
|
128
85
|
};
|
|
129
86
|
return p`
|
|
130
87
|
<dialog
|
|
131
88
|
class=${c(t)}
|
|
132
|
-
${
|
|
89
|
+
${k(this.dialogRef)}
|
|
133
90
|
aria-labelledby="pkt-modal__headingText"
|
|
134
91
|
aria-describedby="pkt-modal__content"
|
|
135
92
|
@close=${(a) => this.close(a, !0)}
|
|
@@ -138,11 +95,11 @@ let i = class extends f {
|
|
|
138
95
|
<div class="pkt-modal__header-background"></div>
|
|
139
96
|
${this.headingText ? p`<h1 id="pkt-modal__headingText" class=${c(e)}>
|
|
140
97
|
${this.headingText}
|
|
141
|
-
</h1>` :
|
|
142
|
-
${this.hideCloseButton ?
|
|
98
|
+
</h1>` : h}
|
|
99
|
+
${this.hideCloseButton ? h : p`<div class="${c(i)}">
|
|
143
100
|
<pkt-button
|
|
144
101
|
@click=${(a) => this.close(a)}
|
|
145
|
-
class=${c(
|
|
102
|
+
class=${c(r)}
|
|
146
103
|
aria-label="close"
|
|
147
104
|
iconname="close"
|
|
148
105
|
variant="icon-only"
|
|
@@ -154,37 +111,37 @@ let i = class extends f {
|
|
|
154
111
|
<div
|
|
155
112
|
id="pkt-modal__content"
|
|
156
113
|
class=${c(o)}
|
|
157
|
-
${
|
|
114
|
+
${k(this.defaultSlot)}
|
|
158
115
|
></div>
|
|
159
116
|
</div>
|
|
160
117
|
</dialog>
|
|
161
118
|
`;
|
|
162
119
|
}
|
|
163
120
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
],
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
],
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
],
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
],
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
],
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
],
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
],
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
],
|
|
121
|
+
n([
|
|
122
|
+
d({ type: String, reflect: !0 })
|
|
123
|
+
], l.prototype, "headingText", 2);
|
|
124
|
+
n([
|
|
125
|
+
d({ type: Boolean, reflect: !0 })
|
|
126
|
+
], l.prototype, "removePadding", 2);
|
|
127
|
+
n([
|
|
128
|
+
d({ type: Boolean, reflect: !0 })
|
|
129
|
+
], l.prototype, "hideCloseButton", 2);
|
|
130
|
+
n([
|
|
131
|
+
d({ type: Boolean, reflect: !0 })
|
|
132
|
+
], l.prototype, "closeOnBackdropClick", 2);
|
|
133
|
+
n([
|
|
134
|
+
d({ type: String, reflect: !0 })
|
|
135
|
+
], l.prototype, "closeButtonSkin", 2);
|
|
136
|
+
n([
|
|
137
|
+
d({ type: String, reflect: !0 })
|
|
138
|
+
], l.prototype, "size", 2);
|
|
139
|
+
n([
|
|
140
|
+
g()
|
|
141
|
+
], l.prototype, "_isOpen", 2);
|
|
142
|
+
l = n([
|
|
143
|
+
v("pkt-modal")
|
|
144
|
+
], l);
|
|
188
145
|
export {
|
|
189
|
-
|
|
146
|
+
l as P
|
|
190
147
|
};
|