@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-tag.js
CHANGED
|
@@ -1,150 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { r as y, P as g, x as p, n as l } from "./index-CFDwiDTU.js";
|
|
4
|
-
import { e as m, P as k, n as f } from "./ref-CaiKp3S2.js";
|
|
5
|
-
import "./index-RwtTBIhT.js";
|
|
6
|
-
const b = "pkt-tag", S = !0, $ = {
|
|
7
|
-
closeTag: {
|
|
8
|
-
type: "boolean",
|
|
9
|
-
required: !1,
|
|
10
|
-
default: !1
|
|
11
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
required: !1,
|
|
14
|
-
default: "medium",
|
|
15
|
-
type: [
|
|
16
|
-
"small",
|
|
17
|
-
"medium",
|
|
18
|
-
"large"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
iconName: {
|
|
22
|
-
type: "icon",
|
|
23
|
-
required: !1
|
|
24
|
-
},
|
|
25
|
-
skin: {
|
|
26
|
-
required: !1,
|
|
27
|
-
default: "blue",
|
|
28
|
-
type: [
|
|
29
|
-
"blue",
|
|
30
|
-
"green",
|
|
31
|
-
"red",
|
|
32
|
-
"beige",
|
|
33
|
-
"yellow",
|
|
34
|
-
"gray",
|
|
35
|
-
"blue-light"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
textStyle: {
|
|
39
|
-
required: !1,
|
|
40
|
-
default: "normal-text",
|
|
41
|
-
type: [
|
|
42
|
-
"thin-text",
|
|
43
|
-
"normal-text"
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
type: {
|
|
47
|
-
required: !1,
|
|
48
|
-
default: "button",
|
|
49
|
-
type: [
|
|
50
|
-
"button",
|
|
51
|
-
"submit",
|
|
52
|
-
"reset"
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
ariaLabel: {
|
|
56
|
-
type: "string",
|
|
57
|
-
required: !1,
|
|
58
|
-
default: "Lukk"
|
|
59
|
-
}
|
|
60
|
-
}, _ = {
|
|
61
|
-
default: {
|
|
62
|
-
description: "Teksten til tag"
|
|
63
|
-
}
|
|
64
|
-
}, a = {
|
|
65
|
-
name: b,
|
|
66
|
-
"css-class": "pkt-tag",
|
|
67
|
-
isElement: S,
|
|
68
|
-
props: $,
|
|
69
|
-
slots: _
|
|
70
|
-
};
|
|
71
|
-
var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s, o, n, r) => {
|
|
72
|
-
for (var i = r > 1 ? void 0 : r ? C(o, n) : o, c = s.length - 1, u; c >= 0; c--)
|
|
73
|
-
(u = s[c]) && (i = (r ? u(o, n, i) : u(i)) || i);
|
|
74
|
-
return r && i && x(o, n, i), i;
|
|
75
|
-
};
|
|
76
|
-
let t = class extends g {
|
|
77
|
-
constructor() {
|
|
78
|
-
super(), this.defaultSlot = m(), this.closeTag = a.props.closeTag.default, this.size = a.props.size.default, this.skin = a.props.skin.default, this.textStyle = a.props.textStyle.default, this.iconName = void 0, this.type = a.props.type.default, this.ariaLabel = a.props.ariaLabel.default, this._isClosed = !1, this.close = (s) => {
|
|
79
|
-
this._isClosed = !0, this.dispatchEvent(
|
|
80
|
-
new CustomEvent("close", { detail: { origin: s }, bubbles: !0, composed: !0 })
|
|
81
|
-
), this.dispatchEvent(
|
|
82
|
-
new CustomEvent("on-close", { detail: { origin: s }, bubbles: !0, composed: !0 })
|
|
83
|
-
);
|
|
84
|
-
}, this.slotController = new k(this, this.defaultSlot), this._isClosed = !1;
|
|
85
|
-
}
|
|
86
|
-
render() {
|
|
87
|
-
const s = {
|
|
88
|
-
"pkt-tag": !0,
|
|
89
|
-
[`pkt-tag--${this.size}`]: !!this.size,
|
|
90
|
-
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
91
|
-
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
92
|
-
}, o = {
|
|
93
|
-
"pkt-tag": !0,
|
|
94
|
-
"pkt-btn": !0,
|
|
95
|
-
"pkt-btn--tertiary": !0,
|
|
96
|
-
[`pkt-tag--${this.size}`]: !!this.size,
|
|
97
|
-
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
98
|
-
[`pkt-tag--${this.textStyle}`]: !!this.textStyle,
|
|
99
|
-
"pkt-btn--icons-right-and-left": this.closeTag && !!this.iconName,
|
|
100
|
-
"pkt-hide": this._isClosed
|
|
101
|
-
};
|
|
102
|
-
return this.closeTag ? p`
|
|
103
|
-
<button
|
|
104
|
-
class=${h(o)}
|
|
105
|
-
type=${this.type}
|
|
106
|
-
aria-label=${this.ariaLabel}
|
|
107
|
-
@click=${this.close}
|
|
108
|
-
>
|
|
109
|
-
${this.iconName && p`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
110
|
-
<span ${f(this.defaultSlot)}></span>
|
|
111
|
-
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
112
|
-
</button>
|
|
113
|
-
` : p`
|
|
114
|
-
<span class=${h(s)}>
|
|
115
|
-
${this.iconName && p` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
|
|
116
|
-
<span ${f(this.defaultSlot)}></span>
|
|
117
|
-
</span>
|
|
118
|
-
`;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
e([
|
|
122
|
-
l({ type: Boolean, reflect: !0 })
|
|
123
|
-
], t.prototype, "closeTag", 2);
|
|
124
|
-
e([
|
|
125
|
-
l({ type: String, reflect: !0 })
|
|
126
|
-
], t.prototype, "size", 2);
|
|
127
|
-
e([
|
|
128
|
-
l({ type: String, reflect: !0 })
|
|
129
|
-
], t.prototype, "skin", 2);
|
|
130
|
-
e([
|
|
131
|
-
l({ type: String, reflect: !0 })
|
|
132
|
-
], t.prototype, "textStyle", 2);
|
|
133
|
-
e([
|
|
134
|
-
l({ type: String, reflect: !0 })
|
|
135
|
-
], t.prototype, "iconName", 2);
|
|
136
|
-
e([
|
|
137
|
-
l({ type: String, reflect: !0 })
|
|
138
|
-
], t.prototype, "type", 2);
|
|
139
|
-
e([
|
|
140
|
-
l({ type: String, reflect: !0 })
|
|
141
|
-
], t.prototype, "ariaLabel", 2);
|
|
142
|
-
e([
|
|
143
|
-
y()
|
|
144
|
-
], t.prototype, "_isClosed", 2);
|
|
145
|
-
t = e([
|
|
146
|
-
d("pkt-tag")
|
|
147
|
-
], t);
|
|
1
|
+
import { P as a } from "./tag-DGFgUF3l.js";
|
|
2
|
+
const o = a;
|
|
148
3
|
export {
|
|
149
|
-
|
|
4
|
+
a as PktTag,
|
|
5
|
+
o as default
|
|
150
6
|
};
|
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-BiUrhAlk.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
|
package/dist/pkt-textarea.js
CHANGED
package/dist/pkt-textinput.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-CHOR5PPp.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
|
package/dist/pkt-textinput.js
CHANGED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { o as h } from "./if-defined-ZFE4ti2t.js";
|
|
2
|
+
import { e as u } from "./class-map-hz16xq5a.js";
|
|
3
|
+
import { e as m, i as $, b as _, T as P, P as k, x as c, n as o, t as x } from "./icon-wUXeHiBk.js";
|
|
4
|
+
import { r as b } from "./state-BfyXV7EL.js";
|
|
5
|
+
import { e as d, n as w } from "./ref-DuFGTLVX.js";
|
|
6
|
+
import { u as B } from "./stringutils-DJjRa8dG.js";
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2018 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/
|
|
12
|
+
const f = "important", C = " !" + f, T = m(class extends $ {
|
|
13
|
+
constructor(e) {
|
|
14
|
+
var s;
|
|
15
|
+
if (super(e), e.type !== _.ATTRIBUTE || e.name !== "style" || ((s = e.strings) == null ? void 0 : s.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
16
|
+
}
|
|
17
|
+
render(e) {
|
|
18
|
+
return Object.keys(e).reduce((s, r) => {
|
|
19
|
+
const t = e[r];
|
|
20
|
+
return t == null ? s : s + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${t};`;
|
|
21
|
+
}, "");
|
|
22
|
+
}
|
|
23
|
+
update(e, [s]) {
|
|
24
|
+
const { style: r } = e.element;
|
|
25
|
+
if (this.ft === void 0) return this.ft = new Set(Object.keys(s)), this.render(s);
|
|
26
|
+
for (const t of this.ft) s[t] == null && (this.ft.delete(t), t.includes("-") ? r.removeProperty(t) : r[t] = null);
|
|
27
|
+
for (const t in s) {
|
|
28
|
+
const i = s[t];
|
|
29
|
+
if (i != null) {
|
|
30
|
+
this.ft.add(t);
|
|
31
|
+
const p = typeof i == "string" && i.endsWith(C);
|
|
32
|
+
t.includes("-") || p ? r.setProperty(t, p ? i.slice(0, -11) : i, p ? f : "") : r[t] = i;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return P;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var M = Object.defineProperty, S = Object.getOwnPropertyDescriptor, l = (e, s, r, t) => {
|
|
39
|
+
for (var i = t > 1 ? void 0 : t ? S(s, r) : s, p = e.length - 1, n; p >= 0; p--)
|
|
40
|
+
(n = e[p]) && (i = (t ? n(s, r, i) : n(i)) || i);
|
|
41
|
+
return t && i && M(s, r, i), i;
|
|
42
|
+
};
|
|
43
|
+
let a = class extends k {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments), this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.skin = "dark-blue", this.title = "", this.titlePosition = "left", this.statusType = "none", this.statusPlacement = "following", this.ariaLabel = "", this.ariaLabelledby = "", this.ariaValueText = "", this.role = "progressbar", this.labelWidth = 0, this.progressBarId = this.id, this.labelRef = d(), this.progressBarRef = d();
|
|
46
|
+
}
|
|
47
|
+
firstUpdated(e) {
|
|
48
|
+
super.firstUpdated(e), this.id ? this.progressBarId = this.id : this.progressBarId = B();
|
|
49
|
+
}
|
|
50
|
+
updated(e) {
|
|
51
|
+
super.updated(e), e.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), e.has("id") && this.id && (this.progressBarId = this.id);
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const e = this.valueMax - this.valueMin, s = this.valueCurrent / e * 100, r = this.valueMax !== 100 || this.valueMin !== 0 ? Math.round(s) : this.valueCurrent, t = `${this.valueCurrent} av ${this.valueMax}`, i = this.statusType !== "none", p = this.ariaLabelledby || this.progressBarId && `${this.progressBarId}-title`, n = u({
|
|
55
|
+
"pkt-progressbar__bar": !0,
|
|
56
|
+
[`pkt-progressbar__bar--${this.skin}`]: !!this.skin
|
|
57
|
+
}), g = u({
|
|
58
|
+
"pkt-progressbar__title": !0,
|
|
59
|
+
"pkt-progressbar__title-center": this.titlePosition === "center"
|
|
60
|
+
}), y = u({
|
|
61
|
+
"pkt-progressbar__status": !0,
|
|
62
|
+
"pkt-progressbar__status--center": this.statusPlacement === "center"
|
|
63
|
+
}), v = u({
|
|
64
|
+
"pkt-progressbar__status-placement--following": this.statusPlacement === "following",
|
|
65
|
+
"pkt-progressbar__status-placement--center": this.statusPlacement === "center",
|
|
66
|
+
"pkt-progressbar__status-placement--left": this.statusPlacement === "left"
|
|
67
|
+
});
|
|
68
|
+
return c` <div
|
|
69
|
+
id=${this.progressBarId}
|
|
70
|
+
class="pkt-progressbar__container"
|
|
71
|
+
.ref=${this.progressBarRef}
|
|
72
|
+
style=${T({
|
|
73
|
+
"--pkt-progress-label-width": `${this.labelWidth}px`,
|
|
74
|
+
"--pkt-progress-width": `${r}%`
|
|
75
|
+
})}
|
|
76
|
+
>
|
|
77
|
+
${this.title && c`<p id=${`${this.progressBarId}-title`} class=${g}>${this.title}</p>`}
|
|
78
|
+
|
|
79
|
+
<div
|
|
80
|
+
.id=${this.progressBarId}
|
|
81
|
+
role=${this.role}
|
|
82
|
+
class="pkt-progressbar__bar-wrapper"
|
|
83
|
+
aria-valuemin=${this.valueMin}
|
|
84
|
+
aria-valuemax=${this.valueMax}
|
|
85
|
+
aria-valuenow=${this.valueCurrent}
|
|
86
|
+
aria-labelledby=${h(p)}
|
|
87
|
+
aria-label=${h(this.ariaLabel)}
|
|
88
|
+
aria-valuetext=${h(this.ariaValueText)}
|
|
89
|
+
>
|
|
90
|
+
<div class=${n}></div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
${i && c`<div class=${y}>
|
|
94
|
+
<span class=${v} ${w(this.labelRef)}>
|
|
95
|
+
${this.statusType === "percentage" ? `${r}%` : t}
|
|
96
|
+
</span>
|
|
97
|
+
</div>`}
|
|
98
|
+
</div>`;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
l([
|
|
102
|
+
o({ type: Number, reflect: !0 })
|
|
103
|
+
], a.prototype, "valueCurrent", 2);
|
|
104
|
+
l([
|
|
105
|
+
o({ type: Number, reflect: !0 })
|
|
106
|
+
], a.prototype, "valueMax", 2);
|
|
107
|
+
l([
|
|
108
|
+
o({ type: Number, reflect: !0 })
|
|
109
|
+
], a.prototype, "valueMin", 2);
|
|
110
|
+
l([
|
|
111
|
+
o({ type: String, reflect: !0 })
|
|
112
|
+
], a.prototype, "skin", 2);
|
|
113
|
+
l([
|
|
114
|
+
o({ type: String, reflect: !0 })
|
|
115
|
+
], a.prototype, "title", 2);
|
|
116
|
+
l([
|
|
117
|
+
o({ type: String, reflect: !0 })
|
|
118
|
+
], a.prototype, "titlePosition", 2);
|
|
119
|
+
l([
|
|
120
|
+
o({ type: String, reflect: !0 })
|
|
121
|
+
], a.prototype, "statusType", 2);
|
|
122
|
+
l([
|
|
123
|
+
o({ type: String, reflect: !0 })
|
|
124
|
+
], a.prototype, "statusPlacement", 2);
|
|
125
|
+
l([
|
|
126
|
+
o({ type: String, reflect: !0 })
|
|
127
|
+
], a.prototype, "ariaLabel", 2);
|
|
128
|
+
l([
|
|
129
|
+
o({ type: String, reflect: !0 })
|
|
130
|
+
], a.prototype, "ariaLabelledby", 2);
|
|
131
|
+
l([
|
|
132
|
+
o({ type: String, reflect: !0 })
|
|
133
|
+
], a.prototype, "ariaValueText", 2);
|
|
134
|
+
l([
|
|
135
|
+
o({ type: String, reflect: !0 })
|
|
136
|
+
], a.prototype, "role", 2);
|
|
137
|
+
l([
|
|
138
|
+
b()
|
|
139
|
+
], a.prototype, "labelWidth", 2);
|
|
140
|
+
l([
|
|
141
|
+
b()
|
|
142
|
+
], a.prototype, "progressBarId", 2);
|
|
143
|
+
a = l([
|
|
144
|
+
x("pkt-progressbar")
|
|
145
|
+
], a);
|
|
146
|
+
const E = a;
|
|
147
|
+
export {
|
|
148
|
+
a as P,
|
|
149
|
+
E as a
|
|
150
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";const u=require("./if-defined-DEDlGbAc.cjs"),p=require("./class-map-Boa7BqCc.cjs"),r=require("./icon-CdMQ6zBT.cjs"),c=require("./state-SKYD8kRO.cjs"),h=require("./ref-DCOsLZQg.cjs"),y=require("./stringutils-CkVRq4jP.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const b="important",v=" !"+b,k=r.e(class extends r.i{constructor(l){var t;if(super(l),l.type!==r.t$1.ATTRIBUTE||l.name!=="style"||((t=l.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((t,s)=>{const e=l[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(l,[t]){const{style:s}=l.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)t[e]==null&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const a=t[e];if(a!=null){this.ft.add(e);const o=typeof a=="string"&&a.endsWith(v);e.includes("-")||o?s.setProperty(e,o?a.slice(0,-11):a,o?b:""):s[e]=a}}return r.T}});var $=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(l,t,s,e)=>{for(var a=e>1?void 0:e?_(t,s):t,o=l.length-1,n;o>=0;o--)(n=l[o])&&(a=(e?n(t,s,a):n(a))||a);return e&&a&&$(t,s,a),a};exports.PktProgressbar=class extends r.PktElement{constructor(){super(...arguments),this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.skin="dark-blue",this.title="",this.titlePosition="left",this.statusType="none",this.statusPlacement="following",this.ariaLabel="",this.ariaLabelledby="",this.ariaValueText="",this.role="progressbar",this.labelWidth=0,this.progressBarId=this.id,this.labelRef=h.e(),this.progressBarRef=h.e()}firstUpdated(t){super.firstUpdated(t),this.id?this.progressBarId=this.id:this.progressBarId=y.uuidish()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id)}render(){const t=this.valueMax-this.valueMin,s=this.valueCurrent/t*100,e=this.valueMax!==100||this.valueMin!==0?Math.round(s):this.valueCurrent,a=`${this.valueCurrent} av ${this.valueMax}`,o=this.statusType!=="none",n=this.ariaLabelledby||this.progressBarId&&`${this.progressBarId}-title`,g=p.e({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),d=p.e({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),P=p.e({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),f=p.e({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return r.x` <div
|
|
6
|
+
id=${this.progressBarId}
|
|
7
|
+
class="pkt-progressbar__container"
|
|
8
|
+
.ref=${this.progressBarRef}
|
|
9
|
+
style=${k({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${e}%`})}
|
|
10
|
+
>
|
|
11
|
+
${this.title&&r.x`<p id=${`${this.progressBarId}-title`} class=${d}>${this.title}</p>`}
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
.id=${this.progressBarId}
|
|
15
|
+
role=${this.role}
|
|
16
|
+
class="pkt-progressbar__bar-wrapper"
|
|
17
|
+
aria-valuemin=${this.valueMin}
|
|
18
|
+
aria-valuemax=${this.valueMax}
|
|
19
|
+
aria-valuenow=${this.valueCurrent}
|
|
20
|
+
aria-labelledby=${u.o(n)}
|
|
21
|
+
aria-label=${u.o(this.ariaLabel)}
|
|
22
|
+
aria-valuetext=${u.o(this.ariaValueText)}
|
|
23
|
+
>
|
|
24
|
+
<div class=${g}></div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
${o&&r.x`<div class=${P}>
|
|
28
|
+
<span class=${f} ${h.n(this.labelRef)}>
|
|
29
|
+
${this.statusType==="percentage"?`${e}%`:a}
|
|
30
|
+
</span>
|
|
31
|
+
</div>`}
|
|
32
|
+
</div>`}};i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueCurrent",2);i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMax",2);i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMin",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"skin",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"title",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"titlePosition",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusType",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusPlacement",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabel",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabelledby",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaValueText",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"role",2);i([c.r()],exports.PktProgressbar.prototype,"labelWidth",2);i([c.r()],exports.PktProgressbar.prototype,"progressBarId",2);exports.PktProgressbar=i([r.t("pkt-progressbar")],exports.PktProgressbar);const m=exports.PktProgressbar;exports.PktProgressbar$1=m;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";const c=require("./icon-CdMQ6zBT.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const{I:g}=c.Z,a=t=>t.strings===void 0,f=()=>document.createComment(""),p=(t,s,e)=>{var h;const i=t._$AA.parentNode,n=s===void 0?t._$AB:s._$AA;if(e===void 0){const $=i.insertBefore(f(),n),A=i.insertBefore(f(),n);e=new g($,A,t,t.options)}else{const $=e._$AB.nextSibling,A=e._$AM,d=A!==t;if(d){let o;(h=e._$AQ)==null||h.call(e,t),e._$AM=t,e._$AP!==void 0&&(o=t._$AU)!==A._$AU&&e._$AP(o)}if($!==n||d){let o=e._$AA;for(;o!==$;){const v=o.nextSibling;i.insertBefore(o,n),o=v}}}return e},Y=(t,s,e=t)=>(t._$AI(s,e),t),C={},M=(t,s=C)=>t._$AH=s,b=t=>t._$AH,m=t=>{var i;(i=t._$AP)==null||i.call(t,!1,!0);let s=t._$AA;const e=t._$AB.nextSibling;for(;s!==e;){const n=s.nextSibling;s.remove(),s=n}};/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const r=(t,s)=>{var i;const e=t._$AN;if(e===void 0)return!1;for(const n of e)(i=n._$AO)==null||i.call(n,s,!1),r(n,s);return!0},_=t=>{let s,e;do{if((s=t._$AM)===void 0)break;e=s._$AN,e.delete(t),t=s}while((e==null?void 0:e.size)===0)},u=t=>{for(let s;s=t._$AM;t=s){let e=s._$AN;if(e===void 0)s._$AN=e=new Set;else if(e.has(t))break;e.add(t),x(s)}};function N(t){this._$AN!==void 0?(_(this),this._$AM=t,u(this)):this._$AM=t}function w(t,s=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(s)if(Array.isArray(i))for(let h=e;h<i.length;h++)r(i[h],!1),_(i[h]);else i!=null&&(r(i,!1),_(i));else r(this,t)}const x=t=>{t.type==c.t$1.CHILD&&(t._$AP??(t._$AP=w),t._$AQ??(t._$AQ=N))};class B extends c.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(s,e,i){super._$AT(s,e,i),u(this),this.isConnected=s._$AU}_$AO(s,e=!0){var i,n;s!==this.isConnected&&(this.isConnected=s,s?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(r(this,s),_(this))}setValue(s){if(a(this._$Ct))this._$Ct._$AI(s,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=s,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2020 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const y=()=>new H;class H{}const l=new WeakMap,I=c.e(class extends B{render(t){return c.E}update(t,[s]){var i;const e=s!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=s,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),c.E}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const s=this.ht??globalThis;let e=l.get(s);e===void 0&&(e=new WeakMap,l.set(s,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,s;return typeof this.Y=="function"?(t=l.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(s=this.Y)==null?void 0:s.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.M=m;exports.e=y;exports.f=a;exports.m=M;exports.n=I;exports.p=b;exports.r=p;exports.v=Y;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Z as u, i as g, b as p, e as Y, E as d } from "./icon-wUXeHiBk.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2020 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
const { I: C } = u, b = (t) => t.strings === void 0, f = () => document.createComment(""), H = (t, s, e) => {
|
|
8
|
+
var h;
|
|
9
|
+
const i = t._$AA.parentNode, n = s === void 0 ? t._$AB : s._$AA;
|
|
10
|
+
if (e === void 0) {
|
|
11
|
+
const c = i.insertBefore(f(), n), $ = i.insertBefore(f(), n);
|
|
12
|
+
e = new C(c, $, t, t.options);
|
|
13
|
+
} else {
|
|
14
|
+
const c = e._$AB.nextSibling, $ = e._$AM, l = $ !== t;
|
|
15
|
+
if (l) {
|
|
16
|
+
let o;
|
|
17
|
+
(h = e._$AQ) == null || h.call(e, t), e._$AM = t, e._$AP !== void 0 && (o = t._$AU) !== $._$AU && e._$AP(o);
|
|
18
|
+
}
|
|
19
|
+
if (c !== n || l) {
|
|
20
|
+
let o = e._$AA;
|
|
21
|
+
for (; o !== c; ) {
|
|
22
|
+
const v = o.nextSibling;
|
|
23
|
+
i.insertBefore(o, n), o = v;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return e;
|
|
28
|
+
}, I = (t, s, e = t) => (t._$AI(s, e), t), m = {}, S = (t, s = m) => t._$AH = s, k = (t) => t._$AH, P = (t) => {
|
|
29
|
+
var i;
|
|
30
|
+
(i = t._$AP) == null || i.call(t, !1, !0);
|
|
31
|
+
let s = t._$AA;
|
|
32
|
+
const e = t._$AB.nextSibling;
|
|
33
|
+
for (; s !== e; ) {
|
|
34
|
+
const n = s.nextSibling;
|
|
35
|
+
s.remove(), s = n;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2017 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
+
*/
|
|
43
|
+
const r = (t, s) => {
|
|
44
|
+
var i;
|
|
45
|
+
const e = t._$AN;
|
|
46
|
+
if (e === void 0) return !1;
|
|
47
|
+
for (const n of e) (i = n._$AO) == null || i.call(n, s, !1), r(n, s);
|
|
48
|
+
return !0;
|
|
49
|
+
}, A = (t) => {
|
|
50
|
+
let s, e;
|
|
51
|
+
do {
|
|
52
|
+
if ((s = t._$AM) === void 0) break;
|
|
53
|
+
e = s._$AN, e.delete(t), t = s;
|
|
54
|
+
} while ((e == null ? void 0 : e.size) === 0);
|
|
55
|
+
}, a = (t) => {
|
|
56
|
+
for (let s; s = t._$AM; t = s) {
|
|
57
|
+
let e = s._$AN;
|
|
58
|
+
if (e === void 0) s._$AN = e = /* @__PURE__ */ new Set();
|
|
59
|
+
else if (e.has(t)) break;
|
|
60
|
+
e.add(t), x(s);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function M(t) {
|
|
64
|
+
this._$AN !== void 0 ? (A(this), this._$AM = t, a(this)) : this._$AM = t;
|
|
65
|
+
}
|
|
66
|
+
function N(t, s = !1, e = 0) {
|
|
67
|
+
const i = this._$AH, n = this._$AN;
|
|
68
|
+
if (n !== void 0 && n.size !== 0) if (s) if (Array.isArray(i)) for (let h = e; h < i.length; h++) r(i[h], !1), A(i[h]);
|
|
69
|
+
else i != null && (r(i, !1), A(i));
|
|
70
|
+
else r(this, t);
|
|
71
|
+
}
|
|
72
|
+
const x = (t) => {
|
|
73
|
+
t.type == p.CHILD && (t._$AP ?? (t._$AP = N), t._$AQ ?? (t._$AQ = M));
|
|
74
|
+
};
|
|
75
|
+
class w extends g {
|
|
76
|
+
constructor() {
|
|
77
|
+
super(...arguments), this._$AN = void 0;
|
|
78
|
+
}
|
|
79
|
+
_$AT(s, e, i) {
|
|
80
|
+
super._$AT(s, e, i), a(this), this.isConnected = s._$AU;
|
|
81
|
+
}
|
|
82
|
+
_$AO(s, e = !0) {
|
|
83
|
+
var i, n;
|
|
84
|
+
s !== this.isConnected && (this.isConnected = s, s ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), e && (r(this, s), A(this));
|
|
85
|
+
}
|
|
86
|
+
setValue(s) {
|
|
87
|
+
if (b(this._$Ct)) this._$Ct._$AI(s, this);
|
|
88
|
+
else {
|
|
89
|
+
const e = [...this._$Ct._$AH];
|
|
90
|
+
e[this._$Ci] = s, this._$Ct._$AI(e, this, 0);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
disconnected() {
|
|
94
|
+
}
|
|
95
|
+
reconnected() {
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2020 Google LLC
|
|
101
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
+
*/
|
|
103
|
+
const T = () => new B();
|
|
104
|
+
class B {
|
|
105
|
+
}
|
|
106
|
+
const _ = /* @__PURE__ */ new WeakMap(), U = Y(class extends w {
|
|
107
|
+
render(t) {
|
|
108
|
+
return d;
|
|
109
|
+
}
|
|
110
|
+
update(t, [s]) {
|
|
111
|
+
var i;
|
|
112
|
+
const e = s !== this.Y;
|
|
113
|
+
return e && this.Y !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.Y = s, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), d;
|
|
114
|
+
}
|
|
115
|
+
rt(t) {
|
|
116
|
+
if (this.isConnected || (t = void 0), typeof this.Y == "function") {
|
|
117
|
+
const s = this.ht ?? globalThis;
|
|
118
|
+
let e = _.get(s);
|
|
119
|
+
e === void 0 && (e = /* @__PURE__ */ new WeakMap(), _.set(s, e)), e.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), e.set(this.Y, t), t !== void 0 && this.Y.call(this.ht, t);
|
|
120
|
+
} else this.Y.value = t;
|
|
121
|
+
}
|
|
122
|
+
get lt() {
|
|
123
|
+
var t, s;
|
|
124
|
+
return typeof this.Y == "function" ? (t = _.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.Y) : (s = this.Y) == null ? void 0 : s.value;
|
|
125
|
+
}
|
|
126
|
+
disconnected() {
|
|
127
|
+
this.lt === this.ct && this.rt(void 0);
|
|
128
|
+
}
|
|
129
|
+
reconnected() {
|
|
130
|
+
this.rt(this.ct);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
P as M,
|
|
135
|
+
T as e,
|
|
136
|
+
b as f,
|
|
137
|
+
S as m,
|
|
138
|
+
U as n,
|
|
139
|
+
k as p,
|
|
140
|
+
H as r,
|
|
141
|
+
I as v
|
|
142
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),c=()=>{const s=i(),e=i();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};exports.uuidish=c;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const c = () => ("00000000000000000" + (Math.random() * 18446744073709552e3).toString(16)).slice(-16), t = () => {
|
|
2
|
+
const e = c(), s = c();
|
|
3
|
+
return e.slice(0, 8) + "-" + e.slice(8, 12) + "-4" + e.slice(13) + "-a" + s.slice(1, 4) + "-" + s.slice(4);
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
t as u
|
|
7
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";const u=require("./class-map-Boa7BqCc.cjs"),t=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),g=require("./pkt-slot-controller-Ckk_yV0j.cjs"),c=require("./ref-DCOsLZQg.cjs"),k="pkt-tag",d=!0,f={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"icon",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},y={default:{description:"Teksten til tag"}},a={name:k,"css-class":"pkt-tag",isElement:d,props:f,slots:y};var b=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(o,e,l,r)=>{for(var i=r>1?void 0:r?m(e,l):e,n=o.length-1,p;n>=0;n--)(p=o[n])&&(i=(r?p(e,l,i):p(i))||i);return r&&i&&b(e,l,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new g.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},l={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
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 ${c.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 ${c.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([h.r()],exports.PktTag.prototype,"_isClosed",2);exports.PktTag=s([t.t("pkt-tag")],exports.PktTag);
|