@oslokommune/punkt-elements 12.31.2 → 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 +32 -0
- package/dist/{backlink-CzpB-ih9.js → backlink-BX8HBhw5.js} +2 -2
- package/dist/{backlink-Dn4DfWVR.cjs → backlink-NJdC0FAO.cjs} +1 -1
- package/dist/backlink.d.ts +32 -0
- package/dist/{button-9NwGr-OS.js → button-Bn8jVB0f.js} +33 -33
- package/dist/{button-Beo3c7cx.cjs → button-Bpbh8A_a.cjs} +2 -2
- package/dist/button.d.ts +32 -0
- package/dist/{calendar-BbZNxsKY.js → calendar-BNHDEEwT.js} +20 -84
- package/dist/{calendar-CxBo98iI.cjs → calendar-Ds13AKr5.cjs} +4 -4
- package/dist/calendar.d.ts +32 -0
- package/dist/card-CEv3DL-o.js +94 -0
- package/dist/card-c5EEPaNh.cjs +28 -0
- package/dist/card.d.ts +32 -0
- package/dist/{checkbox-9Zjy_NU7.cjs → checkbox-DDBBDM85.cjs} +1 -1
- package/dist/{checkbox-CzDpR6_8.js → checkbox-DoMYxp83.js} +9 -9
- package/dist/checkbox.d.ts +32 -0
- package/dist/{class-map-DWtqmIRS.js → class-map-D4tSZX70.js} +2 -2
- package/dist/{class-map-Dj5mbCUg.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 +47 -0
- package/dist/datepicker-Bkiyh5P5.cjs +153 -0
- package/dist/datepicker-nWd89NwP.js +449 -0
- package/dist/datepicker.d.ts +32 -0
- 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-C7XjZtLU.js → element-DiqKrDty.js} +8851 -8847
- package/dist/{helptext-CqnoPodd.js → helptext-DfRusn5R.js} +13 -13
- package/dist/{helptext-B9kxDc2b.cjs → helptext-aHD9icur.cjs} +2 -2
- package/dist/helptext.d.ts +32 -0
- package/dist/{icon-BEUgV9Wo.js → icon-BdY52BIt.js} +2 -2
- package/dist/{icon-BOKusjAA.cjs → icon-UtDKPH3R.cjs} +1 -1
- package/dist/icon.d.ts +32 -0
- package/dist/{if-defined-CpIkv1A4.cjs → if-defined-CoBDkDGb.cjs} +1 -1
- package/dist/{if-defined-eRX4e5zO.js → if-defined-DeANa4n5.js} +1 -1
- package/dist/index.d.ts +210 -15
- package/dist/{input-element-BK8UkQli.js → input-element-C4mmTk6h.js} +23 -20
- package/dist/input-element-VNai8bsq.cjs +1 -0
- package/dist/input-wrapper-8iKEzDRZ.js +40 -0
- package/dist/input-wrapper-DWOw7Yn-.cjs +52 -0
- package/dist/input-wrapper-EoSAbU-U.cjs +1 -0
- package/dist/input-wrapper-P_oEi6dk.js +185 -0
- package/dist/input-wrapper.d.ts +32 -0
- package/dist/link-D9dJ6F-R.js +73 -0
- package/dist/link-DBxXqsnP.cjs +8 -0
- package/dist/link.d.ts +32 -0
- package/dist/{linkcard-2WzDJPZz.cjs → linkcard-D5O1hR7N.cjs} +1 -1
- package/dist/{linkcard-CRpo3tiw.js → linkcard-DcEE9IVw.js} +4 -4
- package/dist/linkcard.d.ts +32 -0
- package/dist/listbox-CK1GmwCE.cjs +95 -0
- package/dist/listbox-CfJWJDrc.js +360 -0
- package/dist/listbox.d.ts +47 -0
- package/dist/{loader-B1edLWTg.js → loader-DZvOlXzI.js} +6 -6
- package/dist/{loader-DI74pe25.cjs → loader-SDXJp58K.cjs} +1 -1
- package/dist/loader.d.ts +32 -0
- package/dist/messagebox-Ce5e1gga.js +79 -0
- package/dist/messagebox-D2_-WZQG.cjs +12 -0
- package/dist/messagebox.d.ts +32 -0
- package/dist/modal-CCtUsYKk.cjs +33 -0
- package/dist/{modal-kPX8nO_L.js → modal-CdgIOp8Q.js} +51 -94
- package/dist/modal.d.ts +32 -0
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -0
- package/dist/pkt-combobox.js +6 -0
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +3 -3
- package/dist/pkt-index.js +45 -43
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -0
- package/dist/pkt-listbox.js +6 -0
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-options-controller-BkWE4pZe.js +38 -0
- package/dist/pkt-options-controller-TJ1apYGF.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-slot-controller-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-D0nxLqHu.js → progressbar-DvFz9KBo.js} +6 -6
- package/dist/{progressbar-B6A9UVXS.cjs → progressbar-jASTnhti.cjs} +1 -1
- package/dist/progressbar.d.ts +32 -0
- package/dist/{radiobutton-BWyQgR_x.cjs → radiobutton-C-Xd5sSq.cjs} +1 -1
- package/dist/{radiobutton-DLWjvLBO.js → radiobutton-D03aN4yn.js} +5 -5
- package/dist/radiobutton.d.ts +32 -0
- package/dist/ref-B70YZNXm.js +102 -0
- package/dist/ref-CLqTsViF.cjs +9 -0
- package/dist/repeat-CNLpCTun.js +61 -0
- package/dist/repeat-t2oms1o6.cjs +5 -0
- package/dist/select-BLDaK5Rd.js +118 -0
- package/dist/select-Dvds7MzS.cjs +49 -0
- package/dist/select.d.ts +32 -0
- package/dist/{state-HNj0_316.cjs → state-C4LdlTYO.cjs} +1 -1
- package/dist/{state-CDQk0DFQ.js → state-CDwPbiQj.js} +1 -1
- package/dist/tag-C52KeBmR.cjs +18 -0
- package/dist/{tag-CmFcSdOV.js → tag-DoS5S2Bq.js} +28 -77
- package/dist/tag.d.ts +32 -0
- package/dist/{textarea-BPqWCymU.js → textarea-C9EvdPGi.js} +18 -17
- package/dist/{textarea-VG-UTMLP.cjs → textarea-DJvNBmEL.cjs} +6 -6
- package/dist/textarea.d.ts +32 -0
- package/dist/{textinput-CEP7QA3E.cjs → textinput-Cg3ObBuw.cjs} +5 -4
- package/dist/{textinput-VD74aGzx.js → textinput-CxRSSYaN.js} +34 -33
- package/dist/textinput.d.ts +32 -0
- package/package.json +4 -4
- package/src/components/button/button.ts +3 -2
- package/src/components/combobox/combobox.ts +873 -0
- package/src/components/combobox/countrycodes.json +927 -0
- package/src/components/combobox/index.ts +6 -0
- package/src/components/datepicker/datepicker.ts +6 -4
- package/src/components/helptext/helptext.ts +1 -1
- package/src/components/index.ts +7 -0
- package/src/components/input-wrapper/input-wrapper.ts +42 -34
- package/src/components/listbox/index.ts +4 -0
- package/src/components/listbox/listbox.ts +474 -0
- package/src/components/select/select.ts +7 -0
- package/src/components/tag/tag.ts +1 -1
- package/src/components/textinput/textinput.ts +3 -2
- package/dist/alert-BDxxRqgi.cjs +0 -27
- package/dist/alert-D0S57u0r.js +0 -163
- package/dist/card-C63x_nll.cjs +0 -28
- package/dist/card-DQfNKnKl.js +0 -176
- package/dist/datepicker-CYUvRGhE.js +0 -663
- package/dist/datepicker-FuAL0uNU.cjs +0 -155
- package/dist/directive-C_VV3qwo.cjs +0 -5
- package/dist/element-CzFXQBoS.cjs +0 -238
- package/dist/input-element-Dtyuf6s8.cjs +0 -1
- package/dist/input-wrapper-Bo2_t6pA.cjs +0 -50
- package/dist/input-wrapper-Bw9tARAD.js +0 -125
- package/dist/input-wrapper-DaZZq8c0.js +0 -172
- package/dist/input-wrapper-jPnKsfEC.cjs +0 -1
- package/dist/link-1iq0Pmuf.cjs +0 -8
- package/dist/link-D3U0Jkz8.js +0 -109
- package/dist/messagebox-DQpEMkS2.cjs +0 -12
- package/dist/messagebox-KP-8-tA9.js +0 -114
- package/dist/modal-ytIJwfr3.cjs +0 -33
- package/dist/pkt-slot-controller-Clbye6cM.js +0 -85
- package/dist/pkt-slot-controller-Oc32unDk.cjs +0 -1
- package/dist/ref-2anvRHT4.cjs +0 -13
- package/dist/ref-DbOSDQbk.js +0 -143
- package/dist/select-CzuxXKll.js +0 -150
- package/dist/select-DZL6aa2s.cjs +0 -48
- package/dist/tag-BeLSOjNh.cjs +0 -18
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const u=require("./class-map-DvBKxTiW.cjs"),e=require("./element-DJpGVXjq.cjs"),d=require("./state-C4LdlTYO.cjs"),h=require("./pkt-slot-controller-plQxXRvV.cjs"),c=require("./ref-CLqTsViF.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-UtDKPH3R.cjs");const f={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:f};var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,s=(o,t,r,i)=>{for(var l=i>1?void 0:i?b(t,r):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(l=(i?n(t,r,l):n(l))||l);return i&&l&&v(t,r,l),l};exports.PktAlert=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,r,i){t==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(t,r,i)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return e.x`
|
|
2
|
+
<div class=${u.e(t)}>
|
|
3
|
+
<pkt-icon
|
|
4
|
+
class="pkt-alert__icon"
|
|
5
|
+
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
6
|
+
></pkt-icon>
|
|
7
|
+
|
|
8
|
+
${this.closeAlert?e.x`
|
|
9
|
+
<div class="pkt-alert__close">
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
aria-label="close"
|
|
15
|
+
@click=${this.close}
|
|
16
|
+
>
|
|
17
|
+
<pkt-icon name="close" class="pkt-btn__icon" aria-hidden="true"></pkt-icon>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
`:e.E}
|
|
21
|
+
${this.title?e.x`<div class="pkt-alert__title">${this.title}</div>`:e.E}
|
|
22
|
+
|
|
23
|
+
<div class="pkt-alert__text" ${c.n(this.defaultSlot)}></div>
|
|
24
|
+
|
|
25
|
+
${this.date?e.x`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:e.E}
|
|
26
|
+
</div>
|
|
27
|
+
`}};s([e.n({type:Boolean,reflect:!1})],exports.PktAlert.prototype,"compact",2);s([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"title",2);s([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"skin",2);s([e.n({type:String})],exports.PktAlert.prototype,"ariaLive",2);s([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"aria-live",2);s([e.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closeAlert",2);s([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"date",2);s([d.r()],exports.PktAlert.prototype,"_isClosed",2);exports.PktAlert=s([e.t("pkt-alert")],exports.PktAlert);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { e as h } from "./class-map-D4tSZX70.js";
|
|
2
|
+
import { P as f, E as u, x as p, n as l, a as v } from "./element-DiqKrDty.js";
|
|
3
|
+
import { r as k } from "./state-CDwPbiQj.js";
|
|
4
|
+
import { P as m } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
5
|
+
import { e as b, n as _ } from "./ref-B70YZNXm.js";
|
|
6
|
+
import { u as C } from "./classutils-RQs1k6D9.js";
|
|
7
|
+
import "./icon-BdY52BIt.js";
|
|
8
|
+
const y = {
|
|
9
|
+
skin: {
|
|
10
|
+
default: "info"
|
|
11
|
+
},
|
|
12
|
+
ariaLive: {
|
|
13
|
+
default: "polite"
|
|
14
|
+
},
|
|
15
|
+
compact: {
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
closeAlert: {
|
|
19
|
+
default: !1
|
|
20
|
+
}
|
|
21
|
+
}, n = {
|
|
22
|
+
props: y
|
|
23
|
+
};
|
|
24
|
+
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, a, r, o) => {
|
|
25
|
+
for (var s = o > 1 ? void 0 : o ? S(a, r) : a, c = t.length - 1, d; c >= 0; c--)
|
|
26
|
+
(d = t[c]) && (s = (o ? d(a, r, s) : d(s)) || s);
|
|
27
|
+
return o && s && $(a, r, s), s;
|
|
28
|
+
};
|
|
29
|
+
let e = class extends f {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(), this.defaultSlot = b(), this.compact = n.props.compact.default, this.title = "", this.skin = n.props.skin.default, this.ariaLive = n.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = n.props.closeAlert.default, this.date = null, this._isClosed = !1, this.close = (t) => {
|
|
32
|
+
this._isClosed = !0, this.dispatchEvent(
|
|
33
|
+
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
34
|
+
), this.dispatchEvent(
|
|
35
|
+
new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
36
|
+
);
|
|
37
|
+
}, this.slotController = new m(this, this.defaultSlot), this._isClosed = !1;
|
|
38
|
+
}
|
|
39
|
+
// Lifecycle
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback(), this["aria-live"] = this.getAttribute("aria-live") || this.ariaLive;
|
|
42
|
+
}
|
|
43
|
+
attributeChangedCallback(t, a, r) {
|
|
44
|
+
t === "ariaLive" && (this["aria-live"] = r), super.attributeChangedCallback(t, a, r);
|
|
45
|
+
}
|
|
46
|
+
updated(t) {
|
|
47
|
+
super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") && C(this, "pkt-hide", this._isClosed);
|
|
48
|
+
}
|
|
49
|
+
// Render
|
|
50
|
+
render() {
|
|
51
|
+
const t = {
|
|
52
|
+
"pkt-alert": !0,
|
|
53
|
+
"pkt-alert--compact": this.compact,
|
|
54
|
+
[`pkt-alert--${this.skin}`]: this.skin,
|
|
55
|
+
"pkt-hide": this._isClosed
|
|
56
|
+
};
|
|
57
|
+
return p`
|
|
58
|
+
<div class=${h(t)}>
|
|
59
|
+
<pkt-icon
|
|
60
|
+
class="pkt-alert__icon"
|
|
61
|
+
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
62
|
+
></pkt-icon>
|
|
63
|
+
|
|
64
|
+
${this.closeAlert ? p`
|
|
65
|
+
<div class="pkt-alert__close">
|
|
66
|
+
<button
|
|
67
|
+
type="button"
|
|
68
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
69
|
+
tabindex="0"
|
|
70
|
+
aria-label="close"
|
|
71
|
+
@click=${this.close}
|
|
72
|
+
>
|
|
73
|
+
<pkt-icon name="close" class="pkt-btn__icon" aria-hidden="true"></pkt-icon>
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
` : u}
|
|
77
|
+
${this.title ? p`<div class="pkt-alert__title">${this.title}</div>` : u}
|
|
78
|
+
|
|
79
|
+
<div class="pkt-alert__text" ${_(this.defaultSlot)}></div>
|
|
80
|
+
|
|
81
|
+
${this.date ? p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : u}
|
|
82
|
+
</div>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
i([
|
|
87
|
+
l({ type: Boolean, reflect: !1 })
|
|
88
|
+
], e.prototype, "compact", 2);
|
|
89
|
+
i([
|
|
90
|
+
l({ type: String, reflect: !0 })
|
|
91
|
+
], e.prototype, "title", 2);
|
|
92
|
+
i([
|
|
93
|
+
l({ type: String, reflect: !0 })
|
|
94
|
+
], e.prototype, "skin", 2);
|
|
95
|
+
i([
|
|
96
|
+
l({ type: String })
|
|
97
|
+
], e.prototype, "ariaLive", 2);
|
|
98
|
+
i([
|
|
99
|
+
l({ type: String, reflect: !0 })
|
|
100
|
+
], e.prototype, "aria-live", 2);
|
|
101
|
+
i([
|
|
102
|
+
l({ type: Boolean, reflect: !0 })
|
|
103
|
+
], e.prototype, "closeAlert", 2);
|
|
104
|
+
i([
|
|
105
|
+
l({ type: String, reflect: !0 })
|
|
106
|
+
], e.prototype, "date", 2);
|
|
107
|
+
i([
|
|
108
|
+
k()
|
|
109
|
+
], e.prototype, "_isClosed", 2);
|
|
110
|
+
e = i([
|
|
111
|
+
v("pkt-alert")
|
|
112
|
+
], e);
|
|
113
|
+
export {
|
|
114
|
+
e as P
|
|
115
|
+
};
|
package/dist/alert.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
declare global {
|
|
5
12
|
interface HTMLElementTagNameMap {
|
|
6
13
|
'pkt-icon': PktIcon;
|
|
@@ -8,6 +15,31 @@ declare global {
|
|
|
8
15
|
}
|
|
9
16
|
|
|
10
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
|
+
|
|
11
43
|
declare global {
|
|
12
44
|
interface Window {
|
|
13
45
|
pktTz: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as c, x as k, n as o, a as f } from "./element-
|
|
2
|
-
import { o as h } from "./if-defined-
|
|
1
|
+
import { P as c, x as k, n as o, a as f } from "./element-DiqKrDty.js";
|
|
2
|
+
import { o as h } from "./if-defined-DeANa4n5.js";
|
|
3
3
|
var b = Object.defineProperty, u = Object.getOwnPropertyDescriptor, s = (t, r, i, l) => {
|
|
4
4
|
for (var e = l > 1 ? void 0 : l ? u(r, i) : r, n = t.length - 1, p; n >= 0; n--)
|
|
5
5
|
(p = t[n]) && (e = (l ? p(r, i, e) : p(e)) || e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("./element-
|
|
1
|
+
"use strict";const i=require("./element-DJpGVXjq.cjs"),c=require("./if-defined-CoBDkDGb.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,r)=>{for(var e=r>1?void 0:r?o(t,a):t,l=k.length-1,s;l>=0;l--)(s=k[l])&&(e=(r?s(t,a,e):s(e))||e);return r&&e&&p(t,a,e),e};exports.PktBackLink=class extends i.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,r){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,r)}render(){return i.x`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
4
|
>
|
package/dist/backlink.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
declare global {
|
|
5
12
|
interface HTMLElementTagNameMap {
|
|
6
13
|
'pkt-icon': PktIcon;
|
|
@@ -8,6 +15,31 @@ declare global {
|
|
|
8
15
|
}
|
|
9
16
|
|
|
10
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
|
+
|
|
11
43
|
declare global {
|
|
12
44
|
interface Window {
|
|
13
45
|
pktTz: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as s, P as c,
|
|
2
|
-
import { P as b } from "./pkt-slot-controller-
|
|
3
|
-
import { e as f, n as k } from "./ref-
|
|
4
|
-
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor,
|
|
1
|
+
import { n as s, P as c, E as p, x as l, a as u } from "./element-DiqKrDty.js";
|
|
2
|
+
import { P as b } from "./pkt-slot-controller-BtVLTZb7.js";
|
|
3
|
+
import { e as f, n as k } from "./ref-B70YZNXm.js";
|
|
4
|
+
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, e = (t, n, r, o) => {
|
|
5
5
|
for (var a = o > 1 ? void 0 : o ? y(n, r) : n, d = t.length - 1, h; d >= 0; d--)
|
|
6
6
|
(h = t[d]) && (a = (o ? h(n, r, a) : h(a)) || a);
|
|
7
7
|
return o && a && m(n, r, a), a;
|
|
8
8
|
};
|
|
9
|
-
let
|
|
9
|
+
let i = class extends c {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(), this.internals = this.attachInternals(), this.defaultSlot = f(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new b(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
|
|
12
12
|
}
|
|
@@ -15,12 +15,12 @@ let e = class extends c {
|
|
|
15
15
|
super.disconnectedCallback(), this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeydown);
|
|
16
16
|
}
|
|
17
17
|
updated(t) {
|
|
18
|
-
super.updated(t), this.setAttribute("role", "button"), this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.
|
|
18
|
+
super.updated(t), this.setAttribute("role", "button"), this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.removeAttribute("aria-disabled")), this.isLoading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), this.updateElementClasses();
|
|
19
19
|
}
|
|
20
20
|
// Render
|
|
21
21
|
render() {
|
|
22
22
|
return l`
|
|
23
|
-
<div class="pkt-
|
|
23
|
+
<div class="pkt-contents">
|
|
24
24
|
${this.isLoading ? l`<pkt-icon
|
|
25
25
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
26
26
|
name="spinner-blue"
|
|
@@ -66,43 +66,43 @@ let e = class extends c {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
i.formAssociated = !0;
|
|
70
|
+
e([
|
|
71
71
|
s({ type: String })
|
|
72
|
-
],
|
|
73
|
-
|
|
72
|
+
], i.prototype, "iconName", 2);
|
|
73
|
+
e([
|
|
74
74
|
s({ type: String })
|
|
75
|
-
],
|
|
76
|
-
|
|
75
|
+
], i.prototype, "secondIconName", 2);
|
|
76
|
+
e([
|
|
77
77
|
s({ type: String })
|
|
78
|
-
],
|
|
79
|
-
|
|
78
|
+
], i.prototype, "mode", 2);
|
|
79
|
+
e([
|
|
80
80
|
s({ type: String })
|
|
81
|
-
],
|
|
82
|
-
|
|
81
|
+
], i.prototype, "size", 2);
|
|
82
|
+
e([
|
|
83
83
|
s({ type: String })
|
|
84
|
-
],
|
|
85
|
-
|
|
84
|
+
], i.prototype, "color", 2);
|
|
85
|
+
e([
|
|
86
86
|
s({ type: String })
|
|
87
|
-
],
|
|
88
|
-
|
|
87
|
+
], i.prototype, "skin", 2);
|
|
88
|
+
e([
|
|
89
89
|
s({ type: String })
|
|
90
|
-
],
|
|
91
|
-
|
|
90
|
+
], i.prototype, "variant", 2);
|
|
91
|
+
e([
|
|
92
92
|
s({ type: String, reflect: !0 })
|
|
93
|
-
],
|
|
94
|
-
|
|
93
|
+
], i.prototype, "state", 2);
|
|
94
|
+
e([
|
|
95
95
|
s({ type: String, reflect: !0 })
|
|
96
|
-
],
|
|
97
|
-
|
|
96
|
+
], i.prototype, "type", 2);
|
|
97
|
+
e([
|
|
98
98
|
s({ type: Boolean, reflect: !0 })
|
|
99
|
-
],
|
|
100
|
-
|
|
99
|
+
], i.prototype, "isLoading", 2);
|
|
100
|
+
e([
|
|
101
101
|
s({ type: Boolean, reflect: !0 })
|
|
102
|
-
],
|
|
103
|
-
|
|
102
|
+
], i.prototype, "disabled", 2);
|
|
103
|
+
i = e([
|
|
104
104
|
u("pkt-button")
|
|
105
|
-
],
|
|
105
|
+
], i);
|
|
106
106
|
export {
|
|
107
|
-
|
|
107
|
+
i as P
|
|
108
108
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
2
|
-
<div class="pkt-
|
|
1
|
+
"use strict";const e=require("./element-DJpGVXjq.cjs"),h=require("./pkt-slot-controller-plQxXRvV.cjs"),d=require("./ref-CLqTsViF.cjs");var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(r,t,s,o)=>{for(var n=o>1?void 0:o?u(t,s):t,a=r.length-1,l;a>=0;a--)(l=r[a])&&(n=(o?l(t,s,n):l(n))||n);return o&&n&&p(t,s,n),n};exports.PktButton=class extends e.PktElement{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(t){super.updated(t),this.setAttribute("role","button"),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return e.x`
|
|
2
|
+
<div class="pkt-contents">
|
|
3
3
|
${this.isLoading?e.x`<pkt-icon
|
|
4
4
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
5
5
|
name="spinner-blue"
|
package/dist/button.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
declare global {
|
|
5
12
|
interface HTMLElementTagNameMap {
|
|
6
13
|
'pkt-icon': PktIcon;
|
|
@@ -8,6 +15,31 @@ declare global {
|
|
|
8
15
|
}
|
|
9
16
|
|
|
10
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
|
+
|
|
11
43
|
declare global {
|
|
12
44
|
interface Window {
|
|
13
45
|
pktTz: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as ht } from "./class-map-
|
|
2
|
-
import { P as dt,
|
|
3
|
-
import { r as _ } from "./state-
|
|
4
|
-
import "./icon-
|
|
1
|
+
import { e as ht } from "./class-map-D4tSZX70.js";
|
|
2
|
+
import { P as dt, E as I, x as D, n as m, a as ft } from "./element-DiqKrDty.js";
|
|
3
|
+
import { r as _ } from "./state-CDwPbiQj.js";
|
|
4
|
+
import "./icon-BdY52BIt.js";
|
|
5
5
|
const at = 6048e5, mt = 864e5, gt = 36e5, X = Symbol.for("constructDateFrom");
|
|
6
6
|
function S(t, e) {
|
|
7
7
|
return typeof t == "function" ? t(e) : t && typeof t == "object" && X in t ? t[X](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
@@ -617,8 +617,6 @@ const O = {
|
|
|
617
617
|
return l(a, e.length);
|
|
618
618
|
}
|
|
619
619
|
}, E = {
|
|
620
|
-
am: "am",
|
|
621
|
-
pm: "pm",
|
|
622
620
|
midnight: "midnight",
|
|
623
621
|
noon: "noon",
|
|
624
622
|
morning: "morning",
|
|
@@ -1378,12 +1376,12 @@ function xe(t, e) {
|
|
|
1378
1376
|
}).format(e).slice(12);
|
|
1379
1377
|
}
|
|
1380
1378
|
window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz;
|
|
1381
|
-
const w = (t) => t.toISOString().split("T")[0],
|
|
1379
|
+
const w = (t) => t.toISOString().split("T")[0], He = (t) => {
|
|
1382
1380
|
if (!t)
|
|
1383
1381
|
return null;
|
|
1384
1382
|
const e = W(new T(t, window.pktTz), 12);
|
|
1385
1383
|
return isNaN(e.getTime()) ? null : e;
|
|
1386
|
-
},
|
|
1384
|
+
}, _e = (t, e) => {
|
|
1387
1385
|
const n = b(t);
|
|
1388
1386
|
return isNaN(n.getTime()) ? "" : ke(n, e);
|
|
1389
1387
|
}, b = (t = "") => W(t === "" || !t ? new T(/* @__PURE__ */ new Date(), window.pktTz) : new T(t, window.pktTz), 12), P = (t, e, n = 1) => W(new T(t, e, n, window.pktTz), 12), Te = (t) => new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: window.pktTz }).format(t), Oe = (t) => {
|
|
@@ -1398,97 +1396,35 @@ const w = (t) => t.toISOString().split("T")[0], Ie = (t) => {
|
|
|
1398
1396
|
csvToArray: Oe,
|
|
1399
1397
|
stringToDate: Pe,
|
|
1400
1398
|
stringsToDate: Ce
|
|
1401
|
-
}, $e =
|
|
1402
|
-
id: {
|
|
1403
|
-
type: "string",
|
|
1404
|
-
name: "ID",
|
|
1405
|
-
description: "Unique identifier for the calendar"
|
|
1406
|
-
},
|
|
1407
|
-
currentmonth: {
|
|
1408
|
-
type: "date",
|
|
1409
|
-
converter: "stringToDate",
|
|
1410
|
-
description: "The current month to display"
|
|
1411
|
-
},
|
|
1412
|
-
selected: {
|
|
1413
|
-
type: "array",
|
|
1414
|
-
converter: "csvToArray",
|
|
1415
|
-
reflect: !0,
|
|
1416
|
-
items: {
|
|
1417
|
-
type: "date"
|
|
1418
|
-
},
|
|
1419
|
-
description: "Array of selected dates"
|
|
1420
|
-
},
|
|
1421
|
-
excludeweekdays: {
|
|
1422
|
-
type: "array",
|
|
1423
|
-
converter: "csvToArray",
|
|
1424
|
-
items: {
|
|
1425
|
-
type: "string"
|
|
1426
|
-
},
|
|
1427
|
-
description: "Array of weekdays (1-7) to exclude"
|
|
1428
|
-
},
|
|
1429
|
-
excludedates: {
|
|
1430
|
-
type: "array",
|
|
1431
|
-
converter: "stringsToDate",
|
|
1432
|
-
items: {
|
|
1433
|
-
type: "date"
|
|
1434
|
-
},
|
|
1435
|
-
description: "Array of specific dates to exclude"
|
|
1436
|
-
},
|
|
1399
|
+
}, $e = {
|
|
1437
1400
|
earliest: {
|
|
1438
|
-
|
|
1439
|
-
converter: "stringToDate",
|
|
1440
|
-
default: null,
|
|
1441
|
-
description: "Earliest selectable date"
|
|
1401
|
+
default: null
|
|
1442
1402
|
},
|
|
1443
1403
|
latest: {
|
|
1444
|
-
|
|
1445
|
-
converter: "stringToDate",
|
|
1446
|
-
default: null,
|
|
1447
|
-
description: "Latest selectable date"
|
|
1404
|
+
default: null
|
|
1448
1405
|
},
|
|
1449
1406
|
weeknumbers: {
|
|
1450
|
-
|
|
1451
|
-
reflect: !0,
|
|
1452
|
-
default: !1,
|
|
1453
|
-
description: "Show week numbers in calendar"
|
|
1407
|
+
default: !1
|
|
1454
1408
|
},
|
|
1455
1409
|
withcontrols: {
|
|
1456
|
-
|
|
1457
|
-
reflect: !0,
|
|
1458
|
-
default: !1,
|
|
1459
|
-
description: "Show month and year navigation controls"
|
|
1410
|
+
default: !1
|
|
1460
1411
|
},
|
|
1461
1412
|
multiple: {
|
|
1462
|
-
|
|
1463
|
-
reflect: !0,
|
|
1464
|
-
default: !1,
|
|
1465
|
-
description: "Allow multiple date selection"
|
|
1413
|
+
default: !1
|
|
1466
1414
|
},
|
|
1467
1415
|
maxMultiple: {
|
|
1468
|
-
|
|
1469
|
-
default: 4,
|
|
1470
|
-
description: "Maximum number of dates that can be selected"
|
|
1416
|
+
default: 4
|
|
1471
1417
|
},
|
|
1472
1418
|
range: {
|
|
1473
|
-
|
|
1474
|
-
reflect: !0,
|
|
1475
|
-
default: !1,
|
|
1476
|
-
description: "Allow date range selection"
|
|
1477
|
-
}
|
|
1478
|
-
}, We = {
|
|
1479
|
-
"date-selected": {
|
|
1480
|
-
description: "Returns ISO formatted date string"
|
|
1419
|
+
default: !1
|
|
1481
1420
|
}
|
|
1482
1421
|
}, C = {
|
|
1483
|
-
|
|
1484
|
-
"css-class": "pkt-calendar",
|
|
1485
|
-
props: Ee,
|
|
1486
|
-
events: We
|
|
1422
|
+
props: $e
|
|
1487
1423
|
};
|
|
1488
|
-
var
|
|
1489
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
1424
|
+
var Ee = Object.defineProperty, We = Object.getOwnPropertyDescriptor, h = (t, e, n, r) => {
|
|
1425
|
+
for (var a = r > 1 ? void 0 : r ? We(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
1490
1426
|
(i = t[s]) && (a = (r ? i(e, n, a) : i(a)) || a);
|
|
1491
|
-
return r && a &&
|
|
1427
|
+
return r && a && Ee(e, n, a), a;
|
|
1492
1428
|
};
|
|
1493
1429
|
let u = class extends dt {
|
|
1494
1430
|
constructor() {
|
|
@@ -1963,9 +1899,9 @@ u = h([
|
|
|
1963
1899
|
export {
|
|
1964
1900
|
u as P,
|
|
1965
1901
|
w as a,
|
|
1966
|
-
|
|
1902
|
+
_e as b,
|
|
1967
1903
|
Oe as c,
|
|
1968
1904
|
R as d,
|
|
1969
|
-
|
|
1905
|
+
He as f,
|
|
1970
1906
|
b as n
|
|
1971
1907
|
};
|