@oslokommune/punkt-elements 12.17.2 → 12.18.1
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-BbVWu2lm.cjs +27 -0
- package/dist/alert-Dh6A96vo.js +159 -0
- package/dist/{index-D2jSRMrn.js → calendar-BUqcNvfI.js} +41 -29
- package/dist/calendar-QSulz7im.cjs +108 -0
- package/dist/card-B0GPdG5M.cjs +23 -0
- package/dist/card-kWt0BA2a.js +170 -0
- package/dist/{class-map-a5HUzP83.cjs → class-map-Boa7BqCc.cjs} +2 -2
- package/dist/{class-map-CBvUV2N3.js → class-map-hz16xq5a.js} +9 -10
- package/dist/datepicker-BHepKxof.cjs +154 -0
- package/dist/datepicker-iNCYioZ9.js +659 -0
- package/dist/helptext--4FLdAWi.js +194 -0
- package/dist/helptext-iZEgxz2U.cjs +23 -0
- package/dist/icon-CdMQ6zBT.cjs +250 -0
- package/dist/{index-CFDwiDTU.js → icon-wUXeHiBk.js} +7371 -7559
- package/dist/if-defined-DEDlGbAc.cjs +5 -0
- package/dist/if-defined-ZFE4ti2t.js +10 -0
- package/dist/index.d.ts +96 -51
- package/dist/input-element-D1Vls6A5.js +184 -0
- package/dist/input-element-DPKoFVwJ.cjs +1 -0
- package/dist/{input-wrapper-6vTrKtsW.js → input-wrapper-BTQk3W8T.js} +10 -10
- package/dist/input-wrapper-D-PNRJB_.cjs +46 -0
- package/dist/link-BpqavGSD.cjs +8 -0
- package/dist/link-Bx9nVgZi.js +108 -0
- package/dist/{linkcard-BlWQ8jOv.js → linkcard-CUrbzjLK.js} +16 -17
- package/dist/linkcard-DSu3A4Yx.cjs +13 -0
- package/dist/messagebox-C1aWoQbu.cjs +12 -0
- package/dist/messagebox-LpiVQIoM.js +107 -0
- package/dist/{modal-DYTVJjYh.cjs → modal-Avai5eVz.cjs} +2 -2
- package/dist/{modal-3OZTPqee.js → modal-Co1YFmHi.js} +8 -8
- package/dist/pkt-alert.cjs +1 -27
- package/dist/pkt-alert.js +4 -157
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -7
- package/dist/pkt-card.cjs +1 -23
- package/dist/pkt-card.js +4 -168
- package/dist/pkt-datepicker.cjs +1 -154
- package/dist/pkt-datepicker.js +4 -657
- 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 +4 -4
- package/dist/pkt-index.cjs +29 -1
- package/dist/pkt-index.js +127 -30
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -8
- package/dist/pkt-link.js +4 -107
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -12
- package/dist/pkt-messagebox.js +4 -105
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -0
- package/dist/pkt-progressbar.js +6 -0
- package/dist/pkt-slot-controller-Ckk_yV0j.cjs +1 -0
- package/dist/pkt-slot-controller-RJvOnbF4.js +61 -0
- package/dist/pkt-tag.cjs +1 -17
- package/dist/pkt-tag.js +4 -148
- 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-BS_oawSB.js +150 -0
- package/dist/progressbar-CuXkbAhJ.cjs +32 -0
- package/dist/ref-DCOsLZQg.cjs +13 -0
- package/dist/ref-DuFGTLVX.js +142 -0
- package/dist/state-BfyXV7EL.js +12 -0
- package/dist/state-SKYD8kRO.cjs +5 -0
- package/dist/stringutils-CkVRq4jP.cjs +1 -0
- package/dist/stringutils-DJjRa8dG.js +7 -0
- package/dist/tag-CGy2mSLE.cjs +17 -0
- package/dist/tag-DGFgUF3l.js +150 -0
- package/dist/{textarea-BTpJjEhO.js → textarea-BAGWR1Hi.js} +29 -29
- package/dist/textarea-BiUrhAlk.cjs +48 -0
- package/dist/{textinput-BIhQEr8z.cjs → textinput-CHOR5PPp.cjs} +2 -2
- package/dist/{textinput-CVo5wG14.js → textinput-pJ3N8m6g.js} +23 -23
- package/package.json +2 -2
- package/src/components/alert/alert.ts +115 -0
- package/src/components/alert/index.ts +4 -113
- package/src/components/calendar/calendar.ts +711 -0
- package/src/components/calendar/index.ts +3 -711
- package/src/components/card/card.ts +78 -0
- package/src/components/card/index.ts +4 -77
- package/src/components/datepicker/datepicker.ts +619 -0
- package/src/components/datepicker/index.ts +3 -618
- package/src/components/helptext/helptext.ts +2 -2
- package/src/components/icon/icon.ts +99 -0
- package/src/components/icon/index.ts +3 -98
- package/src/components/index.ts +29 -15
- package/src/components/input-wrapper/input-wrapper.ts +2 -2
- package/src/components/link/index.ts +3 -56
- package/src/components/link/link.ts +57 -0
- package/src/components/linkcard/index.ts +1 -1
- package/src/components/linkcard/linkcard.ts +5 -6
- package/src/components/messagebox/index.ts +4 -69
- package/src/components/messagebox/messagebox.ts +69 -0
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.ts +5 -7
- package/src/components/progressbar/index.ts +12 -0
- package/src/components/progressbar/progressbar.ts +144 -0
- package/src/components/tag/index.ts +4 -109
- package/src/components/tag/tag.ts +118 -0
- package/src/components/textarea/textarea.ts +5 -4
- package/src/components/textinput/textinput.ts +3 -3
- package/dist/converters-DNCwIFwr.js +0 -17
- package/dist/converters-DhM11VlY.cjs +0 -1
- package/dist/custom-element-B-TlBwRu.cjs +0 -9
- package/dist/custom-element-CWfU4dcr.js +0 -38
- package/dist/element.d.ts +0 -8
- package/dist/helptext-DBolvFI4.js +0 -72
- package/dist/helptext-_fMLOOCL.cjs +0 -23
- package/dist/index-CR7t1zY9.cjs +0 -238
- package/dist/index-CmTjXoAb.cjs +0 -9
- package/dist/index-RwtTBIhT.js +0 -88
- package/dist/index-tvpcg-ad.cjs +0 -108
- package/dist/input-wrapper-DX41tnbj.cjs +0 -46
- package/dist/linkcard-Det6CJ5D.cjs +0 -13
- package/dist/pkt-component-template.cjs +0 -29
- package/dist/pkt-component-template.js +0 -99
- package/dist/pkt-element.cjs +0 -1
- package/dist/pkt-element.js +0 -5
- package/dist/ref-C2yPtMJA.cjs +0 -13
- package/dist/ref-CaiKp3S2.js +0 -202
- package/dist/textarea-B45ZZYpx.cjs +0 -48
- package/src/components/component-template/index.ts +0 -129
- package/src/components/element/index.ts +0 -353
- /package/dist/{component-template.d.ts → progressbar.d.ts} +0 -0
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alert-BbVWu2lm.cjs"),u=require("./calendar-QSulz7im.cjs"),d=require("./card-B0GPdG5M.cjs"),t=require("./icon-CdMQ6zBT.cjs"),k=require("./pkt-slot-controller-Ckk_yV0j.cjs"),i=require("./ref-DCOsLZQg.cjs"),P=require("./class-map-Boa7BqCc.cjs"),h=require("./datepicker-BHepKxof.cjs"),g=require("./helptext-iZEgxz2U.cjs"),b=require("./input-wrapper-D-PNRJB_.cjs"),m=require("./link-BpqavGSD.cjs"),f=require("./linkcard-DSu3A4Yx.cjs"),y=require("./messagebox-C1aWoQbu.cjs"),v=require("./modal-Avai5eVz.cjs"),x=require("./progressbar-CuXkbAhJ.cjs"),C=require("./tag-CGy2mSLE.cjs"),O=require("./textarea-BiUrhAlk.cjs"),j=require("./textinput-CHOR5PPp.cjs");var q=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(a,e,r,s)=>{for(var n=s>1?void 0:s?S(e,r):e,l=a.length-1,p;l>=0;l--)(p=a[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&q(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=i.e(),this.namedSlot=i.e(),this.slotController=new k.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
|
|
2
|
+
<div class="${P.e(e)}">
|
|
3
|
+
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
|
+
|
|
5
|
+
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
6
|
+
<div>${this.renderList(this.strings)}</div>
|
|
7
|
+
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
8
|
+
|
|
9
|
+
<h2 class="pkt-txt-22">Slot</h2>
|
|
10
|
+
<div ${i.n(this.defaultSlot)}>defaultSlotRef</div>
|
|
11
|
+
<h2 class="pkt-txt-22">Named slot</h2>
|
|
12
|
+
<select
|
|
13
|
+
name="named-slot"
|
|
14
|
+
${i.n(this.namedSlot)}
|
|
15
|
+
@change=${r=>alert(r.target.value)}
|
|
16
|
+
>
|
|
17
|
+
namedSlotRef
|
|
18
|
+
</select>
|
|
19
|
+
|
|
20
|
+
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
21
|
+
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
22
|
+
Si ${t.strings.example.hi}
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
`}renderList(e){return t.x`
|
|
26
|
+
<ul>
|
|
27
|
+
${e.map(r=>t.x`<li>${r}</li>`)}
|
|
28
|
+
</ul>
|
|
29
|
+
`}doStuff(e){return e.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};o([t.n({type:String})],exports.PktComponent.prototype,"string",2);o([t.n({converter:u.csvToArray})],exports.PktComponent.prototype,"strings",2);o([t.n({type:Boolean})],exports.PktComponent.prototype,"darkmode",2);o([t.n({type:Array})],exports.PktComponent.prototype,"_list",2);exports.PktComponent=o([t.t("pkt-component")],exports.PktComponent);Object.defineProperty(exports,"PktAlert",{enumerable:!0,get:()=>c.PktAlert});Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>u.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>d.PktCard});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>t.PktIcon});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>h.PktDatepicker});Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>g.PktHelptext});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>b.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>m.PktLink});Object.defineProperty(exports,"PktLinkCard",{enumerable:!0,get:()=>f.PktLinkCard});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>y.PktMessagebox});Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>v.PktModal});Object.defineProperty(exports,"PktProgressbar",{enumerable:!0,get:()=>x.PktProgressbar});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>C.PktTag});Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>O.PktTextarea});Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>j.PktTextinput});
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,32 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { P as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { P as
|
|
11
|
-
import {
|
|
12
|
-
import { P as
|
|
13
|
-
import {
|
|
14
|
-
import { P as W } from "./
|
|
15
|
-
import { P as
|
|
1
|
+
import { P as w } from "./alert-Dh6A96vo.js";
|
|
2
|
+
import { c as f } from "./calendar-BUqcNvfI.js";
|
|
3
|
+
import { P as O } from "./calendar-BUqcNvfI.js";
|
|
4
|
+
import { P as j } from "./card-kWt0BA2a.js";
|
|
5
|
+
import { P, x as h, s as c, n, t as k } from "./icon-wUXeHiBk.js";
|
|
6
|
+
import { a as D } from "./icon-wUXeHiBk.js";
|
|
7
|
+
import { P as x } from "./pkt-slot-controller-RJvOnbF4.js";
|
|
8
|
+
import { e as m, n as d } from "./ref-DuFGTLVX.js";
|
|
9
|
+
import { e as u } from "./class-map-hz16xq5a.js";
|
|
10
|
+
import { P as G } from "./datepicker-iNCYioZ9.js";
|
|
11
|
+
import { P as M } from "./helptext--4FLdAWi.js";
|
|
12
|
+
import { P as B } from "./input-wrapper-BTQk3W8T.js";
|
|
13
|
+
import { P as N } from "./link-Bx9nVgZi.js";
|
|
14
|
+
import { P as W } from "./linkcard-CUrbzjLK.js";
|
|
15
|
+
import { P as z } from "./messagebox-LpiVQIoM.js";
|
|
16
|
+
import { P as J } from "./modal-Co1YFmHi.js";
|
|
17
|
+
import { P as V } from "./progressbar-BS_oawSB.js";
|
|
18
|
+
import { P as Y } from "./tag-DGFgUF3l.js";
|
|
19
|
+
import { P as tt } from "./textarea-BAGWR1Hi.js";
|
|
20
|
+
import { P as rt } from "./textinput-pJ3N8m6g.js";
|
|
21
|
+
var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (t, e, i, a) => {
|
|
22
|
+
for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, l; p >= 0; p--)
|
|
23
|
+
(l = t[p]) && (r = (a ? l(e, i, r) : l(r)) || r);
|
|
24
|
+
return a && r && g(e, i, r), r;
|
|
25
|
+
};
|
|
26
|
+
let s = class extends P {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(), this.string = "", this.strings = [], this.darkmode = !1, this._list = [], this.defaultSlot = m(), this.namedSlot = m(), this.slotController = new x(this, this.defaultSlot, this.namedSlot);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Runs on mount, used to set up various values and whatever you need to run
|
|
32
|
+
*/
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
this.strings.length && this.strings.forEach((t) => {
|
|
35
|
+
this._list.push(t.toUpperCase());
|
|
36
|
+
}), super.connectedCallback();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Render functions
|
|
40
|
+
*/
|
|
41
|
+
render() {
|
|
42
|
+
const t = {
|
|
43
|
+
"pkt-component": !0,
|
|
44
|
+
"pkt-component--has-list": this.strings.length > 0,
|
|
45
|
+
"pkt-darkmode": this.darkmode
|
|
46
|
+
};
|
|
47
|
+
return h`
|
|
48
|
+
<div class="${u(t)}">
|
|
49
|
+
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
50
|
+
|
|
51
|
+
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
52
|
+
<div>${this.renderList(this.strings)}</div>
|
|
53
|
+
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
54
|
+
|
|
55
|
+
<h2 class="pkt-txt-22">Slot</h2>
|
|
56
|
+
<div ${d(this.defaultSlot)}>defaultSlotRef</div>
|
|
57
|
+
<h2 class="pkt-txt-22">Named slot</h2>
|
|
58
|
+
<select
|
|
59
|
+
name="named-slot"
|
|
60
|
+
${d(this.namedSlot)}
|
|
61
|
+
@change=${(e) => alert(e.target.value)}
|
|
62
|
+
>
|
|
63
|
+
namedSlotRef
|
|
64
|
+
</select>
|
|
65
|
+
|
|
66
|
+
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
67
|
+
<button type="button" @click=${() => this.handleGreeting()}>
|
|
68
|
+
Si ${c.example.hi}
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
renderList(t) {
|
|
74
|
+
return h`
|
|
75
|
+
<ul>
|
|
76
|
+
${t.map((e) => h`<li>${e}</li>`)}
|
|
77
|
+
</ul>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Add other functionality under here
|
|
82
|
+
*/
|
|
83
|
+
doStuff(t) {
|
|
84
|
+
return t.reverse();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Handlers for returning data from the component
|
|
88
|
+
*/
|
|
89
|
+
handleGreeting() {
|
|
90
|
+
this.dispatchEvent(
|
|
91
|
+
new CustomEvent("pkt-greeting", {
|
|
92
|
+
detail: "Hei på deg!"
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
o([
|
|
98
|
+
n({ type: String })
|
|
99
|
+
], s.prototype, "string", 2);
|
|
100
|
+
o([
|
|
101
|
+
n({ converter: f })
|
|
102
|
+
], s.prototype, "strings", 2);
|
|
103
|
+
o([
|
|
104
|
+
n({ type: Boolean })
|
|
105
|
+
], s.prototype, "darkmode", 2);
|
|
106
|
+
o([
|
|
107
|
+
n({ type: Array })
|
|
108
|
+
], s.prototype, "_list", 2);
|
|
109
|
+
s = o([
|
|
110
|
+
k("pkt-component")
|
|
111
|
+
], s);
|
|
16
112
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
113
|
+
w as PktAlert,
|
|
114
|
+
O as PktCalendar,
|
|
115
|
+
j as PktCard,
|
|
116
|
+
s as PktComponent,
|
|
117
|
+
G as PktDatepicker,
|
|
118
|
+
M as PktHelptext,
|
|
119
|
+
D as PktIcon,
|
|
120
|
+
B as PktInputWrapper,
|
|
121
|
+
N as PktLink,
|
|
122
|
+
W as PktLinkCard,
|
|
123
|
+
z as PktMessagebox,
|
|
124
|
+
J as PktModal,
|
|
125
|
+
V as PktProgressbar,
|
|
126
|
+
Y as PktTag,
|
|
127
|
+
tt as PktTextarea,
|
|
128
|
+
rt as PktTextinput
|
|
32
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./input-wrapper-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./input-wrapper-D-PNRJB_.cjs"),t=e.PktInputWrapper;Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>e.PktInputWrapper});exports.default=t;
|
package/dist/pkt-link.cjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
2
|
-
class=${k.e(n)}
|
|
3
|
-
href=${this.href}
|
|
4
|
-
@click=${this.handleClick}
|
|
5
|
-
.target=${this.target}
|
|
6
|
-
.rel=${this.external?"noopener noreferrer":e.E}
|
|
7
|
-
>${this.iconName?e.x`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${c.n(this.defaultSlot)}>Link</span></a
|
|
8
|
-
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);i([e.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=i([h.t("pkt-link")],exports.PktLink);
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./link-BpqavGSD.cjs"),t=e.PktLink;Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>e.PktLink});exports.default=t;
|
package/dist/pkt-link.js
CHANGED
|
@@ -1,109 +1,6 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
|
|
3
|
-
import { e as P } from "./class-map-CBvUV2N3.js";
|
|
4
|
-
import { t as y } from "./custom-element-CWfU4dcr.js";
|
|
5
|
-
import "./index-RwtTBIhT.js";
|
|
6
|
-
const g = "pkt-link", v = !0, _ = {
|
|
7
|
-
href: {
|
|
8
|
-
name: "URL",
|
|
9
|
-
description: "URL til lenken",
|
|
10
|
-
type: "string",
|
|
11
|
-
default: "#"
|
|
12
|
-
},
|
|
13
|
-
target: {
|
|
14
|
-
name: "Mål",
|
|
15
|
-
description: "Mål for lenken",
|
|
16
|
-
type: [
|
|
17
|
-
"_blank",
|
|
18
|
-
"_self",
|
|
19
|
-
"_parent",
|
|
20
|
-
"_top"
|
|
21
|
-
],
|
|
22
|
-
default: "_self"
|
|
23
|
-
},
|
|
24
|
-
iconName: {
|
|
25
|
-
name: "Ikon",
|
|
26
|
-
description: "Ikon som skal vises ved siden av lenketeksten",
|
|
27
|
-
type: "icon"
|
|
28
|
-
},
|
|
29
|
-
iconPosition: {
|
|
30
|
-
name: "Ikonposisjon",
|
|
31
|
-
description: "Posisjonen til ikonet i forhold til lenketeksten",
|
|
32
|
-
type: [
|
|
33
|
-
"left",
|
|
34
|
-
"right"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
external: {
|
|
38
|
-
name: "Ekstern lenke",
|
|
39
|
-
description: "Vis ikon for ekstern lenke",
|
|
40
|
-
type: "boolean",
|
|
41
|
-
default: !1
|
|
42
|
-
}
|
|
43
|
-
}, x = {
|
|
44
|
-
default: {
|
|
45
|
-
description: "Innholdet i lenken"
|
|
46
|
-
}
|
|
47
|
-
}, c = {
|
|
48
|
-
name: g,
|
|
49
|
-
"css-class": "pkt-link",
|
|
50
|
-
"dark-mode": !0,
|
|
51
|
-
isElement: v,
|
|
52
|
-
props: _,
|
|
53
|
-
slots: x
|
|
54
|
-
};
|
|
55
|
-
var $ = Object.defineProperty, N = Object.getOwnPropertyDescriptor, n = (o, s, l, r) => {
|
|
56
|
-
for (var t = r > 1 ? void 0 : r ? N(s, l) : s, p = o.length - 1, a; p >= 0; p--)
|
|
57
|
-
(a = o[p]) && (t = (r ? a(s, l, t) : a(t)) || t);
|
|
58
|
-
return r && t && $(s, l, t), t;
|
|
59
|
-
};
|
|
60
|
-
let e = class extends f {
|
|
61
|
-
constructor() {
|
|
62
|
-
super(), this.defaultSlot = m(), 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 d(this, this.defaultSlot);
|
|
63
|
-
}
|
|
64
|
-
render() {
|
|
65
|
-
const o = {
|
|
66
|
-
"pkt-link": !0,
|
|
67
|
-
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
68
|
-
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
69
|
-
"pkt-link--external": this.external
|
|
70
|
-
};
|
|
71
|
-
return k`<a
|
|
72
|
-
class=${P(o)}
|
|
73
|
-
href=${this.href}
|
|
74
|
-
@click=${this.handleClick}
|
|
75
|
-
.target=${this.target}
|
|
76
|
-
.rel=${this.external ? "noopener noreferrer" : h}
|
|
77
|
-
>${this.iconName ? k`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${u(this.defaultSlot)}>Link</span></a
|
|
78
|
-
>`;
|
|
79
|
-
}
|
|
80
|
-
handleClick() {
|
|
81
|
-
this.dispatchEvent(
|
|
82
|
-
new CustomEvent("click", {
|
|
83
|
-
detail: "pkt-link-clicked",
|
|
84
|
-
bubbles: !0
|
|
85
|
-
})
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
n([
|
|
90
|
-
i({ type: String, reflect: !0 })
|
|
91
|
-
], e.prototype, "href", 2);
|
|
92
|
-
n([
|
|
93
|
-
i({ type: String, reflect: !0 })
|
|
94
|
-
], e.prototype, "iconName", 2);
|
|
95
|
-
n([
|
|
96
|
-
i({ type: String, reflect: !0 })
|
|
97
|
-
], e.prototype, "iconPosition", 2);
|
|
98
|
-
n([
|
|
99
|
-
i({ type: Boolean, reflect: !0 })
|
|
100
|
-
], e.prototype, "external", 2);
|
|
101
|
-
n([
|
|
102
|
-
i({ type: String, reflect: !0 })
|
|
103
|
-
], e.prototype, "target", 2);
|
|
104
|
-
e = n([
|
|
105
|
-
y("pkt-link")
|
|
106
|
-
], e);
|
|
1
|
+
import { P as t } from "./link-Bx9nVgZi.js";
|
|
2
|
+
const a = t;
|
|
107
3
|
export {
|
|
108
|
-
|
|
4
|
+
t as PktLink,
|
|
5
|
+
a as default
|
|
109
6
|
};
|
package/dist/pkt-linkcard.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./linkcard-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./linkcard-DSu3A4Yx.cjs"),t=e.PktLinkCard;Object.defineProperty(exports,"PktLinkCard",{enumerable:!0,get:()=>e.PktLinkCard});exports.default=t;
|
package/dist/pkt-linkcard.js
CHANGED
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
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" ${c.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([e.r()],exports.PktMessagebox.prototype,"_isClosed",2);exports.PktMessagebox=o([k.t("pkt-messagebox")],exports.PktMessagebox);
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./messagebox-C1aWoQbu.cjs"),t=e.PktMessagebox;Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>e.PktMessagebox});exports.default=t;
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,107 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { e as f } from "./class-map-CBvUV2N3.js";
|
|
4
|
-
import { t as v } from "./custom-element-CWfU4dcr.js";
|
|
5
|
-
import "./index-RwtTBIhT.js";
|
|
6
|
-
const _ = "pkt-messagebox", x = !0, y = {
|
|
7
|
-
onClose: {
|
|
8
|
-
description: "React: Event som trigges når meldingsboksen lukkes"
|
|
9
|
-
},
|
|
10
|
-
"on-close": {
|
|
11
|
-
description: "Vue: Event som trigges når meldingsboksen lukkes"
|
|
12
|
-
}
|
|
13
|
-
}, C = {
|
|
14
|
-
title: {
|
|
15
|
-
name: "Tittel",
|
|
16
|
-
description: "Tittelen på meldingsboksen",
|
|
17
|
-
type: "string"
|
|
18
|
-
},
|
|
19
|
-
skin: {
|
|
20
|
-
name: "Utseende",
|
|
21
|
-
description: "Velg farge på meldingsboksen",
|
|
22
|
-
type: [
|
|
23
|
-
"beige",
|
|
24
|
-
"blue",
|
|
25
|
-
"red",
|
|
26
|
-
"green"
|
|
27
|
-
],
|
|
28
|
-
default: "beige"
|
|
29
|
-
},
|
|
30
|
-
compact: {
|
|
31
|
-
name: "Kompakt",
|
|
32
|
-
description: "Gjør meldingsboksen mindre",
|
|
33
|
-
type: "boolean",
|
|
34
|
-
default: !1
|
|
35
|
-
},
|
|
36
|
-
closable: {
|
|
37
|
-
name: "Kan lukkes",
|
|
38
|
-
description: "Viser lukkeknapp",
|
|
39
|
-
type: "boolean",
|
|
40
|
-
default: !1
|
|
41
|
-
}
|
|
42
|
-
}, E = {
|
|
43
|
-
default: {
|
|
44
|
-
description: "Innholdet i meldingsboksen"
|
|
45
|
-
}
|
|
46
|
-
}, m = {
|
|
47
|
-
name: _,
|
|
48
|
-
"css-class": "pkt-messagebox",
|
|
49
|
-
isElement: x,
|
|
50
|
-
events: y,
|
|
51
|
-
props: C,
|
|
52
|
-
slots: E
|
|
53
|
-
};
|
|
54
|
-
var P = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, o = (e, l, p, i) => {
|
|
55
|
-
for (var t = i > 1 ? void 0 : i ? $(l, p) : l, r = e.length - 1, a; r >= 0; r--)
|
|
56
|
-
(a = e[r]) && (t = (i ? a(l, p, t) : a(t)) || t);
|
|
57
|
-
return i && t && P(l, p, t), t;
|
|
58
|
-
};
|
|
59
|
-
let s = class extends k {
|
|
60
|
-
constructor() {
|
|
61
|
-
super(), this.defaultSlot = u(), this.closable = m.props.closable.default, this.compact = m.props.compact.default, this.title = "", this.skin = m.props.skin.default, this._isClosed = !1, this.close = (e) => {
|
|
62
|
-
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", { detail: { origin: e }, bubbles: !0 })), this.dispatchEvent(new CustomEvent("on-close", { detail: { origin: e }, bubbles: !0 }));
|
|
63
|
-
}, this.slotController = new g(this, this.defaultSlot), this._isClosed = !1;
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
const e = {
|
|
67
|
-
"pkt-messagebox": !0,
|
|
68
|
-
"pkt-messagebox--compact": this.compact,
|
|
69
|
-
[`pkt-messagebox--${this.skin}`]: this.skin,
|
|
70
|
-
"pkt-messagebox--closable": this.closable,
|
|
71
|
-
"pkt-hide": this._isClosed
|
|
72
|
-
};
|
|
73
|
-
return c`<div class=${f(e)}>
|
|
74
|
-
${this.closable ? c`<div class="pkt-messagebox__close">
|
|
75
|
-
<button
|
|
76
|
-
@click=${this.close}
|
|
77
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
78
|
-
>
|
|
79
|
-
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
80
|
-
</button>
|
|
81
|
-
</div>` : d}
|
|
82
|
-
${this.title ? c`<div class="pkt-messagebox__title">${this.title}</div>` : d}
|
|
83
|
-
<div class="pkt-messagebox__text" ${h(this.defaultSlot)}></div>
|
|
84
|
-
</div>`;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
o([
|
|
88
|
-
n({ type: Boolean, reflect: !0 })
|
|
89
|
-
], s.prototype, "closable", 2);
|
|
90
|
-
o([
|
|
91
|
-
n({ type: Boolean, reflect: !0 })
|
|
92
|
-
], s.prototype, "compact", 2);
|
|
93
|
-
o([
|
|
94
|
-
n({ type: String, reflect: !0 })
|
|
95
|
-
], s.prototype, "title", 2);
|
|
96
|
-
o([
|
|
97
|
-
n({ type: String, reflect: !0 })
|
|
98
|
-
], s.prototype, "skin", 2);
|
|
99
|
-
o([
|
|
100
|
-
b()
|
|
101
|
-
], s.prototype, "_isClosed", 2);
|
|
102
|
-
s = o([
|
|
103
|
-
v("pkt-messagebox")
|
|
104
|
-
], s);
|
|
1
|
+
import { P as s } from "./messagebox-LpiVQIoM.js";
|
|
2
|
+
const a = s;
|
|
105
3
|
export {
|
|
106
|
-
s as PktMessagebox
|
|
4
|
+
s as PktMessagebox,
|
|
5
|
+
a as default
|
|
107
6
|
};
|
package/dist/pkt-modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./modal-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./modal-Avai5eVz.cjs"),t=e.PktModal;Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>e.PktModal});exports.default=t;
|
package/dist/pkt-modal.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./progressbar-CuXkbAhJ.cjs");Object.defineProperty(exports,"PktProgressbar",{enumerable:!0,get:()=>e.PktProgressbar});exports.default=e.PktProgressbar$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";class h{constructor(t,...e){this.nodes=[],this.host=t,this.host.addController(this),this.slots=e,this.nodes=[],this.observer=new MutationObserver(o=>this.handleMutations(o))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0})}hostDisconnected(){this.observer.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(e=>{var o;if(e.nodeType===Node.TEXT_NODE&&((o=e.nodeValue)!=null&&o.trim())){const s=document==null?void 0:document.createElement("template");s.content.appendChild(e),this.nodes.push(s)}else this.isSlotElement(e)||this.nodes.push(e)})}updateSlots(){this.slots.forEach(t=>{if(!t.value)return;const e=t.value.getAttribute("name"),s=this.nodes.flatMap(i=>i.getAttribute&&i.getAttribute("slot")==e?this.nodeFromElement(i,t):[]).filter(i=>t.value&&!t.value.contains(i)&&!i.contains(t.value));s.length>0&&t.value.replaceChildren(...s)})}handleMutations(t){let e=!1;t.forEach(o=>{o.type==="childList"&&(o.addedNodes.forEach(s=>{var l;const i=s.nodeType===Node.ELEMENT_NODE&&!this.isSlotElement(s),n=s.nodeType===Node.TEXT_NODE&&((l=s.nodeValue)==null?void 0:l.trim());if(i)this.nodes.push(s),e=!0;else if(n){const d=document==null?void 0:document.createElement("template");d.content.appendChild(s),this.nodes.push(d),e=!0}}),o.removedNodes.forEach(s=>{this.nodes=this.nodes.filter(i=>i!==s),e=!0}))}),e&&this.updateSlots()}isSlotElement(t){return this.slots.some(e=>e.value===t)}nodeFromElement(t,e){var o;return t===((o=e.value)==null?void 0:o.parentNode)?[]:t instanceof HTMLTemplateElement?Array.from(t.content.childNodes):[t]}}exports.PktSlotController=h;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
class r {
|
|
2
|
+
constructor(t, ...e) {
|
|
3
|
+
this.nodes = [], this.host = t, this.host.addController(this), this.slots = e, this.nodes = [], this.observer = new MutationObserver((o) => this.handleMutations(o));
|
|
4
|
+
}
|
|
5
|
+
hostConnected() {
|
|
6
|
+
this.updateNodes(), this.observer.observe(this.host, { childList: !0 });
|
|
7
|
+
}
|
|
8
|
+
hostDisconnected() {
|
|
9
|
+
this.observer.disconnect();
|
|
10
|
+
}
|
|
11
|
+
hostUpdated() {
|
|
12
|
+
this.updateSlots();
|
|
13
|
+
}
|
|
14
|
+
updateNodes() {
|
|
15
|
+
this.nodes = [], Array.from(this.host.childNodes).forEach((e) => {
|
|
16
|
+
var o;
|
|
17
|
+
if (e.nodeType === Node.TEXT_NODE && ((o = e.nodeValue) != null && o.trim())) {
|
|
18
|
+
const s = document == null ? void 0 : document.createElement("template");
|
|
19
|
+
s.content.appendChild(e), this.nodes.push(s);
|
|
20
|
+
} else this.isSlotElement(e) || this.nodes.push(e);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
updateSlots() {
|
|
24
|
+
this.slots.forEach((t) => {
|
|
25
|
+
if (!t.value) return;
|
|
26
|
+
const e = t.value.getAttribute("name"), s = this.nodes.flatMap(
|
|
27
|
+
(i) => i.getAttribute && i.getAttribute("slot") == e ? this.nodeFromElement(i, t) : []
|
|
28
|
+
).filter(
|
|
29
|
+
(i) => t.value && !t.value.contains(i) && !i.contains(t.value)
|
|
30
|
+
);
|
|
31
|
+
s.length > 0 && t.value.replaceChildren(...s);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
handleMutations(t) {
|
|
35
|
+
let e = !1;
|
|
36
|
+
t.forEach((o) => {
|
|
37
|
+
o.type === "childList" && (o.addedNodes.forEach((s) => {
|
|
38
|
+
var d;
|
|
39
|
+
const i = s.nodeType === Node.ELEMENT_NODE && !this.isSlotElement(s), l = s.nodeType === Node.TEXT_NODE && ((d = s.nodeValue) == null ? void 0 : d.trim());
|
|
40
|
+
if (i)
|
|
41
|
+
this.nodes.push(s), e = !0;
|
|
42
|
+
else if (l) {
|
|
43
|
+
const n = document == null ? void 0 : document.createElement("template");
|
|
44
|
+
n.content.appendChild(s), this.nodes.push(n), e = !0;
|
|
45
|
+
}
|
|
46
|
+
}), o.removedNodes.forEach((s) => {
|
|
47
|
+
this.nodes = this.nodes.filter((i) => i !== s), e = !0;
|
|
48
|
+
}));
|
|
49
|
+
}), e && this.updateSlots();
|
|
50
|
+
}
|
|
51
|
+
isSlotElement(t) {
|
|
52
|
+
return this.slots.some((e) => e.value === t);
|
|
53
|
+
}
|
|
54
|
+
nodeFromElement(t, e) {
|
|
55
|
+
var o;
|
|
56
|
+
return t === ((o = e.value) == null ? void 0 : o.parentNode) ? [] : t instanceof HTMLTemplateElement ? Array.from(t.content.childNodes) : [t];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
r as P
|
|
61
|
+
};
|
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
2
|
-
<button
|
|
3
|
-
class=${u.e(l)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
aria-label=${this.ariaLabel}
|
|
6
|
-
@click=${this.close}
|
|
7
|
-
>
|
|
8
|
-
${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
9
|
-
<span ${o.n(this.defaultSlot)}></span>
|
|
10
|
-
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
11
|
-
</button>
|
|
12
|
-
`:t.x`
|
|
13
|
-
<span class=${u.e(e)}>
|
|
14
|
-
${this.iconName&&t.x` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
|
|
15
|
-
<span ${o.n(this.defaultSlot)}></span>
|
|
16
|
-
</span>
|
|
17
|
-
`}};s([t.n({type:Boolean,reflect:!0})],exports.PktTag.prototype,"closeTag",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"size",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"skin",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"textStyle",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"iconName",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"type",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"ariaLabel",2);s([t.r()],exports.PktTag.prototype,"_isClosed",2);exports.PktTag=s([g.t("pkt-tag")],exports.PktTag);
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tag-CGy2mSLE.cjs"),t=e.PktTag;Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>e.PktTag});exports.default=t;
|