@oslokommune/punkt-vue 12.6.0 → 12.6.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/CHANGELOG.md +18 -0
- package/dist/Alert-7VFPFaQg.cjs +27 -0
- package/dist/Alert-DdxFjCxA.js +194 -0
- package/dist/{Button-DTexYyWR.cjs → Button-CQynfljs.cjs} +1 -1
- package/dist/{Button-HjeYh5Kr.js → Button-Qaz15rMh.js} +1 -1
- package/dist/{Helptext-CzFnl9PC.js → Helptext-DCN6uZnI.js} +1 -1
- package/dist/{Helptext-qrHljck3.cjs → Helptext-DS9_DggH.cjs} +1 -1
- package/dist/Icon-4g0YWJ23.js +24 -0
- package/dist/Icon-Bk_nMwsS.cjs +1 -0
- package/dist/{InputWrapper-Cf9IXORl.cjs → InputWrapper-C5MQJP-W.cjs} +1 -1
- package/dist/{InputWrapper-DQyCKwZ5.js → InputWrapper-DDCr9wGD.js} +2 -2
- package/dist/Tag-Cfwkk3HN.js +206 -0
- package/dist/Tag-Cmdf1tvR.cjs +17 -0
- package/dist/class-map-DunDFQn7-CEvlmYwL.js +167 -0
- package/dist/class-map-DunDFQn7-DJuL1PJh.cjs +17 -0
- package/dist/{Icon-GlEtmPo3.js → index-CyqOyy_9-CvJge_KP.js} +112 -123
- package/dist/index-CyqOyy_9-DqacYP0U.cjs +43 -0
- package/dist/punkt-vue-accordion.cjs +1 -1
- package/dist/punkt-vue-accordion.js +1 -1
- package/dist/punkt-vue-alert.cjs +1 -1
- package/dist/punkt-vue-alert.js +1 -1
- package/dist/punkt-vue-backlink.cjs +1 -1
- package/dist/punkt-vue-backlink.js +1 -1
- package/dist/punkt-vue-breadcrumbs.cjs +1 -1
- package/dist/punkt-vue-breadcrumbs.js +1 -1
- package/dist/punkt-vue-button.cjs +1 -1
- package/dist/punkt-vue-button.js +1 -1
- package/dist/punkt-vue-footer.cjs +1 -1
- package/dist/punkt-vue-footer.js +1 -1
- package/dist/punkt-vue-footersimple.cjs +1 -1
- package/dist/punkt-vue-footersimple.js +1 -1
- package/dist/punkt-vue-header.cjs +1 -1
- package/dist/punkt-vue-header.js +2 -2
- package/dist/punkt-vue-helptext.cjs +1 -1
- package/dist/punkt-vue-helptext.js +1 -1
- package/dist/punkt-vue-icon.cjs +1 -1
- package/dist/punkt-vue-icon.js +1 -1
- package/dist/punkt-vue-index.cjs +1 -1
- package/dist/punkt-vue-index.js +6 -6
- package/dist/punkt-vue-inputwrapper.cjs +1 -1
- package/dist/punkt-vue-inputwrapper.js +1 -1
- package/dist/punkt-vue-linkcard.cjs +1 -1
- package/dist/punkt-vue-linkcard.js +1 -1
- package/dist/punkt-vue-loader.cjs +1 -1
- package/dist/punkt-vue-loader.js +1 -1
- package/dist/punkt-vue-messagebox.cjs +12 -1
- package/dist/punkt-vue-messagebox.js +122 -63
- package/dist/punkt-vue-searchinput.cjs +1 -1
- package/dist/punkt-vue-searchinput.js +2 -2
- package/dist/punkt-vue-select.cjs +1 -1
- package/dist/punkt-vue-select.js +4 -4
- package/dist/punkt-vue-tabs.cjs +1 -1
- package/dist/punkt-vue-tabs.js +2 -2
- package/dist/punkt-vue-tag.cjs +1 -1
- package/dist/punkt-vue-tag.js +1 -1
- package/dist/punkt-vue-textarea.cjs +1 -1
- package/dist/punkt-vue-textarea.js +4 -4
- package/dist/punkt-vue-textinput.cjs +1 -1
- package/dist/punkt-vue-textinput.js +3 -3
- package/package.json +3 -3
- package/src/components/alert/Alert.vue +4 -53
- package/src/components/messagebox/Messagebox.vue +4 -43
- package/src/components/tag/Tag.vue +12 -82
- package/dist/Alert-B279aShs.cjs +0 -1
- package/dist/Alert-trs3P4vL.js +0 -108
- package/dist/Icon-CRFNDFzs.cjs +0 -43
- package/dist/Tag-BXfw0rIo.js +0 -140
- package/dist/Tag-DWEVdX9_.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.6.1](https://github.com/oslokommune/punkt/compare/12.6.0...12.6.1) (2024-10-31)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
* Alert, Messagebox, Tag i Vue (#1991).
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [12.5.0](https://github.com/oslokommune/punkt/compare/12.4.3...12.5.0) (2024-10-23)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const t=require("./index-CyqOyy_9-DqacYP0U.cjs"),p=require("./class-map-DunDFQn7-DJuL1PJh.cjs"),k=require("vue"),u=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),f="pkt-alert",v=!0,m={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},h={title:{name:"Tittel",description:"Tittelen som vises øverst i på meldingen",type:"string"},skin:{name:"Utseende",description:"Hvordan type melding er dette?",type:["info","success","warning","error"],default:"info"},date:{name:"Sist oppdatert",description:"Dato som vises nederst i på meldingen",type:"string"},ariaLive:{name:"aria-live",description:"Hvordan skal skjermleseren lese opp meldingen?",type:["off","polite","assertive"],default:"polite"},compact:{name:"Kompakt",description:"Gjør meldingen mindre",type:"boolean",default:!1},closeAlert:{name:"Vis 'Lukk'-knapp",description:"Viser 'Lukk'-knappen",type:"boolean",default:!1}},y={default:{description:"Innholdet i meldingen"}},c={name:f,"css-class":"pkt-alert","dark-mode":!0,isElement:v,events:m,props:h,slots:y};var _=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(e,l,i,r)=>{for(var n=r>1?void 0:r?g(l,i):l,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(r?d(l,i,n):d(n))||n);return r&&n&&_(l,i,n),n};let s=class extends t.vt{constructor(){super(),this.defaultSlot=p.U(),this.compact=c.props.compact.default,this.title="",this.skin=c.props.skin.default,this.ariaLive=c.props.ariaLive.default,this.closeAlert=c.props.closeAlert.default,this.date=null,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 p.H(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return t.Zt`
|
|
2
|
+
<div class=${p.u(e)} aria-live=${this.ariaLive}>
|
|
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?t.Zt`
|
|
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
|
+
`:t.c}
|
|
21
|
+
${this.title?t.Zt`<div class="pkt-alert__title">${this.title}</div>`:t.c}
|
|
22
|
+
|
|
23
|
+
<div class="pkt-alert__text" ${p.z(this.defaultSlot)}></div>
|
|
24
|
+
|
|
25
|
+
${this.date?t.Zt`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:t.c}
|
|
26
|
+
</div>
|
|
27
|
+
`}};o([t.p({type:Boolean,reflect:!1})],s.prototype,"compact",2);o([t.p({type:String,reflect:!0})],s.prototype,"title",2);o([t.p({type:String,reflect:!0})],s.prototype,"skin",2);o([t.p({type:String,reflect:!0})],s.prototype,"ariaLive",2);o([t.p({type:Boolean,reflect:!0})],s.prototype,"closeAlert",2);o([t.p({type:String,reflect:!0})],s.prototype,"date",2);o([t.kt()],s.prototype,"_isClosed",2);s=o([t.r("pkt-alert")],s);const b={name:"PktAlert",props:{skin:{type:String,default:"info",validator(e){return["error","success","warning","info"].includes(e)}},closeAlert:{type:Boolean,default:!1},title:{type:String,default:""},date:{type:String,default:""},ariaLive:{type:String,default:"polite",validator(e){return["off","polite","assertive"].includes(e)}},compact:{type:Boolean,default:!1}}},S=["skin","closeAlert","title","date","ariaLive","compact"];function L(e,l,i,r,n,a){return k.openBlock(),k.createElementBlock("pkt-alert",{skin:i.skin,closeAlert:i.closeAlert,title:i.title,date:i.date,ariaLive:i.ariaLive,compact:i.compact},[k.renderSlot(e.$slots,"default")],8,S)}const A=u._export_sfc(b,[["render",L]]);exports.PktAlert=A;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { k as f, p as a, r as m, v as u, Z as p, c as k } from "./index-CyqOyy_9-CvJge_KP.js";
|
|
2
|
+
import { U as v, H as h, u as y, z as _ } from "./class-map-DunDFQn7-CEvlmYwL.js";
|
|
3
|
+
import { openBlock as g, createElementBlock as b, renderSlot as S } from "vue";
|
|
4
|
+
import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const $ = "pkt-alert", A = !0, C = {
|
|
6
|
+
onClose: {
|
|
7
|
+
description: "React: Klikk-event for 'Lukk'-knappen"
|
|
8
|
+
},
|
|
9
|
+
close: {
|
|
10
|
+
description: "Vue: Klikk-event for 'Lukk'-knappen"
|
|
11
|
+
}
|
|
12
|
+
}, w = {
|
|
13
|
+
title: {
|
|
14
|
+
name: "Tittel",
|
|
15
|
+
description: "Tittelen som vises øverst i på meldingen",
|
|
16
|
+
type: "string"
|
|
17
|
+
},
|
|
18
|
+
skin: {
|
|
19
|
+
name: "Utseende",
|
|
20
|
+
description: "Hvordan type melding er dette?",
|
|
21
|
+
type: [
|
|
22
|
+
"info",
|
|
23
|
+
"success",
|
|
24
|
+
"warning",
|
|
25
|
+
"error"
|
|
26
|
+
],
|
|
27
|
+
default: "info"
|
|
28
|
+
},
|
|
29
|
+
date: {
|
|
30
|
+
name: "Sist oppdatert",
|
|
31
|
+
description: "Dato som vises nederst i på meldingen",
|
|
32
|
+
type: "string"
|
|
33
|
+
},
|
|
34
|
+
ariaLive: {
|
|
35
|
+
name: "aria-live",
|
|
36
|
+
description: "Hvordan skal skjermleseren lese opp meldingen?",
|
|
37
|
+
type: [
|
|
38
|
+
"off",
|
|
39
|
+
"polite",
|
|
40
|
+
"assertive"
|
|
41
|
+
],
|
|
42
|
+
default: "polite"
|
|
43
|
+
},
|
|
44
|
+
compact: {
|
|
45
|
+
name: "Kompakt",
|
|
46
|
+
description: "Gjør meldingen mindre",
|
|
47
|
+
type: "boolean",
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
closeAlert: {
|
|
51
|
+
name: "Vis 'Lukk'-knapp",
|
|
52
|
+
description: "Viser 'Lukk'-knappen",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
default: !1
|
|
55
|
+
}
|
|
56
|
+
}, B = {
|
|
57
|
+
default: {
|
|
58
|
+
description: "Innholdet i meldingen"
|
|
59
|
+
}
|
|
60
|
+
}, c = {
|
|
61
|
+
name: $,
|
|
62
|
+
"css-class": "pkt-alert",
|
|
63
|
+
"dark-mode": !0,
|
|
64
|
+
isElement: A,
|
|
65
|
+
events: C,
|
|
66
|
+
props: w,
|
|
67
|
+
slots: B
|
|
68
|
+
};
|
|
69
|
+
var E = Object.defineProperty, P = Object.getOwnPropertyDescriptor, o = (t, l, e, n) => {
|
|
70
|
+
for (var s = n > 1 ? void 0 : n ? P(l, e) : l, r = t.length - 1, d; r >= 0; r--)
|
|
71
|
+
(d = t[r]) && (s = (n ? d(l, e, s) : d(s)) || s);
|
|
72
|
+
return n && s && E(l, e, s), s;
|
|
73
|
+
};
|
|
74
|
+
let i = class extends u {
|
|
75
|
+
constructor() {
|
|
76
|
+
super(), this.defaultSlot = v(), this.compact = c.props.compact.default, this.title = "", this.skin = c.props.skin.default, this.ariaLive = c.props.ariaLive.default, this.closeAlert = c.props.closeAlert.default, this.date = null, this._isClosed = !1, this.close = (t) => {
|
|
77
|
+
this._isClosed = !0, this.dispatchEvent(
|
|
78
|
+
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
79
|
+
), this.dispatchEvent(
|
|
80
|
+
new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
81
|
+
);
|
|
82
|
+
}, this.slotController = new h(this, this.defaultSlot), this._isClosed = !1;
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
const t = {
|
|
86
|
+
"pkt-alert": !0,
|
|
87
|
+
"pkt-alert--compact": this.compact,
|
|
88
|
+
[`pkt-alert--${this.skin}`]: this.skin,
|
|
89
|
+
"pkt-hide": this._isClosed
|
|
90
|
+
};
|
|
91
|
+
return p`
|
|
92
|
+
<div class=${y(t)} aria-live=${this.ariaLive}>
|
|
93
|
+
<pkt-icon
|
|
94
|
+
class="pkt-alert__icon"
|
|
95
|
+
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
96
|
+
></pkt-icon>
|
|
97
|
+
|
|
98
|
+
${this.closeAlert ? p`
|
|
99
|
+
<div class="pkt-alert__close">
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
103
|
+
tabindex="0"
|
|
104
|
+
aria-label="close"
|
|
105
|
+
@click=${this.close}
|
|
106
|
+
>
|
|
107
|
+
<pkt-icon name="close" class="pkt-btn__icon" aria-hidden="true"></pkt-icon>
|
|
108
|
+
</button>
|
|
109
|
+
</div>
|
|
110
|
+
` : k}
|
|
111
|
+
${this.title ? p`<div class="pkt-alert__title">${this.title}</div>` : k}
|
|
112
|
+
|
|
113
|
+
<div class="pkt-alert__text" ${_(this.defaultSlot)}></div>
|
|
114
|
+
|
|
115
|
+
${this.date ? p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : k}
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
o([
|
|
121
|
+
a({ type: Boolean, reflect: !1 })
|
|
122
|
+
], i.prototype, "compact", 2);
|
|
123
|
+
o([
|
|
124
|
+
a({ type: String, reflect: !0 })
|
|
125
|
+
], i.prototype, "title", 2);
|
|
126
|
+
o([
|
|
127
|
+
a({ type: String, reflect: !0 })
|
|
128
|
+
], i.prototype, "skin", 2);
|
|
129
|
+
o([
|
|
130
|
+
a({ type: String, reflect: !0 })
|
|
131
|
+
], i.prototype, "ariaLive", 2);
|
|
132
|
+
o([
|
|
133
|
+
a({ type: Boolean, reflect: !0 })
|
|
134
|
+
], i.prototype, "closeAlert", 2);
|
|
135
|
+
o([
|
|
136
|
+
a({ type: String, reflect: !0 })
|
|
137
|
+
], i.prototype, "date", 2);
|
|
138
|
+
o([
|
|
139
|
+
f()
|
|
140
|
+
], i.prototype, "_isClosed", 2);
|
|
141
|
+
i = o([
|
|
142
|
+
m("pkt-alert")
|
|
143
|
+
], i);
|
|
144
|
+
const x = {
|
|
145
|
+
name: "PktAlert",
|
|
146
|
+
props: {
|
|
147
|
+
skin: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: "info",
|
|
150
|
+
validator(t) {
|
|
151
|
+
return ["error", "success", "warning", "info"].includes(t);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
closeAlert: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
default: !1
|
|
157
|
+
},
|
|
158
|
+
title: {
|
|
159
|
+
type: String,
|
|
160
|
+
default: ""
|
|
161
|
+
},
|
|
162
|
+
date: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: ""
|
|
165
|
+
},
|
|
166
|
+
ariaLive: {
|
|
167
|
+
type: String,
|
|
168
|
+
default: "polite",
|
|
169
|
+
validator(t) {
|
|
170
|
+
return ["off", "polite", "assertive"].includes(t);
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
compact: {
|
|
174
|
+
type: Boolean,
|
|
175
|
+
default: !1
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, j = ["skin", "closeAlert", "title", "date", "ariaLive", "compact"];
|
|
179
|
+
function H(t, l, e, n, s, r) {
|
|
180
|
+
return g(), b("pkt-alert", {
|
|
181
|
+
skin: e.skin,
|
|
182
|
+
closeAlert: e.closeAlert,
|
|
183
|
+
title: e.title,
|
|
184
|
+
date: e.date,
|
|
185
|
+
ariaLive: e.ariaLive,
|
|
186
|
+
compact: e.compact
|
|
187
|
+
}, [
|
|
188
|
+
S(t.$slots, "default")
|
|
189
|
+
], 8, j);
|
|
190
|
+
}
|
|
191
|
+
const T = /* @__PURE__ */ L(x, [["render", H]]);
|
|
192
|
+
export {
|
|
193
|
+
T as P
|
|
194
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./Icon-
|
|
1
|
+
"use strict";const o=require("./Icon-Bk_nMwsS.cjs"),e=require("vue"),r=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),u={name:"PktButton",components:{PktIcon:o.PktIcon},props:{disabled:{type:Boolean,required:!1,default:!1},iconName:{type:String,required:!1,default:"user"},secondIconName:{type:String,required:!1,default:"user"},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},skin:{type:String,default:"primary",validator:t=>["primary","secondary","tertiary"].includes(t)},color:{type:String,validator:t=>["blue","blue-outline","green","green-outline","green-dark","green-dark-outline","beige-light","beige-dark-outline","yellow","yellow-outline","red","red-outline"].includes(t)},text:{type:String,required:!1,default:"Trykk her"},variant:{type:String,default:"label-only",validator:t=>["label-only","icon-left","icon-right","icon-only","icons-right-and-left"].includes(t)},state:{type:String,required:!1,validator:t=>["normal","focus","hover","active"].includes(t)},type:{type:String,default:"button",validator:t=>["button","submit","reset"].includes(t)},isLoading:{type:Boolean,default:!1}},computed:{classes(){return["pkt-btn",this.sizeClass,this.skinClass,this.variantClass,this.colorClass,this.isLoadingClass,this.stateClass]},sizeClass(){return this.size!=="medium"?`pkt-btn--${this.size}`:""},skinClass(){return this.skin!=="primary"?`pkt-btn--${this.skin}`:""},colorClass(){return this.color?`pkt-btn--${this.color}`:""},stateClass(){return this.state?`pkt-btn--${this.state}`:""},variantClass(){return this.variant!=="label-only"?`pkt-btn--${this.variant}`:""},isLoadingClass(){return this.isLoading===!0?"pkt-btn--active":""}}},c=["type","disabled"],d={class:"pkt-btn__text"};function k(t,s,n,p,y,a){const i=e.resolveComponent("PktIcon");return e.openBlock(),e.createElementBlock("button",e.mergeProps(t.$attrs,{type:n.type,class:a.classes,onClick:s[0]||(s[0]=l=>t.$emit("onClick")),onKeyup:s[1]||(s[1]=e.withKeys(l=>t.$emit("onClick"),["enter"])),disabled:n.disabled}),[n.isLoading===!0?(e.openBlock(),e.createBlock(i,{key:0,class:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.6/animations/"})):e.createCommentVNode("",!0),n.variant!=="label-only"?(e.openBlock(),e.createBlock(i,{key:1,class:"pkt-btn__icon",name:n.iconName},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("span",d,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)])]),n.variant==="icons-right-and-left"?(e.openBlock(),e.createBlock(i,{key:2,class:"pkt-btn__icon",name:n.secondIconName},null,8,["name"])):e.createCommentVNode("",!0)],16,c)}const m=r._export_sfc(u,[["render",k]]);exports.PktButton=m;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as d } from "./Icon-
|
|
1
|
+
import { P as d } from "./Icon-4g0YWJ23.js";
|
|
2
2
|
import { resolveComponent as u, openBlock as s, createElementBlock as c, mergeProps as m, withKeys as k, createBlock as a, createCommentVNode as l, createElementVNode as p, renderSlot as y, createTextVNode as b, toDisplayString as f } from "vue";
|
|
3
3
|
import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const h = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as a } from "./Button-
|
|
1
|
+
import { P as a } from "./Button-Qaz15rMh.js";
|
|
2
2
|
import { resolveComponent as d, openBlock as p, createElementBlock as o, createCommentVNode as l, createVNode as h, withCtx as c, createElementVNode as r, normalizeClass as u, renderSlot as x } from "vue";
|
|
3
3
|
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const m = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./Button-
|
|
1
|
+
"use strict";const l=require("./Button-CQynfljs.cjs"),e=require("vue"),i=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),s={name:"pktHelptext",components:{PktButton:l.PktButton},emits:["toggleHelpText"],props:{forId:{type:String,required:!0},helptext:{type:String,required:!1},helptextDropdown:{type:String,required:!1},helptextDropdownButton:{type:String,required:!1}},data(){return{isHelpTextOpen:!1}},methods:{toggleHelpText(){this.isHelpTextOpen=!this.isHelpTextOpen,this.$emit("toggleHelpText",this.isHelpTextOpen)}},computed:{hasDropDown(){return!!this.helptextDropdown&&this.helptextDropdown!==""},dropdownButton(){return this.helptextDropdownButton||'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}}},c=["id","innerHTML"],a={key:1,class:"pkt-inputwrapper__helptext-expandable"},d=["innerHTML"],u=["innerHTML"];function h(o,_,t,k,n,p){const r=e.resolveComponent("PktButton");return e.openBlock(),e.createElementBlock("div",null,[t.helptext?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pkt-inputwrapper__helptext",id:`${t.forId}-helptext`,innerHTML:t.helptext},null,8,c)):e.createCommentVNode("",!0),p.hasDropDown?(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(r,{skin:"tertiary",size:"small",variant:"icon-right","icon-name":n.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down",class:"pkt-link pkt-link--icon-right",onOnClick:p.toggleHelpText},{default:e.withCtx(()=>[e.createElementVNode("span",{innerHTML:p.dropdownButton},null,8,d)]),_:1},8,["icon-name","onOnClick"]),e.createElementVNode("div",{class:e.normalizeClass(["pkt-inputwrapper__helptext",{"pkt-inputwrapper__helptext-expandable-open":n.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!n.isHelpTextOpen}])},[e.createElementVNode("span",{innerHTML:t.helptextDropdown},null,8,u)],2),e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0)])}const x=i._export_sfc(s,[["render",h]]);exports.PktHelptext=x;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./index-CyqOyy_9-CvJge_KP.js";
|
|
2
|
+
import { openBlock as t, createElementBlock as n, mergeProps as o } from "vue";
|
|
3
|
+
import { _ as r } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const a = {
|
|
5
|
+
name: "PktIcon",
|
|
6
|
+
props: {
|
|
7
|
+
name: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: !0,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
path: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: void 0
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, c = ["name"];
|
|
18
|
+
function p(i, m, e, d, s, _) {
|
|
19
|
+
return t(), n("pkt-icon", o({ name: e.name }, e.path && { path: e.path }), null, 16, c);
|
|
20
|
+
}
|
|
21
|
+
const h = /* @__PURE__ */ r(a, [["render", p]]);
|
|
22
|
+
export {
|
|
23
|
+
h as P
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("./index-CyqOyy_9-DqacYP0U.cjs");const t=require("vue"),n=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),r={name:"PktIcon",props:{name:{type:String,required:!0,default:void 0},path:{type:String,default:void 0}}},c=["name"];function o(a,i,e,p,s,_){return t.openBlock(),t.createElementBlock("pkt-icon",t.mergeProps({name:e.name},e.path&&{path:e.path}),null,16,c)}const u=n._export_sfc(r,[["render",o]]);exports.PktIcon=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./Alert-
|
|
1
|
+
"use strict";const i=require("./Alert-7VFPFaQg.cjs"),o=require("./Helptext-DS9_DggH.cjs"),e=require("vue"),s=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),d={name:"pktInputwrapper",components:{PktAlert:i.PktAlert,PktHelptext:o.PktHelptext},props:{forId:{type:String,required:!0},label:{type:String,required:!0,default:"input"},helptext:{type:String,required:!1},helptextDropdown:{type:String,required:!1},helptextDropdownButton:{type:String,required:!1},counter:{type:Boolean,default:!1},counterCurrent:{type:Number,required:!1},counterMaxLength:{type:Number,required:!1},optionalTag:{type:Boolean,required:!1,default:!1},optionalText:{type:String,default:"Valgfritt"},requiredTag:{type:Boolean,required:!1,default:!1},requiredText:{type:String,default:"Må fylles ut"},hasError:{type:Boolean,required:!1},errorMessage:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},inline:{type:Boolean,required:!1,default:!1},ariaDescribedby:{type:String,required:!1},useWrapper:{type:Boolean,default:!0},hasFieldset:{type:Boolean,default:!1}},data(){return{isHelpTextOpen:!1}},methods:{toggleHelpText(){this.isHelpTextOpen=!this.isHelpTextOpen,this.$emit("toggleHelpText",this.isHelpTextOpen)}},computed:{tagText(){return this.optionalTag?this.optionalText:this.requiredTag?this.requiredText:""},tagClass(){return this.optionalTag?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":this.requiredTag?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":""},disabledClass(){return this.disabled?"pkt-inputwrapper--disabled":""},inlineClass(){return this.inline?"pkt-inputwrapper--inline":""},errorClass(){return this.hasError?"pkt-inputwrapper--error":""},hasDropDown(){return!!this.helptextDropdown&&this.helptextDropdown!==""},describedBy(){this.ariaDescribedby?this.ariaDescribedby:this.helptext&&`${this.forId}`}}},c=["for","aria-describedby"],u=["for","aria-describedby","id"],p={key:2,class:"pkt-input__counter","aria-live":"polite","aria-atomic":"true"},h={key:3},f=["innerHTML"];function k(l,y,t,x,m,r){const a=e.resolveComponent("PktHelptext"),n=e.resolveComponent("PktAlert");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pkt-inputwrapper",r.disabledClass,r.inlineClass,r.errorClass])},[t.useWrapper?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.hasFieldset?"fieldset":r.hasDropDown?"div":"label"),{key:0,for:t.hasFieldset?void 0:t.forId,class:e.normalizeClass(["pkt-inputwrapper__label",{"pkt-inputwrapper__fieldset":t.hasFieldset,"pkt-inputwrapper__legend":t.hasFieldset}]),"aria-describedby":r.hasDropDown?void 0:t.ariaDescribedby},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.hasFieldset?"legend":r.hasDropDown?"h2":"span"),{class:e.normalizeClass({"pkt-inputwrapper__legend":t.hasFieldset}),id:`${t.forId}-label`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1),r.tagText!==""?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(r.tagClass)},e.toDisplayString(r.tagText),3)):e.createCommentVNode("",!0)]),_:1},8,["class","id"])),e.createVNode(a,{forId:t.forId,onToggleHelpText:r.toggleHelpText,helptext:t.helptext,helptextDropdownButton:t.helptextDropdownButton,helptextDropdown:t.helptextDropdown},{default:e.withCtx(()=>[t.hasFieldset?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",{key:0,for:t.forId,class:"pkt-sr-only","aria-describedby":r.describedBy},e.toDisplayString(t.label),9,c))]),_:1},8,["forId","onToggleHelpText","helptext","helptextDropdownButton","helptextDropdown"]),e.renderSlot(l.$slots,"default")]),_:3},8,["for","class","aria-describedby"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.hasFieldset?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",{key:0,for:t.forId,class:"pkt-sr-only","aria-describedby":r.describedBy,id:`${t.forId}-label`},e.toDisplayString(t.label),9,u)),e.renderSlot(l.$slots,"default")],64)),t.counter?(e.openBlock(),e.createElementBlock("div",p,[e.createTextVNode(e.toDisplayString(t.counterCurrent||0),1),t.counterMaxLength?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(t.counterMaxLength),1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.hasError&&t.errorMessage?(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(n,{skin:"error","aria-live":"assertive",id:`${t.forId}-error`,compact:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"pkt-contents",innerHTML:t.errorMessage},null,8,f)]),_:1},8,["id"])])):e.createCommentVNode("",!0)],2)}const g=s._export_sfc(d,[["render",k]]);exports.PktInputWrapper=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as b } from "./Alert-
|
|
2
|
-
import { P as k } from "./Helptext-
|
|
1
|
+
import { P as b } from "./Alert-DdxFjCxA.js";
|
|
2
|
+
import { P as k } from "./Helptext-DCN6uZnI.js";
|
|
3
3
|
import { resolveComponent as u, openBlock as r, createElementBlock as a, normalizeClass as s, createBlock as p, resolveDynamicComponent as f, withCtx as d, createTextVNode as n, toDisplayString as l, createCommentVNode as i, createVNode as h, renderSlot as c, Fragment as g, createElementVNode as _ } from "vue";
|
|
4
4
|
import { _ as m } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const T = {
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { U as g, H as h, u, z as y } from "./class-map-DunDFQn7-CEvlmYwL.js";
|
|
2
|
+
import { k as m, p as o, r as f, v as k, Z as c } from "./index-CyqOyy_9-CvJge_KP.js";
|
|
3
|
+
import { openBlock as b, createElementBlock as S, renderSlot as x } from "vue";
|
|
4
|
+
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const $ = "pkt-tag", v = !0, T = {
|
|
6
|
+
closeTag: {
|
|
7
|
+
type: "boolean",
|
|
8
|
+
required: !1,
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
required: !1,
|
|
13
|
+
default: "medium",
|
|
14
|
+
type: [
|
|
15
|
+
"small",
|
|
16
|
+
"medium",
|
|
17
|
+
"large"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
iconName: {
|
|
21
|
+
type: "string",
|
|
22
|
+
required: !1
|
|
23
|
+
},
|
|
24
|
+
skin: {
|
|
25
|
+
required: !1,
|
|
26
|
+
default: "blue",
|
|
27
|
+
type: [
|
|
28
|
+
"blue",
|
|
29
|
+
"green",
|
|
30
|
+
"red",
|
|
31
|
+
"beige",
|
|
32
|
+
"yellow",
|
|
33
|
+
"gray",
|
|
34
|
+
"blue-light"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
textStyle: {
|
|
38
|
+
required: !1,
|
|
39
|
+
default: "normal-text",
|
|
40
|
+
type: [
|
|
41
|
+
"thin-text",
|
|
42
|
+
"normal-text"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
type: {
|
|
46
|
+
required: !1,
|
|
47
|
+
default: "button",
|
|
48
|
+
type: [
|
|
49
|
+
"button",
|
|
50
|
+
"submit",
|
|
51
|
+
"reset"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
ariaLabel: {
|
|
55
|
+
type: "string",
|
|
56
|
+
required: !1,
|
|
57
|
+
default: "close"
|
|
58
|
+
}
|
|
59
|
+
}, z = {
|
|
60
|
+
default: {
|
|
61
|
+
description: "Teksten til tag"
|
|
62
|
+
}
|
|
63
|
+
}, r = {
|
|
64
|
+
name: $,
|
|
65
|
+
"css-class": "pkt-tag",
|
|
66
|
+
isElement: v,
|
|
67
|
+
props: T,
|
|
68
|
+
slots: z
|
|
69
|
+
};
|
|
70
|
+
var N = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (t, l, e, n) => {
|
|
71
|
+
for (var a = n > 1 ? void 0 : n ? C(l, e) : l, p = t.length - 1, d; p >= 0; p--)
|
|
72
|
+
(d = t[p]) && (a = (n ? d(l, e, a) : d(a)) || a);
|
|
73
|
+
return n && a && N(l, e, a), a;
|
|
74
|
+
};
|
|
75
|
+
let s = class extends k {
|
|
76
|
+
constructor() {
|
|
77
|
+
super(), this.defaultSlot = g(), this.closeTag = r.props.closeTag.default, this.size = r.props.size.default, this.skin = r.props.skin.default, this.textStyle = r.props.textStyle.default, this.iconName = void 0, this.type = r.props.type.default, this.ariaLabel = r.props.ariaLabel.default, this._isClosed = !1, this.close = (t) => {
|
|
78
|
+
this._isClosed = !0, this.dispatchEvent(
|
|
79
|
+
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
80
|
+
), this.dispatchEvent(
|
|
81
|
+
new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
82
|
+
);
|
|
83
|
+
}, this.slotController = new h(this, this.defaultSlot), this._isClosed = !1;
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
const t = {
|
|
87
|
+
"pkt-tag": !0,
|
|
88
|
+
[`pkt-tag--${this.size}`]: !!this.size,
|
|
89
|
+
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
90
|
+
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
91
|
+
}, l = {
|
|
92
|
+
"pkt-tag": !0,
|
|
93
|
+
"pkt-btn": !0,
|
|
94
|
+
"pkt-btn--tertiary": !0,
|
|
95
|
+
[`pkt-tag--${this.size}`]: !!this.size,
|
|
96
|
+
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
97
|
+
[`pkt-tag--${this.textStyle}`]: !!this.textStyle,
|
|
98
|
+
"pkt-btn--icons-right-and-left": this.closeTag && !!this.iconName,
|
|
99
|
+
"pkt-hide": this._isClosed
|
|
100
|
+
};
|
|
101
|
+
return this.closeTag ? c`
|
|
102
|
+
<button
|
|
103
|
+
class=${u(l)}
|
|
104
|
+
type=${this.type}
|
|
105
|
+
aria-label=${this.ariaLabel}
|
|
106
|
+
@click=${this.close}
|
|
107
|
+
>
|
|
108
|
+
${this.iconName && c`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
109
|
+
<span ${y(this.defaultSlot)}></span>
|
|
110
|
+
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
111
|
+
</button>
|
|
112
|
+
` : c`
|
|
113
|
+
<span class=${u(t)}>
|
|
114
|
+
${this.iconName && c` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
|
|
115
|
+
<span ${y(this.defaultSlot)}></span>
|
|
116
|
+
</span>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
i([
|
|
121
|
+
o({ type: Boolean, reflect: !0 })
|
|
122
|
+
], s.prototype, "closeTag", 2);
|
|
123
|
+
i([
|
|
124
|
+
o({ type: String, reflect: !0 })
|
|
125
|
+
], s.prototype, "size", 2);
|
|
126
|
+
i([
|
|
127
|
+
o({ type: String, reflect: !0 })
|
|
128
|
+
], s.prototype, "skin", 2);
|
|
129
|
+
i([
|
|
130
|
+
o({ type: String, reflect: !0 })
|
|
131
|
+
], s.prototype, "textStyle", 2);
|
|
132
|
+
i([
|
|
133
|
+
o({ type: String, reflect: !0 })
|
|
134
|
+
], s.prototype, "iconName", 2);
|
|
135
|
+
i([
|
|
136
|
+
o({ type: String, reflect: !0 })
|
|
137
|
+
], s.prototype, "type", 2);
|
|
138
|
+
i([
|
|
139
|
+
o({ type: String, reflect: !0 })
|
|
140
|
+
], s.prototype, "ariaLabel", 2);
|
|
141
|
+
i([
|
|
142
|
+
m()
|
|
143
|
+
], s.prototype, "_isClosed", 2);
|
|
144
|
+
s = i([
|
|
145
|
+
f("pkt-tag")
|
|
146
|
+
], s);
|
|
147
|
+
const L = {
|
|
148
|
+
name: "PktTag",
|
|
149
|
+
props: {
|
|
150
|
+
skin: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: "blue",
|
|
153
|
+
validator(t) {
|
|
154
|
+
return ["blue", "green", "red", "beige", "yellow", "grey", "gray", "blue-light"].includes(t);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
textStyle: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "normal-text",
|
|
160
|
+
validator(t) {
|
|
161
|
+
return ["thin-text", "normal-text"].includes(t);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
size: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: "medium",
|
|
167
|
+
validator(t) {
|
|
168
|
+
return ["small", "medium", "large"].includes(t);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
closeTag: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: !1
|
|
174
|
+
},
|
|
175
|
+
iconName: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: ""
|
|
178
|
+
},
|
|
179
|
+
type: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: "button",
|
|
182
|
+
validator: (t) => ["button", "submit", "reset"].includes(t)
|
|
183
|
+
},
|
|
184
|
+
ariaLabel: {
|
|
185
|
+
type: String,
|
|
186
|
+
default: "close"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, q = ["skin", "textStyle", "size", "closeTag", "iconName", "type", "ariaLabel"];
|
|
190
|
+
function w(t, l, e, n, a, p) {
|
|
191
|
+
return b(), S("pkt-tag", {
|
|
192
|
+
skin: e.skin,
|
|
193
|
+
textStyle: e.textStyle,
|
|
194
|
+
size: e.size,
|
|
195
|
+
closeTag: e.closeTag,
|
|
196
|
+
iconName: e.iconName,
|
|
197
|
+
type: e.type,
|
|
198
|
+
ariaLabel: e.ariaLabel
|
|
199
|
+
}, [
|
|
200
|
+
x(t.$slots, "default")
|
|
201
|
+
], 8, q);
|
|
202
|
+
}
|
|
203
|
+
const j = /* @__PURE__ */ _(L, [["render", w]]);
|
|
204
|
+
export {
|
|
205
|
+
j as T
|
|
206
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";const r=require("./class-map-DunDFQn7-DJuL1PJh.cjs"),e=require("./index-CyqOyy_9-DqacYP0U.cjs"),d=require("vue"),y=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g="pkt-tag",h=!0,k={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",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:"close"}},b={default:{description:"Teksten til tag"}},o={name:g,"css-class":"pkt-tag",isElement:h,props:k,slots:b};var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,a=(t,n,s,p)=>{for(var l=p>1?void 0:p?m(n,s):n,c=t.length-1,u;c>=0;c--)(u=t[c])&&(l=(p?u(n,s,l):u(l))||l);return p&&l&&f(n,s,l),l};let i=class extends e.vt{constructor(){super(),this.defaultSlot=r.U(),this.closeTag=o.props.closeTag.default,this.size=o.props.size.default,this.skin=o.props.skin.default,this.textStyle=o.props.textStyle.default,this.iconName=void 0,this.type=o.props.type.default,this.ariaLabel=o.props.ariaLabel.default,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 r.H(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},n={"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?e.Zt`
|
|
2
|
+
<button
|
|
3
|
+
class=${r.u(n)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
aria-label=${this.ariaLabel}
|
|
6
|
+
@click=${this.close}
|
|
7
|
+
>
|
|
8
|
+
${this.iconName&&e.Zt`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
9
|
+
<span ${r.z(this.defaultSlot)}></span>
|
|
10
|
+
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
11
|
+
</button>
|
|
12
|
+
`:e.Zt`
|
|
13
|
+
<span class=${r.u(t)}>
|
|
14
|
+
${this.iconName&&e.Zt` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
|
|
15
|
+
<span ${r.z(this.defaultSlot)}></span>
|
|
16
|
+
</span>
|
|
17
|
+
`}};a([e.p({type:Boolean,reflect:!0})],i.prototype,"closeTag",2);a([e.p({type:String,reflect:!0})],i.prototype,"size",2);a([e.p({type:String,reflect:!0})],i.prototype,"skin",2);a([e.p({type:String,reflect:!0})],i.prototype,"textStyle",2);a([e.p({type:String,reflect:!0})],i.prototype,"iconName",2);a([e.p({type:String,reflect:!0})],i.prototype,"type",2);a([e.p({type:String,reflect:!0})],i.prototype,"ariaLabel",2);a([e.kt()],i.prototype,"_isClosed",2);i=a([e.r("pkt-tag")],i);const S={name:"PktTag",props:{skin:{type:String,default:"blue",validator(t){return["blue","green","red","beige","yellow","grey","gray","blue-light"].includes(t)}},textStyle:{type:String,default:"normal-text",validator(t){return["thin-text","normal-text"].includes(t)}},size:{type:String,default:"medium",validator(t){return["small","medium","large"].includes(t)}},closeTag:{type:Boolean,default:!1},iconName:{type:String,default:""},type:{type:String,default:"button",validator:t=>["button","submit","reset"].includes(t)},ariaLabel:{type:String,default:"close"}}},_=["skin","textStyle","size","closeTag","iconName","type","ariaLabel"];function x(t,n,s,p,l,c){return d.openBlock(),d.createElementBlock("pkt-tag",{skin:s.skin,textStyle:s.textStyle,size:s.size,closeTag:s.closeTag,iconName:s.iconName,type:s.type,ariaLabel:s.ariaLabel},[d.renderSlot(t.$slots,"default")],8,_)}const $=y._export_sfc(S,[["render",x]]);exports.Tag=$;
|