@oslokommune/punkt-elements 14.1.1 → 14.3.0
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 +35 -0
- package/dist/booleanish-BKVonob4.cjs +1 -0
- package/dist/booleanish-C9R0tdXH.js +11 -0
- package/dist/{checkbox-BP5zOlPy.cjs → checkbox-C0TPnShf.cjs} +1 -1
- package/dist/{checkbox-CfXOh6Lw.js → checkbox-CnhA52o_.js} +1 -1
- package/dist/{combobox-BWsCkPH2.cjs → combobox-C1xwAju5.cjs} +1 -1
- package/dist/{combobox-BMznle0M.js → combobox-Dcp_fHcL.js} +2 -2
- package/dist/{datepicker-2s6FUxdi.js → datepicker-Bjb9GK1E.js} +2 -2
- package/dist/{datepicker-D1c9oP-2.cjs → datepicker-COIRRau0.cjs} +1 -1
- package/dist/index.d.ts +68 -180
- package/dist/{input-element-B0VPRK_E.js → input-element-B8M8Nppd.js} +77 -84
- package/dist/input-element-D697OAJo.cjs +1 -0
- package/dist/{input-wrapper-CAwzMR9o.js → input-wrapper-1PCXqtiu.js} +42 -49
- package/dist/{input-wrapper-DXg2N3wx.cjs → input-wrapper-CtBiAb04.cjs} +20 -20
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +14 -12
- package/dist/pkt-header.js +163 -155
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +8 -8
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-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/{radiobutton-BuKXgQm_.cjs → radiobutton-BkqaqO5E.cjs} +1 -1
- package/dist/{radiobutton-C_MzK8dE.js → radiobutton-Caq8-GhM.js} +1 -1
- package/dist/{select-Ds4Ws1_6.cjs → select-3dwlk22G.cjs} +1 -1
- package/dist/{select-CteaDnzz.js → select-_C-yztI0.js} +2 -2
- package/dist/{textarea-zeFp1hxO.cjs → textarea-DyUy8u7X.cjs} +1 -1
- package/dist/{textarea-D4T9yqw7.js → textarea-a6T4aJJU.js} +2 -2
- package/dist/{textinput-Cddq4eF_.js → textinput-DIuM70dd.js} +2 -2
- package/dist/{textinput-DFFL5v-U.cjs → textinput-IN3b0nSH.cjs} +1 -1
- package/package.json +2 -2
- package/src/components/accordion/accordion.ts +2 -1
- package/src/components/alert/alert.ts +2 -2
- package/src/components/button/button.ts +2 -3
- package/src/components/card/card.ts +2 -3
- package/src/components/header/header-service.ts +12 -8
- package/src/components/header/header.ts +8 -2
- package/src/components/header/index.ts +4 -1
- package/src/components/header/types.ts +33 -98
- package/src/components/heading/heading.ts +4 -3
- package/src/components/index.ts +4 -1
- package/src/components/input-wrapper/input-wrapper.ts +2 -16
- package/src/components/messagebox/messagebox.ts +2 -1
- package/src/components/progressbar/progressbar.ts +1 -1
- package/src/components/tag/tag.ts +2 -2
- package/dist/input-element-BmXkhljw.cjs +0 -1
package/dist/pkt-header.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { P as _, E as
|
|
1
|
+
import { P as _, E as u, x as n, n as s, a as M } from "./element-CRDRygXu.js";
|
|
2
2
|
import { P as S } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
3
3
|
import { o as $ } from "./if-defined-BWZGb3bh.js";
|
|
4
|
-
import { e as
|
|
4
|
+
import { e as v, n as k } from "./ref-Xa5dbh--.js";
|
|
5
|
+
import { b as d } from "./booleanish-C9R0tdXH.js";
|
|
5
6
|
import { r as f } from "./state-DS_kr2Fy.js";
|
|
6
|
-
import { e as
|
|
7
|
+
import { e as g } from "./class-map-wy7PUk0P.js";
|
|
7
8
|
import "./button-CjXih_Nx.js";
|
|
8
9
|
import "./icon-BB7e5iQN.js";
|
|
9
10
|
import "./link-BboUBUcg.js";
|
|
10
|
-
import "./textinput-
|
|
11
|
-
const
|
|
12
|
-
fromAttribute(e) {
|
|
13
|
-
return e == null ? !1 : e === "" || e === "true" || e === !0 ? !0 : e === "false" || e === !1 ? !1 : !!e;
|
|
14
|
-
},
|
|
15
|
-
toAttribute(e) {
|
|
16
|
-
return e ? "true" : "false";
|
|
17
|
-
}
|
|
18
|
-
}, C = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.iconName, href: e.target } : { title: e.title, iconName: e.iconName, onClick: e.target }, L = (e) => {
|
|
11
|
+
import "./textinput-DIuM70dd.js";
|
|
12
|
+
const C = (e) => typeof e.target == "string" ? { title: e.title, iconName: e.iconName, href: e.target } : { title: e.title, iconName: e.iconName, onClick: e.target }, L = (e) => C(e), w = (e) => {
|
|
19
13
|
if (!e) return;
|
|
20
14
|
const t = typeof e == "string" ? new Date(e) : e;
|
|
21
15
|
if (!isNaN(t.getTime()))
|
|
@@ -27,10 +21,10 @@ const d = {
|
|
|
27
21
|
minute: "2-digit"
|
|
28
22
|
});
|
|
29
23
|
};
|
|
30
|
-
var
|
|
31
|
-
for (var
|
|
32
|
-
(
|
|
33
|
-
return
|
|
24
|
+
var O = Object.defineProperty, R = Object.getOwnPropertyDescriptor, y = (e, t, i, c) => {
|
|
25
|
+
for (var a = c > 1 ? void 0 : c ? R(t, i) : t, p = e.length - 1, m; p >= 0; p--)
|
|
26
|
+
(m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
|
|
27
|
+
return c && a && O(t, i, a), a;
|
|
34
28
|
};
|
|
35
29
|
let b = class extends _ {
|
|
36
30
|
constructor() {
|
|
@@ -56,7 +50,7 @@ let b = class extends _ {
|
|
|
56
50
|
"onClick" in e && typeof e.onClick == "function" && e.onClick();
|
|
57
51
|
}
|
|
58
52
|
renderLinkOrButton(e, t) {
|
|
59
|
-
const i = "href" in e,
|
|
53
|
+
const i = "href" in e, c = g({
|
|
60
54
|
"pkt-user-menu__link": !0,
|
|
61
55
|
"pkt-link-button": !i,
|
|
62
56
|
"pkt-link": !i,
|
|
@@ -65,7 +59,7 @@ let b = class extends _ {
|
|
|
65
59
|
});
|
|
66
60
|
return i ? n`
|
|
67
61
|
<pkt-link
|
|
68
|
-
icon-name=${e.iconName ||
|
|
62
|
+
icon-name=${e.iconName || u}
|
|
69
63
|
href=${e.href}
|
|
70
64
|
aria-hidden="true"
|
|
71
65
|
class="pkt-user-menu__link ${t || ""}"
|
|
@@ -73,12 +67,12 @@ let b = class extends _ {
|
|
|
73
67
|
${e.title}
|
|
74
68
|
</pkt-link>
|
|
75
69
|
` : n`
|
|
76
|
-
<button class=${
|
|
70
|
+
<button class=${c} type="button" @click=${() => this.handleMenuItemClick(e)}>
|
|
77
71
|
${e.iconName ? n`<pkt-icon
|
|
78
72
|
name=${e.iconName}
|
|
79
73
|
class="pkt-link__icon"
|
|
80
74
|
aria-hidden="true"
|
|
81
|
-
></pkt-icon>` :
|
|
75
|
+
></pkt-icon>` : u}
|
|
82
76
|
${e.title}
|
|
83
77
|
</button>
|
|
84
78
|
`;
|
|
@@ -96,7 +90,7 @@ let b = class extends _ {
|
|
|
96
90
|
}
|
|
97
91
|
render() {
|
|
98
92
|
var t;
|
|
99
|
-
const e = (t = this.userMenu) == null ? void 0 : t.map(
|
|
93
|
+
const e = (t = this.userMenu) == null ? void 0 : t.map(L);
|
|
100
94
|
return n`
|
|
101
95
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
102
96
|
<ul class="pkt-user-menu__list">
|
|
@@ -109,14 +103,14 @@ let b = class extends _ {
|
|
|
109
103
|
<div class="pkt-user-menu__last-logged-in">
|
|
110
104
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
111
105
|
</div>
|
|
112
|
-
` :
|
|
106
|
+
` : u}
|
|
113
107
|
</li>
|
|
114
|
-
` :
|
|
108
|
+
` : u}
|
|
115
109
|
|
|
116
110
|
<!-- User menu items -->
|
|
117
111
|
${e && e.length > 0 ? n`
|
|
118
112
|
<li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
|
|
119
|
-
` :
|
|
113
|
+
` : u}
|
|
120
114
|
|
|
121
115
|
<!-- Representing section -->
|
|
122
116
|
${this.representing ? n`
|
|
@@ -125,7 +119,7 @@ let b = class extends _ {
|
|
|
125
119
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
126
120
|
${this.representing.orgNumber ? n`<div class="pkt-user-menu__org-number">
|
|
127
121
|
Org.nr. ${this.representing.orgNumber}
|
|
128
|
-
</div>` :
|
|
122
|
+
</div>` : u}
|
|
129
123
|
${this.canChangeRepresentation ? n`
|
|
130
124
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
131
125
|
<li class="pkt-user-menu__subitem">
|
|
@@ -136,9 +130,9 @@ let b = class extends _ {
|
|
|
136
130
|
})}
|
|
137
131
|
</li>
|
|
138
132
|
</ul>
|
|
139
|
-
` :
|
|
133
|
+
` : u}
|
|
140
134
|
</li>
|
|
141
|
-
` :
|
|
135
|
+
` : u}
|
|
142
136
|
|
|
143
137
|
<!-- Change representation without representing object -->
|
|
144
138
|
${!this.representing && this.canChangeRepresentation ? n`
|
|
@@ -153,7 +147,7 @@ let b = class extends _ {
|
|
|
153
147
|
</li>
|
|
154
148
|
</ul>
|
|
155
149
|
</li>
|
|
156
|
-
` :
|
|
150
|
+
` : u}
|
|
157
151
|
|
|
158
152
|
<!-- Logout -->
|
|
159
153
|
${this.logoutOnClick ? n`
|
|
@@ -164,7 +158,7 @@ let b = class extends _ {
|
|
|
164
158
|
onClick: () => this.handleLogout()
|
|
165
159
|
})}
|
|
166
160
|
</li>
|
|
167
|
-
` :
|
|
161
|
+
` : u}
|
|
168
162
|
</ul>
|
|
169
163
|
</nav>
|
|
170
164
|
`;
|
|
@@ -195,15 +189,15 @@ y([
|
|
|
195
189
|
b = y([
|
|
196
190
|
M("pkt-header-user-menu")
|
|
197
191
|
], b);
|
|
198
|
-
var
|
|
199
|
-
for (var
|
|
200
|
-
(
|
|
201
|
-
return
|
|
192
|
+
var B = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, t, i, c) => {
|
|
193
|
+
for (var a = c > 1 ? void 0 : c ? E(t, i) : t, p = e.length - 1, m; p >= 0; p--)
|
|
194
|
+
(m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
|
|
195
|
+
return c && a && B(t, i, a), a;
|
|
202
196
|
};
|
|
203
|
-
const
|
|
197
|
+
const P = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
204
198
|
let o = class extends _ {
|
|
205
199
|
constructor() {
|
|
206
|
-
super(), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.isMobile = !1, this.isTablet = !1, this.openMenu = "none", this.isHidden = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.hasSlotContent = !1, this.alignSlotRight = !1, this.alignSearchRight = !1, this.defaultSlot =
|
|
200
|
+
super(), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.isMobile = !1, this.isTablet = !1, this.openMenu = "none", this.isHidden = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.hasSlotContent = !1, this.alignSlotRight = !1, this.alignSearchRight = !1, this.defaultSlot = v(), this.headerRef = v(), this.userContainerRef = v(), this.slotContainerRef = v(), this.searchContainerRef = v(), this.slotContentRef = v(), this.searchMenuRef = v(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
|
|
207
201
|
if (!this.shouldHideOnScroll) return;
|
|
208
202
|
const e = window.pageYOffset || document.documentElement.scrollTop;
|
|
209
203
|
e < 0 || Math.abs(e - this.lastScrollPosition) < 60 || (this.isHidden = e > this.lastScrollPosition, this.lastScrollPosition = e);
|
|
@@ -212,22 +206,22 @@ let o = class extends _ {
|
|
|
212
206
|
this.user && this.openMenu === "user" && !t.closest(".pkt-header-service__user-container") && (this.openMenu = "none"), this.openMenu === "slot" && !t.closest(".pkt-header-service__slot-container") && (this.openMenu = "none"), this.openMenu === "search" && !t.closest(".pkt-header-service__search-container") && !t.closest(".pkt-header-service__search-input") && (this.openMenu = "none");
|
|
213
207
|
}, this.handleFocusOut = (e, t) => {
|
|
214
208
|
const i = e.relatedTarget;
|
|
215
|
-
let
|
|
209
|
+
let c;
|
|
216
210
|
switch (t) {
|
|
217
211
|
case "user":
|
|
218
|
-
|
|
212
|
+
c = this.userContainerRef;
|
|
219
213
|
break;
|
|
220
214
|
case "slot":
|
|
221
|
-
|
|
215
|
+
c = this.slotContainerRef;
|
|
222
216
|
break;
|
|
223
217
|
case "search":
|
|
224
|
-
|
|
218
|
+
c = this.searchContainerRef;
|
|
225
219
|
break;
|
|
226
220
|
default:
|
|
227
221
|
return;
|
|
228
222
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
223
|
+
const a = c.value;
|
|
224
|
+
a && (!i || !a.contains(i)) && (this.openMenu = "none");
|
|
231
225
|
}, this.handleEscapeKey = (e) => {
|
|
232
226
|
e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.shouldRestoreFocus = !0, this.openMenu = "none");
|
|
233
227
|
}, this.slotController = new S(this, this.defaultSlot);
|
|
@@ -289,7 +283,7 @@ let o = class extends _ {
|
|
|
289
283
|
checkDropdownAlignment(e) {
|
|
290
284
|
const t = e === "slot" ? this.slotContainerRef : this.searchContainerRef, i = e === "slot" ? this.slotContentRef : this.searchMenuRef;
|
|
291
285
|
if (!t.value || !i.value || !this.isTablet || this.isMobile) return;
|
|
292
|
-
const
|
|
286
|
+
const c = t.value.getBoundingClientRect(), a = i.value.offsetWidth, p = c.left + a > window.innerWidth;
|
|
293
287
|
e === "slot" ? this.alignSlotRight = p : this.alignSearchRight = p;
|
|
294
288
|
}
|
|
295
289
|
handleMenuToggle(e) {
|
|
@@ -348,7 +342,7 @@ let o = class extends _ {
|
|
|
348
342
|
}
|
|
349
343
|
get formattedLastLoggedIn() {
|
|
350
344
|
var e;
|
|
351
|
-
return
|
|
345
|
+
return w((e = this.user) == null ? void 0 : e.lastLoggedIn);
|
|
352
346
|
}
|
|
353
347
|
get isFixed() {
|
|
354
348
|
return this.position === "fixed";
|
|
@@ -363,9 +357,9 @@ let o = class extends _ {
|
|
|
363
357
|
return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
|
|
364
358
|
}
|
|
365
359
|
renderLogo() {
|
|
366
|
-
if (this.hideLogo) return
|
|
360
|
+
if (this.hideLogo) return u;
|
|
367
361
|
const e = n`
|
|
368
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
362
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${P}></pkt-icon>
|
|
369
363
|
`;
|
|
370
364
|
return this.logoLink && typeof this.logoLink == "string" ? n`
|
|
371
365
|
<span class="pkt-header-service__logo">
|
|
@@ -411,13 +405,13 @@ let o = class extends _ {
|
|
|
411
405
|
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
412
406
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
413
407
|
</span>
|
|
414
|
-
` :
|
|
408
|
+
` : u;
|
|
415
409
|
}
|
|
416
410
|
renderSlotContainer() {
|
|
417
|
-
const e =
|
|
411
|
+
const e = g({
|
|
418
412
|
"pkt-header-service__slot-container": !0,
|
|
419
413
|
"is-open": this.openMenu === "slot"
|
|
420
|
-
}), t =
|
|
414
|
+
}), t = g({
|
|
421
415
|
"pkt-header-service__slot-content": !0,
|
|
422
416
|
"align-right": this.alignSlotRight
|
|
423
417
|
});
|
|
@@ -425,12 +419,12 @@ let o = class extends _ {
|
|
|
425
419
|
<div
|
|
426
420
|
class=${e}
|
|
427
421
|
@focusout=${(i) => this.handleFocusOut(i, "slot")}
|
|
428
|
-
${
|
|
422
|
+
${k(this.slotContainerRef)}
|
|
429
423
|
>
|
|
430
424
|
${this.isTablet && this.hasSlotContent ? n`
|
|
431
425
|
<pkt-button
|
|
432
426
|
skin="secondary"
|
|
433
|
-
variant
|
|
427
|
+
variant=${this.slotMenuVariant}
|
|
434
428
|
iconName="menu"
|
|
435
429
|
size=${this.isMobile ? "small" : "medium"}
|
|
436
430
|
state=${this.openMenu === "slot" ? "active" : "normal"}
|
|
@@ -439,27 +433,27 @@ let o = class extends _ {
|
|
|
439
433
|
aria-controls="mobile-slot-menu"
|
|
440
434
|
aria-label="Åpne meny"
|
|
441
435
|
>
|
|
442
|
-
|
|
436
|
+
${this.slotMenuText}
|
|
443
437
|
</pkt-button>
|
|
444
|
-
` :
|
|
438
|
+
` : u}
|
|
445
439
|
<div
|
|
446
440
|
class=${t}
|
|
447
441
|
id="mobile-slot-menu"
|
|
448
|
-
role=${this.isTablet ? "menu" :
|
|
449
|
-
aria-label=${this.isTablet ? "Meny" :
|
|
450
|
-
${
|
|
451
|
-
${
|
|
442
|
+
role=${this.isTablet ? "menu" : u}
|
|
443
|
+
aria-label=${this.isTablet ? "Meny" : u}
|
|
444
|
+
${k(this.slotContentRef)}
|
|
445
|
+
${k(this.defaultSlot)}
|
|
452
446
|
></div>
|
|
453
447
|
</div>
|
|
454
448
|
`;
|
|
455
449
|
}
|
|
456
450
|
renderSearch() {
|
|
457
|
-
if (!this.showSearch) return
|
|
451
|
+
if (!this.showSearch) return u;
|
|
458
452
|
if (this.isTablet) {
|
|
459
|
-
const e =
|
|
453
|
+
const e = g({
|
|
460
454
|
"pkt-header-service__search-container": !0,
|
|
461
455
|
"is-open": this.openMenu === "search"
|
|
462
|
-
}), t =
|
|
456
|
+
}), t = g({
|
|
463
457
|
"pkt-header-service__mobile-menu": !0,
|
|
464
458
|
"is-open": this.openMenu === "search",
|
|
465
459
|
"align-right": this.alignSearchRight
|
|
@@ -468,7 +462,7 @@ let o = class extends _ {
|
|
|
468
462
|
<div
|
|
469
463
|
class=${e}
|
|
470
464
|
@focusout=${(i) => this.handleFocusOut(i, "search")}
|
|
471
|
-
${
|
|
465
|
+
${k(this.searchContainerRef)}
|
|
472
466
|
>
|
|
473
467
|
<pkt-button
|
|
474
468
|
skin="secondary"
|
|
@@ -483,7 +477,7 @@ let o = class extends _ {
|
|
|
483
477
|
>
|
|
484
478
|
Søk
|
|
485
479
|
</pkt-button>
|
|
486
|
-
<div class=${t} ${
|
|
480
|
+
<div class=${t} ${k(this.searchMenuRef)}>
|
|
487
481
|
${this.openMenu === "search" ? n`
|
|
488
482
|
<pkt-textinput
|
|
489
483
|
id="mobile-search-menu"
|
|
@@ -500,7 +494,7 @@ let o = class extends _ {
|
|
|
500
494
|
i.key === "Enter" && this.handleSearch(i.target.value);
|
|
501
495
|
}}
|
|
502
496
|
></pkt-textinput>
|
|
503
|
-
` :
|
|
497
|
+
` : u}
|
|
504
498
|
</div>
|
|
505
499
|
</div>
|
|
506
500
|
`;
|
|
@@ -521,8 +515,8 @@ let o = class extends _ {
|
|
|
521
515
|
}
|
|
522
516
|
renderUserButton() {
|
|
523
517
|
var t;
|
|
524
|
-
if (!this.user) return
|
|
525
|
-
const e =
|
|
518
|
+
if (!this.user) return u;
|
|
519
|
+
const e = g({
|
|
526
520
|
"pkt-header-service__user-menu": this.isMobile === !1,
|
|
527
521
|
"pkt-header-service__mobile-menu": this.isMobile === !0,
|
|
528
522
|
"is-open": this.openMenu === "user"
|
|
@@ -531,10 +525,10 @@ let o = class extends _ {
|
|
|
531
525
|
<div
|
|
532
526
|
class="pkt-header-service__user-container"
|
|
533
527
|
@focusout=${(i) => this.handleFocusOut(i, "user")}
|
|
534
|
-
${
|
|
528
|
+
${k(this.userContainerRef)}
|
|
535
529
|
>
|
|
536
530
|
<pkt-button
|
|
537
|
-
class=${
|
|
531
|
+
class=${g({
|
|
538
532
|
"pkt-header-service__user-button": !0,
|
|
539
533
|
"pkt-header-service__user-button--mobile": this.isMobile
|
|
540
534
|
})}
|
|
@@ -553,7 +547,7 @@ let o = class extends _ {
|
|
|
553
547
|
<div class=${e}>
|
|
554
548
|
<pkt-header-user-menu
|
|
555
549
|
.user=${this.user}
|
|
556
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn ||
|
|
550
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn || u}
|
|
557
551
|
.representing=${this.representing}
|
|
558
552
|
.userMenu=${this.userMenu}
|
|
559
553
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -564,12 +558,12 @@ let o = class extends _ {
|
|
|
564
558
|
@log-out=${this.handleLogout}
|
|
565
559
|
></pkt-header-user-menu>
|
|
566
560
|
</div>
|
|
567
|
-
` :
|
|
561
|
+
` : u}
|
|
568
562
|
</div>
|
|
569
563
|
`;
|
|
570
564
|
}
|
|
571
565
|
renderHeader() {
|
|
572
|
-
const e =
|
|
566
|
+
const e = g({
|
|
573
567
|
"pkt-header-service": !0,
|
|
574
568
|
"pkt-header-service--compact": this.compact,
|
|
575
569
|
"pkt-header-service--mobile": this.isMobile,
|
|
@@ -577,12 +571,12 @@ let o = class extends _ {
|
|
|
577
571
|
"pkt-header-service--fixed": this.isFixed,
|
|
578
572
|
"pkt-header-service--scroll-to-hide": this.shouldHideOnScroll,
|
|
579
573
|
"pkt-header-service--hidden": this.isHidden
|
|
580
|
-
}), t =
|
|
574
|
+
}), t = g({
|
|
581
575
|
"pkt-header-service__logo-area": !0,
|
|
582
576
|
"pkt-header-service__logo-area--without-service": !this.serviceName
|
|
583
577
|
});
|
|
584
578
|
return n`
|
|
585
|
-
<header class=${e} ${
|
|
579
|
+
<header class=${e} ${k(this.headerRef)}>
|
|
586
580
|
<div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
587
581
|
|
|
588
582
|
<div class="pkt-header-service__content">
|
|
@@ -597,7 +591,7 @@ let o = class extends _ {
|
|
|
597
591
|
>
|
|
598
592
|
Logg ut
|
|
599
593
|
</pkt-button>
|
|
600
|
-
` :
|
|
594
|
+
` : u}
|
|
601
595
|
</div>
|
|
602
596
|
|
|
603
597
|
<div class="pkt-header-service__user">
|
|
@@ -612,7 +606,7 @@ let o = class extends _ {
|
|
|
612
606
|
>
|
|
613
607
|
Logg ut
|
|
614
608
|
</pkt-button>
|
|
615
|
-
` :
|
|
609
|
+
` : u}
|
|
616
610
|
</div>
|
|
617
611
|
</header>
|
|
618
612
|
`;
|
|
@@ -620,7 +614,7 @@ let o = class extends _ {
|
|
|
620
614
|
render() {
|
|
621
615
|
const e = this.renderHeader();
|
|
622
616
|
if (this.isFixed) {
|
|
623
|
-
const t =
|
|
617
|
+
const t = g({
|
|
624
618
|
"pkt-header-service-spacer": !0,
|
|
625
619
|
"pkt-header-service-spacer--compact": this.compact,
|
|
626
620
|
"pkt-header-service-spacer--has-user": !!this.user,
|
|
@@ -636,102 +630,108 @@ let o = class extends _ {
|
|
|
636
630
|
return e;
|
|
637
631
|
}
|
|
638
632
|
};
|
|
639
|
-
|
|
633
|
+
r([
|
|
640
634
|
s({ type: String, attribute: "service-name" })
|
|
641
635
|
], o.prototype, "serviceName", 2);
|
|
642
|
-
|
|
636
|
+
r([
|
|
643
637
|
s({ type: String, attribute: "service-link" })
|
|
644
638
|
], o.prototype, "serviceLink", 2);
|
|
645
|
-
|
|
639
|
+
r([
|
|
646
640
|
s({ type: String, attribute: "logo-link" })
|
|
647
641
|
], o.prototype, "logoLink", 2);
|
|
648
|
-
|
|
642
|
+
r([
|
|
649
643
|
s({ type: String, attribute: "search-placeholder" })
|
|
650
644
|
], o.prototype, "searchPlaceholder", 2);
|
|
651
|
-
|
|
645
|
+
r([
|
|
652
646
|
s({ type: String, attribute: "search-value" })
|
|
653
647
|
], o.prototype, "searchValue", 2);
|
|
654
|
-
|
|
648
|
+
r([
|
|
655
649
|
s({ type: Number, attribute: "mobile-breakpoint" })
|
|
656
650
|
], o.prototype, "mobileBreakpoint", 2);
|
|
657
|
-
|
|
651
|
+
r([
|
|
658
652
|
s({ type: Number, attribute: "tablet-breakpoint" })
|
|
659
653
|
], o.prototype, "tabletBreakpoint", 2);
|
|
660
|
-
|
|
654
|
+
r([
|
|
661
655
|
s({ type: String, attribute: "opened-menu" })
|
|
662
656
|
], o.prototype, "openedMenu", 2);
|
|
663
|
-
|
|
657
|
+
r([
|
|
664
658
|
s({ type: String, attribute: "log-out-button-placement" })
|
|
665
659
|
], o.prototype, "logOutButtonPlacement", 2);
|
|
666
|
-
|
|
660
|
+
r([
|
|
667
661
|
s({ type: String })
|
|
668
662
|
], o.prototype, "position", 2);
|
|
669
|
-
|
|
663
|
+
r([
|
|
670
664
|
s({ type: String, attribute: "scroll-behavior" })
|
|
671
665
|
], o.prototype, "scrollBehavior", 2);
|
|
672
|
-
|
|
666
|
+
r([
|
|
667
|
+
s({ type: String, attribute: "slot-menu-variant" })
|
|
668
|
+
], o.prototype, "slotMenuVariant", 2);
|
|
669
|
+
r([
|
|
670
|
+
s({ type: String, attribute: "slot-menu-text" })
|
|
671
|
+
], o.prototype, "slotMenuText", 2);
|
|
672
|
+
r([
|
|
673
673
|
s({ type: Boolean, attribute: "hide-logo", converter: d })
|
|
674
674
|
], o.prototype, "hideLogo", 2);
|
|
675
|
-
|
|
675
|
+
r([
|
|
676
676
|
s({ type: Boolean, converter: d })
|
|
677
677
|
], o.prototype, "compact", 2);
|
|
678
|
-
|
|
678
|
+
r([
|
|
679
679
|
s({ type: Boolean, attribute: "show-search", converter: d })
|
|
680
680
|
], o.prototype, "showSearch", 2);
|
|
681
|
-
|
|
681
|
+
r([
|
|
682
682
|
s({
|
|
683
683
|
type: Boolean,
|
|
684
684
|
attribute: "can-change-representation",
|
|
685
685
|
converter: d
|
|
686
686
|
})
|
|
687
687
|
], o.prototype, "canChangeRepresentation", 2);
|
|
688
|
-
|
|
688
|
+
r([
|
|
689
689
|
s({ type: Boolean, attribute: "has-log-out", converter: d })
|
|
690
690
|
], o.prototype, "hasLogOut", 2);
|
|
691
|
-
|
|
691
|
+
r([
|
|
692
692
|
s({ type: Object })
|
|
693
693
|
], o.prototype, "user", 2);
|
|
694
|
-
|
|
694
|
+
r([
|
|
695
695
|
s({ type: Array, attribute: "user-menu" })
|
|
696
696
|
], o.prototype, "userMenu", 2);
|
|
697
|
-
|
|
697
|
+
r([
|
|
698
698
|
s({ type: Object })
|
|
699
699
|
], o.prototype, "representing", 2);
|
|
700
|
-
|
|
700
|
+
r([
|
|
701
701
|
f()
|
|
702
702
|
], o.prototype, "isMobile", 2);
|
|
703
|
-
|
|
703
|
+
r([
|
|
704
704
|
f()
|
|
705
705
|
], o.prototype, "isTablet", 2);
|
|
706
|
-
|
|
706
|
+
r([
|
|
707
707
|
f()
|
|
708
708
|
], o.prototype, "openMenu", 2);
|
|
709
|
-
|
|
709
|
+
r([
|
|
710
710
|
f()
|
|
711
711
|
], o.prototype, "isHidden", 2);
|
|
712
|
-
|
|
712
|
+
r([
|
|
713
713
|
f()
|
|
714
714
|
], o.prototype, "componentWidth", 2);
|
|
715
|
-
|
|
715
|
+
r([
|
|
716
716
|
f()
|
|
717
717
|
], o.prototype, "hasSlotContent", 2);
|
|
718
|
-
|
|
718
|
+
r([
|
|
719
719
|
f()
|
|
720
720
|
], o.prototype, "alignSlotRight", 2);
|
|
721
|
-
|
|
721
|
+
r([
|
|
722
722
|
f()
|
|
723
723
|
], o.prototype, "alignSearchRight", 2);
|
|
724
|
-
o =
|
|
724
|
+
o = r([
|
|
725
725
|
M("pkt-header-service")
|
|
726
726
|
], o);
|
|
727
|
-
var
|
|
728
|
-
for (var
|
|
729
|
-
(
|
|
730
|
-
return
|
|
727
|
+
var x = Object.defineProperty, N = Object.getOwnPropertyDescriptor, h = (e, t, i, c) => {
|
|
728
|
+
for (var a = c > 1 ? void 0 : c ? N(t, i) : t, p = e.length - 1, m; p >= 0; p--)
|
|
729
|
+
(m = e[p]) && (a = (c ? m(t, i, a) : m(a)) || a);
|
|
730
|
+
return c && a && x(t, i, a), a;
|
|
731
731
|
};
|
|
732
|
-
let
|
|
732
|
+
let l = class extends _ {
|
|
733
733
|
constructor() {
|
|
734
|
-
super(), this.defaultSlot =
|
|
734
|
+
super(), this.defaultSlot = v(), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.slotController = new S(this, this.defaultSlot);
|
|
735
735
|
}
|
|
736
736
|
firstUpdated(e) {
|
|
737
737
|
super.firstUpdated(e), this.emitDeprecationWarnings();
|
|
@@ -760,6 +760,8 @@ let h = class extends _ {
|
|
|
760
760
|
log-out-button-placement=${this.logOutButtonPlacement}
|
|
761
761
|
position=${this.position}
|
|
762
762
|
scroll-behavior=${this.scrollBehavior}
|
|
763
|
+
slot-menu-variant=${this.slotMenuVariant}
|
|
764
|
+
slot-menu-text=${this.slotMenuText}
|
|
763
765
|
.hideLogo=${this.hideLogo}
|
|
764
766
|
.compact=${this.compact}
|
|
765
767
|
.showSearch=${this.showSearch}
|
|
@@ -769,84 +771,90 @@ let h = class extends _ {
|
|
|
769
771
|
.userMenu=${this.effectiveUserMenu}
|
|
770
772
|
.representing=${this.representing}
|
|
771
773
|
>
|
|
772
|
-
<div class="pkt-contents" ${
|
|
774
|
+
<div class="pkt-contents" ${k(this.defaultSlot)}></div>
|
|
773
775
|
</pkt-header-service>
|
|
774
776
|
`;
|
|
775
777
|
}
|
|
776
778
|
};
|
|
777
|
-
|
|
779
|
+
h([
|
|
778
780
|
s({ type: String, attribute: "service-name" })
|
|
779
|
-
],
|
|
780
|
-
|
|
781
|
+
], l.prototype, "serviceName", 2);
|
|
782
|
+
h([
|
|
781
783
|
s({ type: String, attribute: "service-link" })
|
|
782
|
-
],
|
|
783
|
-
|
|
784
|
+
], l.prototype, "serviceLink", 2);
|
|
785
|
+
h([
|
|
784
786
|
s({ type: String, attribute: "logo-link" })
|
|
785
|
-
],
|
|
786
|
-
|
|
787
|
+
], l.prototype, "logoLink", 2);
|
|
788
|
+
h([
|
|
787
789
|
s({ type: String, attribute: "search-placeholder" })
|
|
788
|
-
],
|
|
789
|
-
|
|
790
|
+
], l.prototype, "searchPlaceholder", 2);
|
|
791
|
+
h([
|
|
790
792
|
s({ type: String, attribute: "search-value" })
|
|
791
|
-
],
|
|
792
|
-
|
|
793
|
+
], l.prototype, "searchValue", 2);
|
|
794
|
+
h([
|
|
793
795
|
s({ type: Number, attribute: "mobile-breakpoint" })
|
|
794
|
-
],
|
|
795
|
-
|
|
796
|
+
], l.prototype, "mobileBreakpoint", 2);
|
|
797
|
+
h([
|
|
796
798
|
s({ type: Number, attribute: "tablet-breakpoint" })
|
|
797
|
-
],
|
|
798
|
-
|
|
799
|
+
], l.prototype, "tabletBreakpoint", 2);
|
|
800
|
+
h([
|
|
799
801
|
s({ type: String, attribute: "opened-menu" })
|
|
800
|
-
],
|
|
801
|
-
|
|
802
|
+
], l.prototype, "openedMenu", 2);
|
|
803
|
+
h([
|
|
802
804
|
s({ type: String, attribute: "log-out-button-placement" })
|
|
803
|
-
],
|
|
804
|
-
|
|
805
|
+
], l.prototype, "logOutButtonPlacement", 2);
|
|
806
|
+
h([
|
|
805
807
|
s({ type: String })
|
|
806
|
-
],
|
|
807
|
-
|
|
808
|
+
], l.prototype, "position", 2);
|
|
809
|
+
h([
|
|
808
810
|
s({ type: String, attribute: "scroll-behavior" })
|
|
809
|
-
],
|
|
810
|
-
|
|
811
|
+
], l.prototype, "scrollBehavior", 2);
|
|
812
|
+
h([
|
|
813
|
+
s({ type: String, attribute: "slot-menu-variant" })
|
|
814
|
+
], l.prototype, "slotMenuVariant", 2);
|
|
815
|
+
h([
|
|
816
|
+
s({ type: String, attribute: "slot-menu-text" })
|
|
817
|
+
], l.prototype, "slotMenuText", 2);
|
|
818
|
+
h([
|
|
811
819
|
s({ type: Boolean, attribute: "hide-logo", converter: d })
|
|
812
|
-
],
|
|
813
|
-
|
|
820
|
+
], l.prototype, "hideLogo", 2);
|
|
821
|
+
h([
|
|
814
822
|
s({ type: Boolean, converter: d })
|
|
815
|
-
],
|
|
816
|
-
|
|
823
|
+
], l.prototype, "compact", 2);
|
|
824
|
+
h([
|
|
817
825
|
s({ type: Boolean, attribute: "show-search", converter: d })
|
|
818
|
-
],
|
|
819
|
-
|
|
826
|
+
], l.prototype, "showSearch", 2);
|
|
827
|
+
h([
|
|
820
828
|
s({
|
|
821
829
|
type: Boolean,
|
|
822
830
|
attribute: "can-change-representation",
|
|
823
831
|
converter: d
|
|
824
832
|
})
|
|
825
|
-
],
|
|
826
|
-
|
|
833
|
+
], l.prototype, "canChangeRepresentation", 2);
|
|
834
|
+
h([
|
|
827
835
|
s({ type: Boolean, attribute: "has-log-out", converter: d })
|
|
828
|
-
],
|
|
829
|
-
|
|
836
|
+
], l.prototype, "hasLogOut", 2);
|
|
837
|
+
h([
|
|
830
838
|
s({ type: Object })
|
|
831
|
-
],
|
|
832
|
-
|
|
839
|
+
], l.prototype, "user", 2);
|
|
840
|
+
h([
|
|
833
841
|
s({ type: Array, attribute: "user-menu" })
|
|
834
|
-
],
|
|
835
|
-
|
|
842
|
+
], l.prototype, "userMenu", 2);
|
|
843
|
+
h([
|
|
836
844
|
s({ type: Object })
|
|
837
|
-
],
|
|
838
|
-
|
|
845
|
+
], l.prototype, "representing", 2);
|
|
846
|
+
h([
|
|
839
847
|
s({ type: Array, attribute: "user-menu-footer" })
|
|
840
|
-
],
|
|
841
|
-
|
|
848
|
+
], l.prototype, "userMenuFooter", 2);
|
|
849
|
+
h([
|
|
842
850
|
s({ type: Array, attribute: "user-options" })
|
|
843
|
-
],
|
|
844
|
-
|
|
851
|
+
], l.prototype, "userOptions", 2);
|
|
852
|
+
l = h([
|
|
845
853
|
M("pkt-header")
|
|
846
|
-
],
|
|
854
|
+
], l);
|
|
847
855
|
export {
|
|
848
|
-
|
|
856
|
+
l as PktHeader,
|
|
849
857
|
o as PktHeaderService,
|
|
850
858
|
b as PktHeaderUserMenu,
|
|
851
|
-
|
|
859
|
+
w as formatLastLoggedIn
|
|
852
860
|
};
|