@oslokommune/punkt-react 16.25.0 → 16.25.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/index.d.ts +2 -0
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +447 -445
- package/package.json +2 -2
- package/src/components/header/HeaderService.tsx +16 -15
- package/src/components/header/types.ts +2 -0
package/dist/punkt-react.js
CHANGED
|
@@ -61,22 +61,22 @@ var j = /* @__PURE__ */ O((/* @__PURE__ */ E(((e, t) => {
|
|
|
61
61
|
})();
|
|
62
62
|
})))(), 1), M = "https://punkt-cdn.oslo.kommune.no/16.25/icons/";
|
|
63
63
|
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || M);
|
|
64
|
-
var te = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", ne = {}, re = 2, ie = 1500, ae = typeof Storage < "u" && typeof sessionStorage < "u", oe = typeof window < "u" ? f : l,
|
|
64
|
+
var te = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", ne = {}, re = 2, ie = 1500, ae = typeof Storage < "u" && typeof sessionStorage < "u", oe = typeof window < "u" ? f : l, se = (e, t) => !e || !ae ? "" : sessionStorage.getItem(t + e + ".svg") ?? "", N = (e) => window.pktFetch(e).then((t) => {
|
|
65
65
|
if (!t.ok) throw Error("Missing icon: " + e);
|
|
66
66
|
return t.text();
|
|
67
67
|
}), ce = async (e, t = re) => {
|
|
68
68
|
try {
|
|
69
|
-
return await
|
|
69
|
+
return await N(e);
|
|
70
70
|
} catch {
|
|
71
71
|
return t > 0 ? (await new Promise((e) => setTimeout(e, ie)), ce(e, t - 1)) : (console.error("Failed to fetch icon: " + e), te);
|
|
72
72
|
}
|
|
73
73
|
}, le = async (e, t) => {
|
|
74
74
|
let n = t + e + ".svg";
|
|
75
75
|
return ae && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in ne ? ne[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (ne[n] = ce(n).then((e) => (e !== te && ae && sessionStorage.setItem(n, e), delete ne[n], e)), ne[n]) : te;
|
|
76
|
-
},
|
|
76
|
+
}, ue = (e) => {
|
|
77
77
|
if (e !== void 0) return e === !0 || e === "true";
|
|
78
|
-
},
|
|
79
|
-
let l = t ?? (typeof window < "u" ? window.pktIconPath : M), u = m(null), d =
|
|
78
|
+
}, P = a(function({ name: e = "", path: t, className: n, ariaHidden: r, ariaLabel: i, "aria-hidden": a, "aria-label": o, ...s }, c) {
|
|
79
|
+
let l = t ?? (typeof window < "u" ? window.pktIconPath : M), u = m(null), d = ue(r) ?? ue(a), f = i ?? o, p = d === void 0 ? !f : d, h = p ? void 0 : f || e;
|
|
80
80
|
oe(() => {
|
|
81
81
|
let t = u.current;
|
|
82
82
|
if (!t) return;
|
|
@@ -88,7 +88,7 @@ var te = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>
|
|
|
88
88
|
t.innerHTML = "";
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
let r =
|
|
91
|
+
let r = se(e, l);
|
|
92
92
|
if (r) {
|
|
93
93
|
t.innerHTML = r, n(t);
|
|
94
94
|
return;
|
|
@@ -118,10 +118,10 @@ var te = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>
|
|
|
118
118
|
"data-path": l
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
|
-
|
|
121
|
+
P.displayName = "PktIcon";
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/components/accordion/AccordionItem.tsx
|
|
124
|
-
var
|
|
124
|
+
var F = a(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isOpen: a, children: o, name: s, className: c, onClick: u, onToggle: d }, f) => {
|
|
125
125
|
let [p, m] = h(e), { name: y } = A(), b = s || y, x = a === void 0 ? p : a;
|
|
126
126
|
return l(() => {
|
|
127
127
|
a === void 0 && m(e);
|
|
@@ -148,15 +148,15 @@ var I = a(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isO
|
|
|
148
148
|
children: [/* @__PURE__ */ v("summary", {
|
|
149
149
|
className: "pkt-accordion-item__title",
|
|
150
150
|
id: `pkt-accordion-item-summary-${t}`,
|
|
151
|
-
children: [n, r === "plus-minus" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
151
|
+
children: [n, r === "plus-minus" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
152
152
|
name: "plus-sign",
|
|
153
153
|
className: "pkt-accordion-item__icon pkt-accordion-item__icon--plus",
|
|
154
154
|
"aria-hidden": "true"
|
|
155
|
-
}), /* @__PURE__ */ _(
|
|
155
|
+
}), /* @__PURE__ */ _(P, {
|
|
156
156
|
name: "minus-sign",
|
|
157
157
|
className: "pkt-accordion-item__icon pkt-accordion-item__icon--minus",
|
|
158
158
|
"aria-hidden": "true"
|
|
159
|
-
})] }) : /* @__PURE__ */ _(
|
|
159
|
+
})] }) : /* @__PURE__ */ _(P, {
|
|
160
160
|
name: "chevron-thin-down",
|
|
161
161
|
className: "pkt-accordion-item__icon",
|
|
162
162
|
"aria-hidden": "true"
|
|
@@ -174,8 +174,8 @@ var I = a(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isO
|
|
|
174
174
|
});
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/button/Button.tsx
|
|
177
|
-
|
|
178
|
-
var
|
|
177
|
+
F.displayName = "PktAccordionItem", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/16.25/animations/");
|
|
178
|
+
var I = a(({ children: e, className: t, iconName: n = "user", secondIconName: r = "user", iconPath: i, secondIconPath: a, size: o = "medium", fullWidth: s = !1, fullWidthOnMobile: c = !1, skin: l = "primary", type: u = "button", variant: d = "label-only", state: f, color: p, isLoading: m = void 0, disabled: h = void 0, loadingAnimationPath: g = window.pktAnimationPath, ...y }, b) => {
|
|
179
179
|
let x = [
|
|
180
180
|
t,
|
|
181
181
|
"pkt-btn",
|
|
@@ -197,12 +197,12 @@ var L = a(({ children: e, className: t, iconName: n = "user", secondIconName: r
|
|
|
197
197
|
type: u,
|
|
198
198
|
ref: b,
|
|
199
199
|
children: [
|
|
200
|
-
m && /* @__PURE__ */ _(
|
|
200
|
+
m && /* @__PURE__ */ _(P, {
|
|
201
201
|
className: "pkt-btn__icon pkt-btn__spinner",
|
|
202
202
|
name: "spinner-blue",
|
|
203
203
|
path: g
|
|
204
204
|
}),
|
|
205
|
-
d !== "label-only" && /* @__PURE__ */ _(
|
|
205
|
+
d !== "label-only" && /* @__PURE__ */ _(P, {
|
|
206
206
|
className: "pkt-btn__icon",
|
|
207
207
|
name: n,
|
|
208
208
|
...i && { path: i }
|
|
@@ -211,7 +211,7 @@ var L = a(({ children: e, className: t, iconName: n = "user", secondIconName: r
|
|
|
211
211
|
className: "pkt-btn__text",
|
|
212
212
|
children: e
|
|
213
213
|
}),
|
|
214
|
-
d === "icons-right-and-left" && /* @__PURE__ */ _(
|
|
214
|
+
d === "icons-right-and-left" && /* @__PURE__ */ _(P, {
|
|
215
215
|
className: "pkt-btn__icon",
|
|
216
216
|
name: r,
|
|
217
217
|
...a && { path: a }
|
|
@@ -219,10 +219,10 @@ var L = a(({ children: e, className: t, iconName: n = "user", secondIconName: r
|
|
|
219
219
|
]
|
|
220
220
|
});
|
|
221
221
|
});
|
|
222
|
-
|
|
222
|
+
I.displayName = "PktButton";
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/components/alert/Alert.tsx
|
|
225
|
-
var
|
|
225
|
+
var L = ({ children: e, closeAlert: t, compact: n, title: r, date: i, ariaLive: a, "aria-live": o = "polite", role: c = "status", skin: l = "info", className: u, ...d }) => {
|
|
226
226
|
let [f, p] = h(!1), m = {
|
|
227
227
|
"pkt-alert": !0,
|
|
228
228
|
"pkt-alert--compact": n,
|
|
@@ -247,14 +247,14 @@ var ue = ({ children: e, closeAlert: t, compact: n, title: r, date: i, ariaLive:
|
|
|
247
247
|
children: /* @__PURE__ */ v("div", {
|
|
248
248
|
className: (0, j.default)(g),
|
|
249
249
|
children: [
|
|
250
|
-
/* @__PURE__ */ _(
|
|
250
|
+
/* @__PURE__ */ _(P, {
|
|
251
251
|
className: "pkt-alert__icon",
|
|
252
252
|
"aria-hidden": "true",
|
|
253
253
|
name: l === "info" ? "alert-information" : `alert-${l}`
|
|
254
254
|
}),
|
|
255
255
|
t && /* @__PURE__ */ _("div", {
|
|
256
256
|
className: "pkt-alert__close",
|
|
257
|
-
children: /* @__PURE__ */ _(
|
|
257
|
+
children: /* @__PURE__ */ _(I, {
|
|
258
258
|
tabIndex: 0,
|
|
259
259
|
"aria-label": "close",
|
|
260
260
|
size: n ? "small" : "medium",
|
|
@@ -285,11 +285,11 @@ var ue = ({ children: e, closeAlert: t, compact: n, title: r, date: i, ariaLive:
|
|
|
285
285
|
})
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
|
-
|
|
288
|
+
L.displayName = "PktAlert";
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/components/backlink/BackLink.tsx
|
|
291
291
|
var de = a(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, className: i, ...a }, o) => {
|
|
292
|
-
let s = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
292
|
+
let s = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
293
293
|
className: "pkt-back-link__icon pkt-icon pkt-link__icon",
|
|
294
294
|
name: "chevron-thin-left",
|
|
295
295
|
"aria-hidden": "true"
|
|
@@ -347,7 +347,7 @@ var R = a(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...
|
|
|
347
347
|
}) : l({
|
|
348
348
|
href: e.href,
|
|
349
349
|
className: "pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",
|
|
350
|
-
children: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
350
|
+
children: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
351
351
|
className: "pkt-icon pkt-breadcrumbs__icon pkt-link__icon",
|
|
352
352
|
name: "chevron-thin-right"
|
|
353
353
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -360,7 +360,7 @@ var R = a(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...
|
|
|
360
360
|
}), l({
|
|
361
361
|
href: s.href,
|
|
362
362
|
className: "pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",
|
|
363
|
-
children: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
363
|
+
children: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
364
364
|
className: "pkt-back-link__icon pkt-icon pkt-link__icon",
|
|
365
365
|
name: "chevron-thin-left"
|
|
366
366
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -1921,7 +1921,7 @@ function on(e) {
|
|
|
1921
1921
|
let { selected: t, multiple: n = !1, maxMultiple: r = 0, range: i = !1, earliest: a = null, latest: o = null, excludedates: c, excludeweekdays: d = [], weeknumbers: f = !1, withcontrols: g = !1, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = u(), T = S ?? w, E = p(() => ({
|
|
1922
1922
|
...an,
|
|
1923
1923
|
...y
|
|
1924
|
-
}), [y]), D = p(() => v ? Ct(v) : St(), [v]), O = p(() => c ? c.map((e) => typeof e == "string" ? Ct(e) : e) : [], [c]), k = t !== void 0, [A, ee] = h([]), j = k ? t : A, M = p(() => Wt(j), [j]), [te, ne] = h(0), [re, ie] = h(0), [ae, oe] = h({}), [
|
|
1924
|
+
}), [y]), D = p(() => v ? Ct(v) : St(), [v]), O = p(() => c ? c.map((e) => typeof e == "string" ? Ct(e) : e) : [], [c]), k = t !== void 0, [A, ee] = h([]), j = k ? t : A, M = p(() => Wt(j), [j]), [te, ne] = h(0), [re, ie] = h(0), [ae, oe] = h({}), [se, N] = h(null), [ce, le] = h(null), ue = m(null), P = m([]), F = m(0), I = m(!1), L = m(!1), de = p(() => ({
|
|
1925
1925
|
earliest: a,
|
|
1926
1926
|
latest: o,
|
|
1927
1927
|
excludedates: O,
|
|
@@ -1946,9 +1946,9 @@ function on(e) {
|
|
|
1946
1946
|
let t = typeof a == "string" ? Ct(a) : a;
|
|
1947
1947
|
!isNaN(t.getTime()) && e < t && (e = t);
|
|
1948
1948
|
}
|
|
1949
|
-
ne(e.getFullYear()), ie(e.getMonth()),
|
|
1949
|
+
ne(e.getFullYear()), ie(e.getMonth()), L.current = !0;
|
|
1950
1950
|
}, []), l(() => {
|
|
1951
|
-
if (
|
|
1951
|
+
if (L.current && !I.current && j.length > 0 && j[0] !== "") {
|
|
1952
1952
|
let e = Ct(j[j.length - 1]);
|
|
1953
1953
|
isNaN(e.getTime()) || (ne(e.getFullYear()), ie(e.getMonth()));
|
|
1954
1954
|
}
|
|
@@ -1960,7 +1960,7 @@ function on(e) {
|
|
|
1960
1960
|
}, [k, b]), z = s(() => {
|
|
1961
1961
|
x?.();
|
|
1962
1962
|
}, [x]), B = s((e, t) => {
|
|
1963
|
-
ne(typeof e == "string" ? parseInt(e) : e), ie(typeof t == "string" ? parseInt(t) : t),
|
|
1963
|
+
ne(typeof e == "string" ? parseInt(e) : e), ie(typeof t == "string" ? parseInt(t) : t), F.current = 0, le(null), P.current = [], I.current = !0;
|
|
1964
1964
|
}, []), V = s(() => {
|
|
1965
1965
|
let e = re === 0 ? 11 : re - 1;
|
|
1966
1966
|
B(re === 0 ? te - 1 : te, e);
|
|
@@ -1986,10 +1986,10 @@ function on(e) {
|
|
|
1986
1986
|
j.length
|
|
1987
1987
|
]), W = s(() => typeof j == "string" ? j.split(",") : j, [j]), pe = s((e) => {
|
|
1988
1988
|
if (!i || M.length !== 1 || !Kt(e, M, O, d) || M[0] >= e) {
|
|
1989
|
-
|
|
1989
|
+
N(null);
|
|
1990
1990
|
return;
|
|
1991
1991
|
}
|
|
1992
|
-
|
|
1992
|
+
N(e), oe(Gt(M[0], e));
|
|
1993
1993
|
}, [
|
|
1994
1994
|
i,
|
|
1995
1995
|
M,
|
|
@@ -2039,14 +2039,14 @@ function on(e) {
|
|
|
2039
2039
|
r,
|
|
2040
2040
|
k
|
|
2041
2041
|
]), J = s(() => {
|
|
2042
|
-
let e = wt(kt(D)), t =
|
|
2042
|
+
let e = wt(kt(D)), t = ue.current?.querySelector(`button[data-date="${e}"]`);
|
|
2043
2043
|
if (t instanceof HTMLButtonElement) {
|
|
2044
2044
|
le(e), t.focus();
|
|
2045
2045
|
return;
|
|
2046
2046
|
}
|
|
2047
|
-
let n =
|
|
2047
|
+
let n = P.current.find((e) => !e.isDisabled);
|
|
2048
2048
|
if (n) {
|
|
2049
|
-
let e =
|
|
2049
|
+
let e = ue.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);
|
|
2050
2050
|
e instanceof HTMLButtonElement && (le(n.currentDateISO), e.focus());
|
|
2051
2051
|
}
|
|
2052
2052
|
}, []), Y = s((e, t) => {
|
|
@@ -2056,9 +2056,9 @@ function on(e) {
|
|
|
2056
2056
|
J();
|
|
2057
2057
|
return;
|
|
2058
2058
|
}
|
|
2059
|
-
let r = nn(Dt(ce), t,
|
|
2059
|
+
let r = nn(Dt(ce), t, ue.current.querySelector.bind(ue.current));
|
|
2060
2060
|
if (r) {
|
|
2061
|
-
let e =
|
|
2061
|
+
let e = ue.current.querySelector(`button[data-date="${wt(r)}"]`);
|
|
2062
2062
|
e instanceof HTMLButtonElement && !e.dataset.disabled && (le(wt(r)), e.focus());
|
|
2063
2063
|
}
|
|
2064
2064
|
}, [ce, J]);
|
|
@@ -2071,7 +2071,7 @@ function on(e) {
|
|
|
2071
2071
|
activeSelected: j,
|
|
2072
2072
|
_selected: M,
|
|
2073
2073
|
inRange: ae,
|
|
2074
|
-
rangeHovered:
|
|
2074
|
+
rangeHovered: se,
|
|
2075
2075
|
focusedDate: ce,
|
|
2076
2076
|
range: i,
|
|
2077
2077
|
multiple: n,
|
|
@@ -2083,9 +2083,9 @@ function on(e) {
|
|
|
2083
2083
|
excludeweekdays: d,
|
|
2084
2084
|
className: C,
|
|
2085
2085
|
dateConstraints: de,
|
|
2086
|
-
calendarRef:
|
|
2087
|
-
selectableDatesRef:
|
|
2088
|
-
tabIndexSetRef:
|
|
2086
|
+
calendarRef: ue,
|
|
2087
|
+
selectableDatesRef: P,
|
|
2088
|
+
tabIndexSetRef: F,
|
|
2089
2089
|
prevMonth: V,
|
|
2090
2090
|
nextMonth: H,
|
|
2091
2091
|
changeMonth: B,
|
|
@@ -2107,7 +2107,7 @@ function on(e) {
|
|
|
2107
2107
|
}, [z, Y]),
|
|
2108
2108
|
handleFocusOut: s((e) => {
|
|
2109
2109
|
let t = e.target, n = e.relatedTarget;
|
|
2110
|
-
|
|
2110
|
+
ue.current && ue.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || z();
|
|
2111
2111
|
}, [z]),
|
|
2112
2112
|
close: z,
|
|
2113
2113
|
setFocusedDate: le
|
|
@@ -2133,7 +2133,7 @@ var sn = ({ componentId: e, strings: t, year: n, month: r, earliest: i, latest:
|
|
|
2133
2133
|
"data-disabled": l ? void 0 : "disabled",
|
|
2134
2134
|
"aria-disabled": !l || void 0,
|
|
2135
2135
|
tabIndex: l ? 0 : -1,
|
|
2136
|
-
children: [/* @__PURE__ */ _(
|
|
2136
|
+
children: [/* @__PURE__ */ _(P, {
|
|
2137
2137
|
className: "pkt-btn__icon",
|
|
2138
2138
|
name: d
|
|
2139
2139
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -2425,7 +2425,7 @@ var pn = a(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
|
|
|
2425
2425
|
"aria-description": E,
|
|
2426
2426
|
ref: y,
|
|
2427
2427
|
children: [
|
|
2428
|
-
o && /* @__PURE__ */ _(
|
|
2428
|
+
o && /* @__PURE__ */ _(P, {
|
|
2429
2429
|
className: "pkt-tag__icon",
|
|
2430
2430
|
name: o
|
|
2431
2431
|
}),
|
|
@@ -2433,7 +2433,7 @@ var pn = a(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
|
|
|
2433
2433
|
ref: C,
|
|
2434
2434
|
children: e
|
|
2435
2435
|
}),
|
|
2436
|
-
/* @__PURE__ */ _(
|
|
2436
|
+
/* @__PURE__ */ _(P, {
|
|
2437
2437
|
className: "pkt-tag__close-btn",
|
|
2438
2438
|
name: "close"
|
|
2439
2439
|
})
|
|
@@ -2442,7 +2442,7 @@ var pn = a(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
|
|
|
2442
2442
|
...g,
|
|
2443
2443
|
className: (0, j.default)(D, a),
|
|
2444
2444
|
ref: y,
|
|
2445
|
-
children: [o && /* @__PURE__ */ _(
|
|
2445
|
+
children: [o && /* @__PURE__ */ _(P, {
|
|
2446
2446
|
className: "pkt-tag__icon",
|
|
2447
2447
|
name: o,
|
|
2448
2448
|
"aria-hidden": "true"
|
|
@@ -2672,7 +2672,7 @@ var _n = "Les mer <span class='pkt-sr-only'>om feltet</span>", vn = (e) => e ==
|
|
|
2672
2672
|
type: "button",
|
|
2673
2673
|
className: "pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right",
|
|
2674
2674
|
onClick: d,
|
|
2675
|
-
children: [/* @__PURE__ */ _(
|
|
2675
|
+
children: [/* @__PURE__ */ _(P, {
|
|
2676
2676
|
className: "pkt-btn__icon",
|
|
2677
2677
|
name: l ? "chevron-thin-up" : "chevron-thin-down"
|
|
2678
2678
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -2757,7 +2757,7 @@ var bn = a(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
2757
2757
|
j && /* @__PURE__ */ _(ne, {}),
|
|
2758
2758
|
p && m && /* @__PURE__ */ _("div", {
|
|
2759
2759
|
className: "pkt-inputwrapper__alert-wrapper",
|
|
2760
|
-
children: /* @__PURE__ */ _(
|
|
2760
|
+
children: /* @__PURE__ */ _(L, {
|
|
2761
2761
|
skin: "error",
|
|
2762
2762
|
"aria-live": "assertive",
|
|
2763
2763
|
role: "alert",
|
|
@@ -3030,7 +3030,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3030
3030
|
value: i.join(","),
|
|
3031
3031
|
readOnly: !0
|
|
3032
3032
|
}),
|
|
3033
|
-
/* @__PURE__ */ _(
|
|
3033
|
+
/* @__PURE__ */ _(P, {
|
|
3034
3034
|
className: A,
|
|
3035
3035
|
name: "chevron-thin-down",
|
|
3036
3036
|
"aria-hidden": "true"
|
|
@@ -3057,7 +3057,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3057
3057
|
className: "pkt-listbox__search",
|
|
3058
3058
|
children: [/* @__PURE__ */ _("span", {
|
|
3059
3059
|
className: "pkt-listbox__search-icon",
|
|
3060
|
-
children: /* @__PURE__ */ _(
|
|
3060
|
+
children: /* @__PURE__ */ _(P, { name: "magnifying-glass-small" })
|
|
3061
3061
|
}), /* @__PURE__ */ _("input", {
|
|
3062
3062
|
className: "pkt-txt-16-light",
|
|
3063
3063
|
type: "text",
|
|
@@ -3084,7 +3084,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3084
3084
|
}),
|
|
3085
3085
|
k && /* @__PURE__ */ v("div", {
|
|
3086
3086
|
className: "pkt-listbox__banner pkt-listbox__banner--user-message",
|
|
3087
|
-
children: [/* @__PURE__ */ _(
|
|
3087
|
+
children: [/* @__PURE__ */ _(P, {
|
|
3088
3088
|
className: "pkt-listbox__banner-icon",
|
|
3089
3089
|
name: "exclamation-mark-circle"
|
|
3090
3090
|
}), p]
|
|
@@ -3098,7 +3098,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3098
3098
|
onClick: () => C(f),
|
|
3099
3099
|
onKeyDown: w,
|
|
3100
3100
|
children: [
|
|
3101
|
-
/* @__PURE__ */ _(
|
|
3101
|
+
/* @__PURE__ */ _(P, {
|
|
3102
3102
|
className: "pkt-listbox__banner-icon",
|
|
3103
3103
|
name: "plus-sign"
|
|
3104
3104
|
}),
|
|
@@ -3109,7 +3109,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3109
3109
|
}),
|
|
3110
3110
|
i.length === 0 && a.length === 0 && !k && /* @__PURE__ */ v("div", {
|
|
3111
3111
|
className: "pkt-listbox__banner pkt-listbox__banner--empty",
|
|
3112
|
-
children: [/* @__PURE__ */ _(
|
|
3112
|
+
children: [/* @__PURE__ */ _(P, {
|
|
3113
3113
|
className: "pkt-listbox__banner-icon",
|
|
3114
3114
|
name: "exclamation-mark-circle"
|
|
3115
3115
|
}), "Tom liste"]
|
|
@@ -3147,7 +3147,7 @@ var xn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3147
3147
|
readOnly: !0,
|
|
3148
3148
|
"aria-hidden": "true",
|
|
3149
3149
|
disabled: i
|
|
3150
|
-
}) : e.selected ? /* @__PURE__ */ _(
|
|
3150
|
+
}) : e.selected ? /* @__PURE__ */ _(P, { name: "check-big" }) : null,
|
|
3151
3151
|
/* @__PURE__ */ v("span", {
|
|
3152
3152
|
className: "pkt-listbox__option-label",
|
|
3153
3153
|
id: `${t}-option-label-${n}`,
|
|
@@ -3181,9 +3181,9 @@ function Un(e, t) {
|
|
|
3181
3181
|
}));
|
|
3182
3182
|
}
|
|
3183
3183
|
function Wn(t, n) {
|
|
3184
|
-
let { id: r = "", label: i, value: a, defaultValue: c, options: u, defaultOptions: f, multiple: g = !1, maxlength: _, typeahead: v = !1, includeSearch: y = !1, allowUserInput: b = !1, displayValueAs: x = "label", tagPlacement: S, searchPlaceholder: C, placeholder: w, disabled: T = !1, required: E = !1, fullwidth: D = !1, hasError: O = !1, errorMessage: k, helptext: A, helptextDropdown: ee, helptextDropdownButton: j, optionalTag: M = !1, optionalText: te, requiredTag: ne = !1, requiredText: re, tagText: ie, useWrapper: ae = !0, name: oe, className:
|
|
3185
|
-
|
|
3186
|
-
}, [
|
|
3184
|
+
let { id: r = "", label: i, value: a, defaultValue: c, options: u, defaultOptions: f, multiple: g = !1, maxlength: _, typeahead: v = !1, includeSearch: y = !1, allowUserInput: b = !1, displayValueAs: x = "label", tagPlacement: S, searchPlaceholder: C, placeholder: w, disabled: T = !1, required: E = !1, fullwidth: D = !1, hasError: O = !1, errorMessage: k, helptext: A, helptextDropdown: ee, helptextDropdownButton: j, optionalTag: M = !1, optionalText: te, requiredTag: ne = !1, requiredText: re, tagText: ie, useWrapper: ae = !0, name: oe, className: se, onChange: N, onValueChange: ce, children: le } = t, ue = `${r}-input`, P = `${r}-listbox`, F = v || b, I = m(null), L = m(null), de = m(null), R = m(null), z = m(null), B = s(() => {
|
|
3185
|
+
F ? I.current?.focus() : de.current?.focus();
|
|
3186
|
+
}, [F]), V = p(() => {
|
|
3187
3187
|
let t = [];
|
|
3188
3188
|
return e.forEach(le, (e) => {
|
|
3189
3189
|
if (o(e) && e.type === "option") {
|
|
@@ -3226,17 +3226,17 @@ function Wn(t, n) {
|
|
|
3226
3226
|
X,
|
|
3227
3227
|
v
|
|
3228
3228
|
]), Ae = p(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), je = s((e) => {
|
|
3229
|
-
let t =
|
|
3229
|
+
let t = L.current;
|
|
3230
3230
|
if (!t || !Ae) return;
|
|
3231
3231
|
let n = g ? e.join(",") : e[0] || "";
|
|
3232
3232
|
Ae.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3233
3233
|
}, [Ae, g]), Me = g ? G.join(",") : G[0] || "";
|
|
3234
3234
|
l(() => {
|
|
3235
|
-
|
|
3235
|
+
L.current && (L.current.value = Me);
|
|
3236
3236
|
}, [Me]), l(() => {
|
|
3237
|
-
if (J || g || !
|
|
3237
|
+
if (J || g || !I.current) return;
|
|
3238
3238
|
let e = G[0] ? Mn(G[0], q, x) : "";
|
|
3239
|
-
|
|
3239
|
+
I.current.value !== e && (I.current.value = e);
|
|
3240
3240
|
}, [
|
|
3241
3241
|
G,
|
|
3242
3242
|
q,
|
|
@@ -3295,10 +3295,10 @@ function Wn(t, n) {
|
|
|
3295
3295
|
_,
|
|
3296
3296
|
Ne
|
|
3297
3297
|
]), Re = s((e = !0, t) => {
|
|
3298
|
-
if (be(null), e &&
|
|
3298
|
+
if (be(null), e && I.current && I.current.type !== "hidden") {
|
|
3299
3299
|
Z(""), ge("");
|
|
3300
3300
|
let e = t === void 0 ? G[0] : t;
|
|
3301
|
-
!g && e ?
|
|
3301
|
+
!g && e ? I.current.value = Mn(e, q, x) : I.current.value = "", g || (we(!1), ve(""));
|
|
3302
3302
|
}
|
|
3303
3303
|
}, [
|
|
3304
3304
|
g,
|
|
@@ -3309,7 +3309,7 @@ function Wn(t, n) {
|
|
|
3309
3309
|
if (T) return;
|
|
3310
3310
|
ve(""), be(null);
|
|
3311
3311
|
let t = xn(q, e)?.value || null, n = G.includes(e || t || ""), r = !!t, i = q.find((t) => t.value === e)?.disabled || !1, a = !e?.trim(), o = !g, s = g, c = Tn(G.length, _ ?? null), l = !1, u = !0, d = "", f = "", p;
|
|
3312
|
-
i || (!r && b && !a ? (Le(e), d = "Ny verdi lagt til", l = s, o && (p = e || "")) : !r && !b ? (o && G[0] && Fe(G[0]), u = !1, l = !0, d = "Ingen treff i søket") : n ? (Fe(t), l = !0, p = "", o &&
|
|
3312
|
+
i || (!r && b && !a ? (Le(e), d = "Ny verdi lagt til", l = s, o && (p = e || "")) : !r && !b ? (o && G[0] && Fe(G[0]), u = !1, l = !0, d = "Ingen treff i søket") : n ? (Fe(t), l = !0, p = "", o && F && I.current && I.current.type !== "hidden" && (I.current.value = "")) : a && o ? (Ie(), l = !0, p = "") : o ? (G[0] && Fe(G[0]), Pe(t), l = !1, p = t || "") : s && !c ? (Pe(t), l = !0) : s && c ? (d = "Maks antall valg nådd", u = !1, f = e || "") : (o && Ie(), d = "Ingen gyldig verdi valgt", u = !1, l = !0, f = e || "", p = ""), Y(l), ve(d), Z(f), Re(u, p), l || (o && F && (De.current = !0), window.setTimeout(() => {
|
|
3313
3313
|
B();
|
|
3314
3314
|
}, 0)));
|
|
3315
3315
|
}, [
|
|
@@ -3326,8 +3326,8 @@ function Wn(t, n) {
|
|
|
3326
3326
|
Re,
|
|
3327
3327
|
B
|
|
3328
3328
|
]), $ = s(() => {
|
|
3329
|
-
if (Se(!1), be(null), ve(""), Z(""),
|
|
3330
|
-
let e =
|
|
3329
|
+
if (Se(!1), be(null), ve(""), Z(""), I.current && I.current.type !== "hidden") {
|
|
3330
|
+
let e = I.current.value, t = G[0];
|
|
3331
3331
|
if (!g) if (!e) G[0] && Fe(G[0]), t = void 0;
|
|
3332
3332
|
else {
|
|
3333
3333
|
let n = xn(q, e);
|
|
@@ -3347,7 +3347,7 @@ function Wn(t, n) {
|
|
|
3347
3347
|
break;
|
|
3348
3348
|
}
|
|
3349
3349
|
}
|
|
3350
|
-
!g && t ?
|
|
3350
|
+
!g && t ? I.current.value = Mn(t, q, x) : I.current.value = "";
|
|
3351
3351
|
}
|
|
3352
3352
|
Y(!1), we(!1);
|
|
3353
3353
|
}, [
|
|
@@ -3377,7 +3377,7 @@ function Wn(t, n) {
|
|
|
3377
3377
|
let t = e.target.value;
|
|
3378
3378
|
if (ge(t), Z(t), Be(t), v && t) {
|
|
3379
3379
|
let { suggestion: n } = On(q, t);
|
|
3380
|
-
n?.label &&
|
|
3380
|
+
n?.label && I.current && !e.nativeEvent.inputType?.includes("deleteContent") && (I.current.value = n.label, window.setTimeout(() => I.current?.setSelectionRange(t.length, n.label.length), 0));
|
|
3381
3381
|
}
|
|
3382
3382
|
}, [
|
|
3383
3383
|
T,
|
|
@@ -3386,7 +3386,7 @@ function Wn(t, n) {
|
|
|
3386
3386
|
Be
|
|
3387
3387
|
]), He = s((e) => {
|
|
3388
3388
|
if (e.key === "Backspace") {
|
|
3389
|
-
let t = !
|
|
3389
|
+
let t = !I.current?.value;
|
|
3390
3390
|
if (!X && t && g && G.length > 0) {
|
|
3391
3391
|
e.preventDefault();
|
|
3392
3392
|
let t = G[G.length - 1];
|
|
@@ -3394,7 +3394,7 @@ function Wn(t, n) {
|
|
|
3394
3394
|
}
|
|
3395
3395
|
return;
|
|
3396
3396
|
}
|
|
3397
|
-
if (e.key === "ArrowLeft" && g && G.length > 0 && (
|
|
3397
|
+
if (e.key === "ArrowLeft" && g && G.length > 0 && (I.current?.selectionStart ?? 0) === 0 && !I.current?.value) {
|
|
3398
3398
|
e.preventDefault(), Ee(G.length - 1);
|
|
3399
3399
|
return;
|
|
3400
3400
|
}
|
|
@@ -3406,7 +3406,7 @@ function Wn(t, n) {
|
|
|
3406
3406
|
}
|
|
3407
3407
|
switch (e.preventDefault(), t) {
|
|
3408
3408
|
case "addValue": {
|
|
3409
|
-
let e =
|
|
3409
|
+
let e = I.current?.value.trim() || "";
|
|
3410
3410
|
if (Z(e), e && G.includes(e)) {
|
|
3411
3411
|
Re(!0), ve("Verdien er allerede valgt");
|
|
3412
3412
|
break;
|
|
@@ -3445,7 +3445,7 @@ function Wn(t, n) {
|
|
|
3445
3445
|
De.current = !1, Se(!0);
|
|
3446
3446
|
return;
|
|
3447
3447
|
}
|
|
3448
|
-
!g && G[0] &&
|
|
3448
|
+
!g && G[0] && I.current && I.current.type !== "hidden" && (we(!0), I.current.value = Mn(G[0], q, x)), Se(!0), Z(""), Y(!0);
|
|
3449
3449
|
}
|
|
3450
3450
|
}, [
|
|
3451
3451
|
T,
|
|
@@ -3468,7 +3468,7 @@ function Wn(t, n) {
|
|
|
3468
3468
|
e.preventDefault(), e.stopPropagation();
|
|
3469
3469
|
return;
|
|
3470
3470
|
}
|
|
3471
|
-
if (
|
|
3471
|
+
if (F) I.current?.focus();
|
|
3472
3472
|
else {
|
|
3473
3473
|
e.stopPropagation(), e.preventDefault();
|
|
3474
3474
|
let t = !J;
|
|
@@ -3481,14 +3481,14 @@ function Wn(t, n) {
|
|
|
3481
3481
|
}
|
|
3482
3482
|
}, [
|
|
3483
3483
|
T,
|
|
3484
|
-
|
|
3484
|
+
F,
|
|
3485
3485
|
J,
|
|
3486
3486
|
b,
|
|
3487
3487
|
ye,
|
|
3488
3488
|
y
|
|
3489
3489
|
]), qe = s((e) => {
|
|
3490
|
-
T || (e.stopPropagation(),
|
|
3491
|
-
}, [T,
|
|
3490
|
+
T || (e.stopPropagation(), F && I.current ? (I.current.focus(), Se(!0)) : Y((e) => !e));
|
|
3491
|
+
}, [T, F]), Je = s((e) => {
|
|
3492
3492
|
if (!T) switch (e.key) {
|
|
3493
3493
|
case "Enter":
|
|
3494
3494
|
case " ":
|
|
@@ -3566,33 +3566,33 @@ function Wn(t, n) {
|
|
|
3566
3566
|
B,
|
|
3567
3567
|
$
|
|
3568
3568
|
]), Ze = s((e) => {
|
|
3569
|
-
Fe(e), Ee(-1),
|
|
3570
|
-
}, [Fe,
|
|
3569
|
+
Fe(e), Ee(-1), F && I.current && (Se(!0), I.current.focus());
|
|
3570
|
+
}, [Fe, F]), Qe = s((e, t) => {
|
|
3571
3571
|
switch (e.stopPropagation(), e.key) {
|
|
3572
3572
|
case "ArrowLeft":
|
|
3573
3573
|
e.preventDefault(), t > 0 && Ee(t - 1);
|
|
3574
3574
|
break;
|
|
3575
3575
|
case "ArrowRight":
|
|
3576
|
-
e.preventDefault(), t < G.length - 1 ? Ee(t + 1) : (Ee(-1),
|
|
3576
|
+
e.preventDefault(), t < G.length - 1 ? Ee(t + 1) : (Ee(-1), F && I.current ? I.current.focus() : de.current?.focus());
|
|
3577
3577
|
break;
|
|
3578
3578
|
case "Backspace":
|
|
3579
3579
|
case "Delete":
|
|
3580
3580
|
e.preventDefault();
|
|
3581
3581
|
{
|
|
3582
3582
|
let e = G[t], n = t >= G.length - 1 ? t - 1 : t;
|
|
3583
|
-
Fe(e), n >= 0 ? Ee(n) : (Ee(-1),
|
|
3583
|
+
Fe(e), n >= 0 ? Ee(n) : (Ee(-1), F && I.current ? I.current.focus() : de.current?.focus());
|
|
3584
3584
|
}
|
|
3585
3585
|
break;
|
|
3586
3586
|
case "Tab":
|
|
3587
3587
|
Ee(-1);
|
|
3588
3588
|
break;
|
|
3589
3589
|
case "Escape":
|
|
3590
|
-
e.preventDefault(), Ee(-1),
|
|
3590
|
+
e.preventDefault(), Ee(-1), F && I.current ? I.current.focus() : de.current?.focus();
|
|
3591
3591
|
break;
|
|
3592
3592
|
}
|
|
3593
3593
|
}, [
|
|
3594
3594
|
G,
|
|
3595
|
-
|
|
3595
|
+
F,
|
|
3596
3596
|
Fe
|
|
3597
3597
|
]), $e = s((e) => {
|
|
3598
3598
|
Z(e.target.value), Be(e.target.value);
|
|
@@ -3645,31 +3645,31 @@ function Wn(t, n) {
|
|
|
3645
3645
|
if (!e) return;
|
|
3646
3646
|
let t = () => {
|
|
3647
3647
|
window.setTimeout(() => {
|
|
3648
|
-
if (W(pe.current), me([]), ge(""), Z(""), be(null), ve(""),
|
|
3648
|
+
if (W(pe.current), me([]), ge(""), Z(""), be(null), ve(""), L.current) {
|
|
3649
3649
|
let e = g ? pe.current.join(",") : pe.current[0] || "";
|
|
3650
|
-
|
|
3650
|
+
L.current.value = e;
|
|
3651
3651
|
}
|
|
3652
3652
|
}, 0);
|
|
3653
3653
|
};
|
|
3654
3654
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
3655
3655
|
}, [g]), d(n, () => ({
|
|
3656
3656
|
get value() {
|
|
3657
|
-
return
|
|
3657
|
+
return L.current?.value ?? "";
|
|
3658
3658
|
},
|
|
3659
3659
|
set value(e) {
|
|
3660
3660
|
let t = Array.isArray(e) ? e : e ? String(e).split(",").filter(Boolean) : [];
|
|
3661
|
-
fe || W(t),
|
|
3661
|
+
fe || W(t), L.current && (L.current.value = t.join(","));
|
|
3662
3662
|
},
|
|
3663
3663
|
focus() {
|
|
3664
|
-
|
|
3664
|
+
F ? I.current?.focus() : de.current?.focus();
|
|
3665
3665
|
},
|
|
3666
3666
|
blur() {
|
|
3667
|
-
|
|
3667
|
+
F ? I.current?.blur() : de.current?.blur();
|
|
3668
3668
|
}
|
|
3669
3669
|
}), [fe]), {
|
|
3670
3670
|
id: r,
|
|
3671
|
-
inputId:
|
|
3672
|
-
listboxId:
|
|
3671
|
+
inputId: ue,
|
|
3672
|
+
listboxId: P,
|
|
3673
3673
|
values: G,
|
|
3674
3674
|
inputValue: he,
|
|
3675
3675
|
searchValue: X,
|
|
@@ -3707,10 +3707,10 @@ function Wn(t, n) {
|
|
|
3707
3707
|
tagText: ie,
|
|
3708
3708
|
useWrapper: ae,
|
|
3709
3709
|
name: oe,
|
|
3710
|
-
className:
|
|
3710
|
+
className: se,
|
|
3711
3711
|
hasCounter: Q,
|
|
3712
|
-
inputRef:
|
|
3713
|
-
changeInputRef:
|
|
3712
|
+
inputRef: I,
|
|
3713
|
+
changeInputRef: L,
|
|
3714
3714
|
triggerRef: de,
|
|
3715
3715
|
listboxRef: R,
|
|
3716
3716
|
wrapperRef: z,
|
|
@@ -3730,7 +3730,7 @@ function Wn(t, n) {
|
|
|
3730
3730
|
handleSearchKeydown: et,
|
|
3731
3731
|
handleNewOptionClick: tt,
|
|
3732
3732
|
handleNewOptionKeydown: nt,
|
|
3733
|
-
onChange:
|
|
3733
|
+
onChange: N
|
|
3734
3734
|
};
|
|
3735
3735
|
}
|
|
3736
3736
|
//#endregion
|
|
@@ -3978,18 +3978,18 @@ var Kn = {
|
|
|
3978
3978
|
href: "#",
|
|
3979
3979
|
className: "pkt-footer__link",
|
|
3980
3980
|
onClick: x,
|
|
3981
|
-
children: [/* @__PURE__ */ _(
|
|
3981
|
+
children: [/* @__PURE__ */ _(P, {
|
|
3982
3982
|
name: "chevron-right",
|
|
3983
3983
|
className: "pkt-footer__link-icon"
|
|
3984
3984
|
}), b]
|
|
3985
|
-
}) : s === "icon" ? /* @__PURE__ */ _(
|
|
3985
|
+
}) : s === "icon" ? /* @__PURE__ */ _(I, {
|
|
3986
3986
|
ref: f,
|
|
3987
3987
|
skin: "tertiary",
|
|
3988
3988
|
variant: "icon-only",
|
|
3989
3989
|
iconName: "cookie",
|
|
3990
3990
|
onClick: x,
|
|
3991
3991
|
children: b
|
|
3992
|
-
}) : /* @__PURE__ */ _(
|
|
3992
|
+
}) : /* @__PURE__ */ _(I, {
|
|
3993
3993
|
ref: f,
|
|
3994
3994
|
onClick: x,
|
|
3995
3995
|
children: b
|
|
@@ -4077,16 +4077,16 @@ var Qn = () => {
|
|
|
4077
4077
|
})
|
|
4078
4078
|
});
|
|
4079
4079
|
}, lr = ({ state: e }) => {
|
|
4080
|
-
let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: h, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: ee, toggleCalendar: j, handleFocus: M, handleSingleInputChange: te, handleRangeFromChange: ne, handleRangeToChange: re, handleRangeBlur: ie, handleMultipleBlur: ae, handleTagRemoved: oe, handleSingleKeydown:
|
|
4080
|
+
let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: h, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: ee, toggleCalendar: j, handleFocus: M, handleSingleInputChange: te, handleRangeFromChange: ne, handleRangeToChange: re, handleRangeBlur: ie, handleMultipleBlur: ae, handleTagRemoved: oe, handleSingleKeydown: se, handleRangeFromKeydown: N, handleRangeToKeydown: ce, handleMultipleKeydown: le, restProps: ue } = e, F = (e) => {
|
|
4081
4081
|
e.preventDefault(), j();
|
|
4082
|
-
},
|
|
4082
|
+
}, I = () => /* @__PURE__ */ v("button", {
|
|
4083
4083
|
ref: ee,
|
|
4084
4084
|
className: T,
|
|
4085
4085
|
type: "button",
|
|
4086
4086
|
onClick: j,
|
|
4087
4087
|
disabled: c,
|
|
4088
4088
|
"aria-label": C.calendar?.buttonAltText ?? "Åpne kalender",
|
|
4089
|
-
children: [/* @__PURE__ */ _(
|
|
4089
|
+
children: [/* @__PURE__ */ _(P, { name: "calendar" }), /* @__PURE__ */ _("span", {
|
|
4090
4090
|
className: "pkt-btn__text",
|
|
4091
4091
|
children: C.calendar?.buttonAltText ?? "Åpne kalender"
|
|
4092
4092
|
})]
|
|
@@ -4102,7 +4102,7 @@ var Qn = () => {
|
|
|
4102
4102
|
children: /* @__PURE__ */ v("div", {
|
|
4103
4103
|
className: "pkt-input__container",
|
|
4104
4104
|
children: [/* @__PURE__ */ _("input", {
|
|
4105
|
-
...
|
|
4105
|
+
...ue,
|
|
4106
4106
|
ref: k,
|
|
4107
4107
|
className: w,
|
|
4108
4108
|
type: x,
|
|
@@ -4114,11 +4114,11 @@ var Qn = () => {
|
|
|
4114
4114
|
"aria-describedby": h ? `${t}-helptext` : void 0,
|
|
4115
4115
|
"aria-invalid": m,
|
|
4116
4116
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4117
|
-
onClick:
|
|
4117
|
+
onClick: F,
|
|
4118
4118
|
onKeyDown: le,
|
|
4119
4119
|
onFocus: M,
|
|
4120
4120
|
onBlur: ae
|
|
4121
|
-
}),
|
|
4121
|
+
}), I()]
|
|
4122
4122
|
})
|
|
4123
4123
|
})] }) : o ? /* @__PURE__ */ _("div", {
|
|
4124
4124
|
className: D,
|
|
@@ -4130,7 +4130,7 @@ var Qn = () => {
|
|
|
4130
4130
|
children: C.generic?.from ?? "Fra"
|
|
4131
4131
|
}),
|
|
4132
4132
|
/* @__PURE__ */ _("input", {
|
|
4133
|
-
...
|
|
4133
|
+
...ue,
|
|
4134
4134
|
ref: k,
|
|
4135
4135
|
className: w,
|
|
4136
4136
|
type: x,
|
|
@@ -4147,8 +4147,8 @@ var Qn = () => {
|
|
|
4147
4147
|
"aria-describedby": h ? `${t}-helptext` : void 0,
|
|
4148
4148
|
"aria-invalid": m,
|
|
4149
4149
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4150
|
-
onClick:
|
|
4151
|
-
onKeyDown:
|
|
4150
|
+
onClick: F,
|
|
4151
|
+
onKeyDown: N,
|
|
4152
4152
|
onFocus: M,
|
|
4153
4153
|
onBlur: ie,
|
|
4154
4154
|
onChange: ne
|
|
@@ -4175,13 +4175,13 @@ var Qn = () => {
|
|
|
4175
4175
|
disabled: c,
|
|
4176
4176
|
"aria-label": `${d} ${C.generic?.to ?? "Til"}`,
|
|
4177
4177
|
"aria-invalid": m,
|
|
4178
|
-
onClick:
|
|
4178
|
+
onClick: F,
|
|
4179
4179
|
onKeyDown: ce,
|
|
4180
4180
|
onFocus: M,
|
|
4181
4181
|
onBlur: ie,
|
|
4182
4182
|
onChange: re
|
|
4183
4183
|
}),
|
|
4184
|
-
|
|
4184
|
+
I()
|
|
4185
4185
|
]
|
|
4186
4186
|
})
|
|
4187
4187
|
}) : /* @__PURE__ */ _("div", {
|
|
@@ -4189,7 +4189,7 @@ var Qn = () => {
|
|
|
4189
4189
|
children: /* @__PURE__ */ v("div", {
|
|
4190
4190
|
className: "pkt-input__container",
|
|
4191
4191
|
children: [/* @__PURE__ */ _("input", {
|
|
4192
|
-
...
|
|
4192
|
+
...ue,
|
|
4193
4193
|
ref: k,
|
|
4194
4194
|
className: w,
|
|
4195
4195
|
type: x,
|
|
@@ -4205,12 +4205,12 @@ var Qn = () => {
|
|
|
4205
4205
|
"aria-describedby": h ? `${t}-helptext` : void 0,
|
|
4206
4206
|
"aria-invalid": m,
|
|
4207
4207
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4208
|
-
onClick:
|
|
4209
|
-
onKeyDown:
|
|
4208
|
+
onClick: F,
|
|
4209
|
+
onKeyDown: se,
|
|
4210
4210
|
onFocus: M,
|
|
4211
4211
|
onBlur: void 0,
|
|
4212
4212
|
onChange: te
|
|
4213
|
-
}),
|
|
4213
|
+
}), I()]
|
|
4214
4214
|
})
|
|
4215
4215
|
});
|
|
4216
4216
|
}, ur = { calendar: { buttonAltText: "Åpne kalender" } }, dr = {
|
|
@@ -4231,7 +4231,7 @@ var Qn = () => {
|
|
|
4231
4231
|
//#endregion
|
|
4232
4232
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4233
4233
|
function pr(e, t) {
|
|
4234
|
-
let { id: n, label: r, value: i, defaultValue: a, dateformat: o = "dd.MM.yyyy", multiple: c = !1, maxlength: u, range: f = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, hasFieldset: E = !1, inline: D = !1, helptext: O, helptextDropdown: k, helptextDropdownButton: A, hasError: ee = !1, errorMessage: j, optionalTag: M = !1, optionalText: te, requiredTag: ne = !1, requiredText: re, tagText: ie, useWrapper: ae = !0, strings: oe, disabled:
|
|
4234
|
+
let { id: n, label: r, value: i, defaultValue: a, dateformat: o = "dd.MM.yyyy", multiple: c = !1, maxlength: u, range: f = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, hasFieldset: E = !1, inline: D = !1, helptext: O, helptextDropdown: k, helptextDropdownButton: A, hasError: ee = !1, errorMessage: j, optionalTag: M = !1, optionalText: te, requiredTag: ne = !1, requiredText: re, tagText: ie, useWrapper: ae = !0, strings: oe, disabled: se = !1, readOnly: N = !1, required: ce = !1, name: le, min: ue, max: P, placeholder: F, onChange: I, onValueChange: L, className: de, ...R } = e, z = s((e) => e === void 0 ? [] : fr(e), []), B = i !== void 0, V = typeof a == "number" ? void 0 : a, [H, fe] = h(() => z(i ?? V)), U = B ? z(i) : H, W = m(H);
|
|
4235
4235
|
l(() => {
|
|
4236
4236
|
B && fe(z(i));
|
|
4237
4237
|
}, [
|
|
@@ -4243,15 +4243,15 @@ function pr(e, t) {
|
|
|
4243
4243
|
l(() => {
|
|
4244
4244
|
C !== void 0 && G(C);
|
|
4245
4245
|
}, [C]);
|
|
4246
|
-
let K = m(null), me = m(null), q = m(null), J = m(null), Y = m(null), X = p(() => $n(), []), Z = p(() => Qn(), []), he = p(() => oe ?? (f ? dr : ur), [oe, f]), ge = typeof
|
|
4247
|
-
let e = tr(T, g, c, f,
|
|
4246
|
+
let K = m(null), me = m(null), q = m(null), J = m(null), Y = m(null), X = p(() => $n(), []), Z = p(() => Qn(), []), he = p(() => oe ?? (f ? dr : ur), [oe, f]), ge = typeof ue == "string" ? ue : ue === void 0 ? void 0 : String(ue), _e = typeof P == "string" ? P : P === void 0 ? void 0 : String(P), ve = p(() => {
|
|
4247
|
+
let e = tr(T, g, c, f, N, X);
|
|
4248
4248
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4249
4249
|
}, [
|
|
4250
4250
|
T,
|
|
4251
4251
|
g,
|
|
4252
4252
|
c,
|
|
4253
4253
|
f,
|
|
4254
|
-
|
|
4254
|
+
N,
|
|
4255
4255
|
X
|
|
4256
4256
|
]), ye = p(() => {
|
|
4257
4257
|
let e = nr();
|
|
@@ -4262,20 +4262,20 @@ function pr(e, t) {
|
|
|
4262
4262
|
}, [g]), xe = p(() => ["pkt-datepicker__inputs", f && "pkt-input__range-inputs"].filter(Boolean).join(" "), [f, g]), Se = p(() => {
|
|
4263
4263
|
if (x) return x;
|
|
4264
4264
|
if (_e) return _e.slice(0, 7);
|
|
4265
|
-
}, [x, _e]), Ce =
|
|
4265
|
+
}, [x, _e]), Ce = se || c && u != null && U.length >= u, we = c && u != null, Te = `${n}-input`, Ee = U.join(",");
|
|
4266
4266
|
l(() => {
|
|
4267
4267
|
q.current && (q.current.value = Ee);
|
|
4268
4268
|
}, [Ee]), l(() => {
|
|
4269
4269
|
w && typeof window < "u" && w !== window.pktTz && (window.pktTz = w);
|
|
4270
4270
|
}, [w]);
|
|
4271
4271
|
let De = s((e, t = !0) => {
|
|
4272
|
-
B || fe(e), t &&
|
|
4273
|
-
}, [B,
|
|
4272
|
+
B || fe(e), t && L?.(e);
|
|
4273
|
+
}, [B, L]), Oe = p(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Q = s((e) => {
|
|
4274
4274
|
let t = q.current;
|
|
4275
4275
|
!t || !Oe || (Oe.call(t, e.join(",")), t.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
4276
4276
|
}, [Oe]), ke = s(() => {
|
|
4277
|
-
|
|
4278
|
-
}, [
|
|
4277
|
+
se || G((e) => !e);
|
|
4278
|
+
}, [se]), Ae = s(() => {
|
|
4279
4279
|
G(!1);
|
|
4280
4280
|
}, []);
|
|
4281
4281
|
l(() => {
|
|
@@ -4406,11 +4406,11 @@ function pr(e, t) {
|
|
|
4406
4406
|
withcontrols: v,
|
|
4407
4407
|
excludedates: y,
|
|
4408
4408
|
excludeweekdays: b,
|
|
4409
|
-
disabled:
|
|
4410
|
-
readOnly:
|
|
4409
|
+
disabled: se,
|
|
4410
|
+
readOnly: N,
|
|
4411
4411
|
required: ce,
|
|
4412
4412
|
name: le,
|
|
4413
|
-
placeholder:
|
|
4413
|
+
placeholder: F,
|
|
4414
4414
|
fullwidth: T,
|
|
4415
4415
|
hasFieldset: E,
|
|
4416
4416
|
inline: D,
|
|
@@ -4444,7 +4444,7 @@ function pr(e, t) {
|
|
|
4444
4444
|
changeInputRef: q,
|
|
4445
4445
|
btnRef: J,
|
|
4446
4446
|
wrapperRef: Y,
|
|
4447
|
-
onChange:
|
|
4447
|
+
onChange: I,
|
|
4448
4448
|
toggleCalendar: ke,
|
|
4449
4449
|
hideCalendar: Ae,
|
|
4450
4450
|
handleDateSelected: Me,
|
|
@@ -4813,7 +4813,7 @@ var Ir = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
4813
4813
|
/* @__PURE__ */ v("div", {
|
|
4814
4814
|
className: "pkt-fileupload__drop-zone__placeholder",
|
|
4815
4815
|
children: [
|
|
4816
|
-
/* @__PURE__ */ _(
|
|
4816
|
+
/* @__PURE__ */ _(P, {
|
|
4817
4817
|
name: "attachment",
|
|
4818
4818
|
className: "pkt-fileupload__drop-zone__placeholder__icon",
|
|
4819
4819
|
"aria-hidden": "true"
|
|
@@ -4854,11 +4854,11 @@ var Ir = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
4854
4854
|
a,
|
|
4855
4855
|
"pkt-textinput",
|
|
4856
4856
|
"pkt-textarea"
|
|
4857
|
-
].join(" "), ie = `${e}-input`, ae = `${ie}-label`, oe = n || ae, [
|
|
4858
|
-
r &&
|
|
4857
|
+
].join(" "), ie = `${e}-input`, ae = `${ie}-label`, oe = n || ae, [se, N] = h(0), ce = (e) => {
|
|
4858
|
+
r && N(e.currentTarget?.value?.length || 0), D && D(e);
|
|
4859
4859
|
};
|
|
4860
4860
|
return l(() => {
|
|
4861
|
-
O !== void 0 &&
|
|
4861
|
+
O !== void 0 && N(O?.length || 0);
|
|
4862
4862
|
}, [O]), /* @__PURE__ */ _(bn, {
|
|
4863
4863
|
ariaDescribedby: t,
|
|
4864
4864
|
className: re,
|
|
@@ -4878,13 +4878,13 @@ var Ir = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
4878
4878
|
tagText: C,
|
|
4879
4879
|
useWrapper: E,
|
|
4880
4880
|
counter: r,
|
|
4881
|
-
counterCurrent:
|
|
4881
|
+
counterCurrent: se,
|
|
4882
4882
|
counterMaxLength: i,
|
|
4883
4883
|
children: /* @__PURE__ */ _("textarea", {
|
|
4884
4884
|
ref: (e) => {
|
|
4885
|
-
|
|
4885
|
+
N(e?.value?.length || 0), typeof ne == "function" && ne(e);
|
|
4886
4886
|
},
|
|
4887
|
-
className: `pkt-input ${m ? "pkt-input--fullwidth" : ""} ${i &&
|
|
4887
|
+
className: `pkt-input ${m ? "pkt-input--fullwidth" : ""} ${i && se > i ? "pkt-input--counter-error" : ""}`,
|
|
4888
4888
|
name: `${v || e}`,
|
|
4889
4889
|
id: ie,
|
|
4890
4890
|
placeholder: w,
|
|
@@ -4928,7 +4928,7 @@ var Ur = "comments", Wr = (e) => {
|
|
|
4928
4928
|
disabled: t,
|
|
4929
4929
|
defaultValue: i?.text
|
|
4930
4930
|
}),
|
|
4931
|
-
/* @__PURE__ */ _(
|
|
4931
|
+
/* @__PURE__ */ _(I, {
|
|
4932
4932
|
skin: "secondary",
|
|
4933
4933
|
size: "small",
|
|
4934
4934
|
disabled: t,
|
|
@@ -4941,7 +4941,7 @@ var Ur = "comments", Wr = (e) => {
|
|
|
4941
4941
|
},
|
|
4942
4942
|
children: o ? "Lagre kommentar" : "Legg til kommentar"
|
|
4943
4943
|
}),
|
|
4944
|
-
/* @__PURE__ */ _(
|
|
4944
|
+
/* @__PURE__ */ _(I, {
|
|
4945
4945
|
skin: "tertiary",
|
|
4946
4946
|
size: "small",
|
|
4947
4947
|
disabled: t,
|
|
@@ -4971,14 +4971,14 @@ var Ur = "comments", Wr = (e) => {
|
|
|
4971
4971
|
onClick: r,
|
|
4972
4972
|
disabled: t,
|
|
4973
4973
|
"aria-label": "Rediger kommentar",
|
|
4974
|
-
children: /* @__PURE__ */ _(
|
|
4974
|
+
children: /* @__PURE__ */ _(P, { name: "edit" })
|
|
4975
4975
|
}), /* @__PURE__ */ _("button", {
|
|
4976
4976
|
type: "button",
|
|
4977
4977
|
className: "pkt-fileupload__queue-display__item__comment__action",
|
|
4978
4978
|
onClick: n,
|
|
4979
4979
|
disabled: t,
|
|
4980
4980
|
"aria-label": "Slett kommentar",
|
|
4981
|
-
children: /* @__PURE__ */ _(
|
|
4981
|
+
children: /* @__PURE__ */ _(P, { name: "trash-can" })
|
|
4982
4982
|
})]
|
|
4983
4983
|
})]
|
|
4984
4984
|
})
|
|
@@ -5038,14 +5038,14 @@ var Ur = "comments", Wr = (e) => {
|
|
|
5038
5038
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), o()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r());
|
|
5039
5039
|
}
|
|
5040
5040
|
}),
|
|
5041
|
-
/* @__PURE__ */ _(
|
|
5041
|
+
/* @__PURE__ */ _(I, {
|
|
5042
5042
|
skin: "secondary",
|
|
5043
5043
|
size: "small",
|
|
5044
5044
|
disabled: t,
|
|
5045
5045
|
onClick: o,
|
|
5046
5046
|
children: "Lagre"
|
|
5047
5047
|
}),
|
|
5048
|
-
/* @__PURE__ */ _(
|
|
5048
|
+
/* @__PURE__ */ _(I, {
|
|
5049
5049
|
skin: "tertiary",
|
|
5050
5050
|
size: "small",
|
|
5051
5051
|
disabled: t,
|
|
@@ -5269,7 +5269,7 @@ var ci = "pkt-modal--open", li = "data-pkt-modal-open-count", ui = () => {
|
|
|
5269
5269
|
}) : /* @__PURE__ */ _("div", { className: "pkt-modal__headingText" }),
|
|
5270
5270
|
i ? /* @__PURE__ */ _("div", { className: "pkt-modal__noCloseButton" }) : /* @__PURE__ */ _("div", {
|
|
5271
5271
|
className: (0, j.default)("pkt-modal__closeButton", { [`pkt-modal__closeButton--${u}`]: !0 }),
|
|
5272
|
-
children: /* @__PURE__ */ _(
|
|
5272
|
+
children: /* @__PURE__ */ _(I, {
|
|
5273
5273
|
onClick: C,
|
|
5274
5274
|
"aria-label": "close",
|
|
5275
5275
|
iconName: "close",
|
|
@@ -5322,7 +5322,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5322
5322
|
}), bi = ({ cancelTransfer: e, transferItem: t, disabled: n = !1 }) => {
|
|
5323
5323
|
let r = t.showProgress ?? t.progress !== 0;
|
|
5324
5324
|
return /* @__PURE__ */ v(g, { children: [
|
|
5325
|
-
/* @__PURE__ */ _(
|
|
5325
|
+
/* @__PURE__ */ _(P, {
|
|
5326
5326
|
name: "document-text",
|
|
5327
5327
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5328
5328
|
"aria-hidden": "true"
|
|
@@ -5370,7 +5370,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5370
5370
|
}), Si = ({ transferItem: e, onRemove: t, disabled: n }) => {
|
|
5371
5371
|
let r = (e.lastProgress ?? 1) * 100;
|
|
5372
5372
|
return /* @__PURE__ */ v(g, { children: [
|
|
5373
|
-
/* @__PURE__ */ _(
|
|
5373
|
+
/* @__PURE__ */ _(P, {
|
|
5374
5374
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5375
5375
|
name: "alert-error",
|
|
5376
5376
|
"aria-hidden": "true"
|
|
@@ -5395,7 +5395,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5395
5395
|
})
|
|
5396
5396
|
] });
|
|
5397
5397
|
}, Ci = ({ transferItem: e, onRemove: t, disabled: n }) => /* @__PURE__ */ v(g, { children: [
|
|
5398
|
-
/* @__PURE__ */ _(
|
|
5398
|
+
/* @__PURE__ */ _(P, {
|
|
5399
5399
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5400
5400
|
name: "alert-error",
|
|
5401
5401
|
"aria-hidden": "true"
|
|
@@ -5431,7 +5431,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5431
5431
|
"aria-label": typeof e.ariaLabel == "function" ? e.ariaLabel(t.file) : e.ariaLabel,
|
|
5432
5432
|
children: n
|
|
5433
5433
|
}) : null;
|
|
5434
|
-
}, Ei = ({ transferItem: e }) => /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
5434
|
+
}, Ei = ({ transferItem: e }) => /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
5435
5435
|
name: "document-text",
|
|
5436
5436
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5437
5437
|
"aria-hidden": "true"
|
|
@@ -5450,19 +5450,19 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5450
5450
|
src: n,
|
|
5451
5451
|
alt: e.attributes.targetFilename,
|
|
5452
5452
|
onError: () => a(!0)
|
|
5453
|
-
}) || /* @__PURE__ */ _(
|
|
5453
|
+
}) || /* @__PURE__ */ _(P, {
|
|
5454
5454
|
name: "document-text",
|
|
5455
5455
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
5456
5456
|
}), c = !!t;
|
|
5457
5457
|
return /* @__PURE__ */ v("div", {
|
|
5458
5458
|
className: `pkt-fileupload__queue-display__item__thumbnail${n && !i ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
|
|
5459
|
-
children: [/* @__PURE__ */ v(
|
|
5459
|
+
children: [/* @__PURE__ */ v(I, {
|
|
5460
5460
|
className: "pkt-fileupload__queue-display__item__thumbnail__image-wrapper",
|
|
5461
5461
|
"aria-label": `Forhåndsvis bilde ${e.attributes.targetFilename}`,
|
|
5462
5462
|
type: "button",
|
|
5463
5463
|
skin: "secondary",
|
|
5464
5464
|
onClick: t,
|
|
5465
|
-
children: [c && /* @__PURE__ */ _(
|
|
5465
|
+
children: [c && /* @__PURE__ */ _(P, {
|
|
5466
5466
|
name: "expand",
|
|
5467
5467
|
className: "pkt-fileupload__queue-display__item__thumbnail__expand-icon",
|
|
5468
5468
|
"aria-hidden": "true"
|
|
@@ -5514,7 +5514,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5514
5514
|
children: /* @__PURE__ */ v("div", {
|
|
5515
5515
|
className: "pkt-fileupload__image-preview",
|
|
5516
5516
|
children: [
|
|
5517
|
-
f && /* @__PURE__ */ _(
|
|
5517
|
+
f && /* @__PURE__ */ _(I, {
|
|
5518
5518
|
variant: "icon-only",
|
|
5519
5519
|
iconName: "chevron-thin-left",
|
|
5520
5520
|
skin: "secondary",
|
|
@@ -5530,7 +5530,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5530
5530
|
alt: `${d.attributes.targetFilename} - ${n + 1} av ${t.length}`,
|
|
5531
5531
|
className: "pkt-fileupload__image-preview__image",
|
|
5532
5532
|
onError: () => u(!0)
|
|
5533
|
-
}) : /* @__PURE__ */ _(
|
|
5533
|
+
}) : /* @__PURE__ */ _(P, {
|
|
5534
5534
|
name: "picture",
|
|
5535
5535
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
5536
5536
|
})
|
|
@@ -5543,7 +5543,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5543
5543
|
t.length
|
|
5544
5544
|
]
|
|
5545
5545
|
}),
|
|
5546
|
-
f && /* @__PURE__ */ _(
|
|
5546
|
+
f && /* @__PURE__ */ _(I, {
|
|
5547
5547
|
variant: "icon-only",
|
|
5548
5548
|
iconName: "chevron-thin-right",
|
|
5549
5549
|
skin: "secondary",
|
|
@@ -5588,7 +5588,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5588
5588
|
...e
|
|
5589
5589
|
}) : void 0, s = n?.renderInlineUI || n?.renderExtendedUI ? [] : r;
|
|
5590
5590
|
return /* @__PURE__ */ v(g, { children: [
|
|
5591
|
-
n?.renderInlineUI && o ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
5591
|
+
n?.renderInlineUI && o ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(P, {
|
|
5592
5592
|
name: "document-text",
|
|
5593
5593
|
className: "pkt-fileupload__queue-display__item__icon"
|
|
5594
5594
|
}), /* @__PURE__ */ _("div", {
|
|
@@ -5677,16 +5677,16 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5677
5677
|
}, Ri = {
|
|
5678
5678
|
filename: Ei,
|
|
5679
5679
|
thumbnail: Di
|
|
5680
|
-
}, zi = a(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: o = !1, truncateTail: c = 4, onFilesChanged: f, onFileUploadRequested: g, extraOperations: y = [], itemRenderer: b = Ri.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: ee, helptext: M, optionalTag: te, requiredTag: ne, required: re = !1, enableImagePreview: ie = !1, "aria-describedby": ae, "aria-invalid": oe, ...
|
|
5681
|
-
let ce = u(), le = n ?? `pkt-fileupload-${ce}`,
|
|
5682
|
-
d(
|
|
5683
|
-
let
|
|
5680
|
+
}, zi = a(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: o = !1, truncateTail: c = 4, onFilesChanged: f, onFileUploadRequested: g, extraOperations: y = [], itemRenderer: b = Ri.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: ee, helptext: M, optionalTag: te, requiredTag: ne, required: re = !1, enableImagePreview: ie = !1, "aria-describedby": ae, "aria-invalid": oe, ...se }, N) => {
|
|
5681
|
+
let ce = u(), le = n ?? `pkt-fileupload-${ce}`, ue = m(null);
|
|
5682
|
+
d(N, () => ue.current, []);
|
|
5683
|
+
let P = "transfers" in se ? se.transfers : void 0, [F, I] = h(null), [de, R] = h("");
|
|
5684
5684
|
l(() => {
|
|
5685
5685
|
if (!de) return;
|
|
5686
5686
|
let e = setTimeout(() => R(""), 1500);
|
|
5687
5687
|
return () => clearTimeout(e);
|
|
5688
5688
|
}, [de]);
|
|
5689
|
-
let z =
|
|
5689
|
+
let z = F ?? O ?? null, B = k || !!F || !!(O && O.trim()), V = z ? `${le}-error` : void 0, H = [
|
|
5690
5690
|
ae,
|
|
5691
5691
|
M ? `${le}-helptext` : void 0,
|
|
5692
5692
|
V
|
|
@@ -5717,21 +5717,21 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5717
5717
|
]);
|
|
5718
5718
|
e !== void 0 && t !== void 0 && console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"), e !== void 0 && f === void 0 && console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");
|
|
5719
5719
|
let W = e !== void 0, [pe, G] = h(() => t ?? []), K = W ? e : pe;
|
|
5720
|
-
ii(
|
|
5720
|
+
ii(ue, {
|
|
5721
5721
|
uploadStrategy: i,
|
|
5722
5722
|
required: re,
|
|
5723
5723
|
currentFileCount: K.length,
|
|
5724
|
-
onMissingFiles: s(() =>
|
|
5724
|
+
onMissingFiles: s(() => I(_r.requiredMissing), [])
|
|
5725
5725
|
});
|
|
5726
|
-
let me = typeof b == "string" ? Ri[b] : b, q = b === "thumbnail", J = typeof
|
|
5726
|
+
let me = typeof b == "string" ? Ri[b] : b, q = b === "thumbnail", J = typeof se.accept == "string" ? se.accept.trim() : void 0, Y = p(() => Cr(J, S) || void 0, [J, S]), X = o && !q, Z = a && !q, he = s((e) => {
|
|
5727
5727
|
for (let t of e) {
|
|
5728
5728
|
let e = U(t.file);
|
|
5729
5729
|
if (e) {
|
|
5730
|
-
|
|
5730
|
+
I(e);
|
|
5731
5731
|
return;
|
|
5732
5732
|
}
|
|
5733
5733
|
}
|
|
5734
|
-
|
|
5734
|
+
I(null);
|
|
5735
5735
|
let t = r ? [...K, ...e] : [e[0]], n = r ? e : [e[0]];
|
|
5736
5736
|
R(n.length === 1 ? _r.srFileAdded(n[0].attributes.targetFilename) : _r.srFilesAdded(n.length)), W || G(t), f?.(t), i === "custom" && g && e.forEach((e) => {
|
|
5737
5737
|
g?.(e);
|
|
@@ -5756,11 +5756,11 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5756
5756
|
W
|
|
5757
5757
|
]), _e = s((e) => {
|
|
5758
5758
|
let t = K.filter((t) => t.fileId !== e);
|
|
5759
|
-
W || G(t), f?.(t), "onTransferCancelled" in
|
|
5759
|
+
W || G(t), f?.(t), "onTransferCancelled" in se && se.onTransferCancelled && se.onTransferCancelled?.(e);
|
|
5760
5760
|
}, [
|
|
5761
5761
|
f,
|
|
5762
5762
|
K,
|
|
5763
|
-
|
|
5763
|
+
se,
|
|
5764
5764
|
W
|
|
5765
5765
|
]), { buildAttributeAccessors: ve } = ti(K, ge), ye = p(() => {
|
|
5766
5766
|
let e = [];
|
|
@@ -5770,7 +5770,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5770
5770
|
Z,
|
|
5771
5771
|
y,
|
|
5772
5772
|
_e
|
|
5773
|
-
]), { totalCount: be, uploadedCount: xe, failedCount: Se } = p(() => Nr(K,
|
|
5773
|
+
]), { totalCount: be, uploadedCount: xe, failedCount: Se } = p(() => Nr(K, P), [K, P]), Ce = _r.fileLabel(be), we = /* @__PURE__ */ _("div", {
|
|
5774
5774
|
className: (0, j.default)("pkt-fileupload", {
|
|
5775
5775
|
"pkt-fileupload--full-width": x,
|
|
5776
5776
|
"pkt-fileupload--error": B,
|
|
@@ -5780,7 +5780,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5780
5780
|
...A ? { inert: "" } : {},
|
|
5781
5781
|
children: /* @__PURE__ */ v(zr.Provider, {
|
|
5782
5782
|
value: {
|
|
5783
|
-
name:
|
|
5783
|
+
name: se.name || "",
|
|
5784
5784
|
multiple: !!r,
|
|
5785
5785
|
id: le
|
|
5786
5786
|
},
|
|
@@ -5799,12 +5799,12 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5799
5799
|
}),
|
|
5800
5800
|
/* @__PURE__ */ _(Br, {
|
|
5801
5801
|
id: le,
|
|
5802
|
-
name:
|
|
5802
|
+
name: se.name || "",
|
|
5803
5803
|
value: K,
|
|
5804
5804
|
onFilesAdded: he,
|
|
5805
5805
|
multiple: r,
|
|
5806
5806
|
uploadStrategy: i,
|
|
5807
|
-
ref:
|
|
5807
|
+
ref: ue,
|
|
5808
5808
|
accept: q ? Pr : Y,
|
|
5809
5809
|
isThumbnailView: q,
|
|
5810
5810
|
disabled: A,
|
|
@@ -5814,7 +5814,7 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5814
5814
|
"aria-describedby": H,
|
|
5815
5815
|
hasVisibleLabel: !!ee
|
|
5816
5816
|
}),
|
|
5817
|
-
B && z && /* @__PURE__ */ _(
|
|
5817
|
+
B && z && /* @__PURE__ */ _(L, {
|
|
5818
5818
|
skin: "error",
|
|
5819
5819
|
"aria-live": "assertive",
|
|
5820
5820
|
role: "alert",
|
|
@@ -5827,12 +5827,12 @@ var gi = r({ tail: 5 }), _i = ({ children: e, tail: t }) => {
|
|
|
5827
5827
|
files: K,
|
|
5828
5828
|
cancelTransfer: _e,
|
|
5829
5829
|
truncateTail: c,
|
|
5830
|
-
transfers:
|
|
5830
|
+
transfers: P,
|
|
5831
5831
|
uploadStrategy: i,
|
|
5832
5832
|
ItemRenderer: me,
|
|
5833
5833
|
enableImagePreview: q && ie,
|
|
5834
5834
|
disabled: A,
|
|
5835
|
-
inputName:
|
|
5835
|
+
inputName: se.name || "",
|
|
5836
5836
|
buildAttributeAccessors: ve,
|
|
5837
5837
|
queueItemOperations: ye
|
|
5838
5838
|
})
|
|
@@ -5881,7 +5881,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
5881
5881
|
href: e.href,
|
|
5882
5882
|
target: e.openInNewTab || a ? "_blank" : "_self",
|
|
5883
5883
|
rel: e.openInNewTab || a ? "noopener noreferrer" : void 0,
|
|
5884
|
-
children: [/* @__PURE__ */ _(
|
|
5884
|
+
children: [/* @__PURE__ */ _(P, {
|
|
5885
5885
|
className: "pkt-footer__link-icon",
|
|
5886
5886
|
name: "chevron-right"
|
|
5887
5887
|
}), e.text]
|
|
@@ -5906,7 +5906,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
5906
5906
|
href: e.href,
|
|
5907
5907
|
target: e.openInNewTab || a ? "_blank" : "_self",
|
|
5908
5908
|
rel: e.openInNewTab || a ? "noopener noreferrer" : void 0,
|
|
5909
|
-
children: [/* @__PURE__ */ _(
|
|
5909
|
+
children: [/* @__PURE__ */ _(P, {
|
|
5910
5910
|
className: "pkt-footer__link-icon",
|
|
5911
5911
|
name: "chevron-right"
|
|
5912
5912
|
}), e.text]
|
|
@@ -5929,7 +5929,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
5929
5929
|
href: o,
|
|
5930
5930
|
target: a ? "_blank" : "_self",
|
|
5931
5931
|
rel: a ? "noopener noreferrer" : void 0,
|
|
5932
|
-
children: [/* @__PURE__ */ _(
|
|
5932
|
+
children: [/* @__PURE__ */ _(P, {
|
|
5933
5933
|
className: "pkt-footer__link-icon",
|
|
5934
5934
|
name: "chevron-right"
|
|
5935
5935
|
}), "Personvern og informasjonskapsler"]
|
|
@@ -5942,7 +5942,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
5942
5942
|
href: s,
|
|
5943
5943
|
target: a ? "_blank" : "_self",
|
|
5944
5944
|
rel: a ? "noopener noreferrer" : void 0,
|
|
5945
|
-
children: [/* @__PURE__ */ _(
|
|
5945
|
+
children: [/* @__PURE__ */ _(P, {
|
|
5946
5946
|
className: "pkt-footer__link-icon",
|
|
5947
5947
|
name: "chevron-right"
|
|
5948
5948
|
}), "Tilgjengelighet"]
|
|
@@ -5988,7 +5988,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
5988
5988
|
className: "pkt-footer__social-icon-link",
|
|
5989
5989
|
target: e.openInNewTab || a ? "_blank" : "_self",
|
|
5990
5990
|
rel: e.openInNewTab || a ? "noopener noreferrer" : void 0,
|
|
5991
|
-
children: /* @__PURE__ */ _(
|
|
5991
|
+
children: /* @__PURE__ */ _(P, {
|
|
5992
5992
|
className: "pkt-footer__social-icon",
|
|
5993
5993
|
name: e.iconName
|
|
5994
5994
|
})
|
|
@@ -6013,7 +6013,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
6013
6013
|
href: e.href,
|
|
6014
6014
|
target: e.openInNewTab || t ? "_blank" : "_self",
|
|
6015
6015
|
rel: e.openInNewTab || t ? "noopener noreferrer" : void 0,
|
|
6016
|
-
children: [/* @__PURE__ */ _(
|
|
6016
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6017
6017
|
className: "pkt-footer-simple__link-icon",
|
|
6018
6018
|
name: "chevron-right"
|
|
6019
6019
|
}), e.text]
|
|
@@ -6026,7 +6026,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
6026
6026
|
href: n,
|
|
6027
6027
|
target: t ? "_blank" : "_self",
|
|
6028
6028
|
rel: t ? "noopener noreferrer" : void 0,
|
|
6029
|
-
children: [/* @__PURE__ */ _(
|
|
6029
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6030
6030
|
className: "pkt-footer-simple__link-icon",
|
|
6031
6031
|
name: "chevron-right"
|
|
6032
6032
|
}), "Personvern og informasjonskapsler"]
|
|
@@ -6039,7 +6039,7 @@ var Bi = ({ columnOne: e, columnTwo: n, socialLinks: r, className: i, openLinksI
|
|
|
6039
6039
|
href: r,
|
|
6040
6040
|
target: t ? "_blank" : "_self",
|
|
6041
6041
|
rel: t ? "noopener noreferrer" : void 0,
|
|
6042
|
-
children: [/* @__PURE__ */ _(
|
|
6042
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6043
6043
|
className: "pkt-footer-simple__link-icon",
|
|
6044
6044
|
name: "chevron-right"
|
|
6045
6045
|
}), "Tilgjengelighet"]
|
|
@@ -6104,7 +6104,7 @@ var Wi = ({ href: e, iconName: t, className: n, iconPosition: r, external: i, ta
|
|
|
6104
6104
|
"pkt-link--icon-left": !!t && r === "left" || !!(t && !r),
|
|
6105
6105
|
"pkt-link--icon-right": !!t && r === "right",
|
|
6106
6106
|
"pkt-link--external": i
|
|
6107
|
-
}, u = /* @__PURE__ */ v(g, { children: [t && /* @__PURE__ */ _(
|
|
6107
|
+
}, u = /* @__PURE__ */ v(g, { children: [t && /* @__PURE__ */ _(P, {
|
|
6108
6108
|
name: t,
|
|
6109
6109
|
className: "pkt-link__icon"
|
|
6110
6110
|
}), s] });
|
|
@@ -6147,7 +6147,7 @@ var Gi = (e) => typeof e.target == "string" ? {
|
|
|
6147
6147
|
onClick: () => {
|
|
6148
6148
|
"onClick" in e && typeof e.onClick == "function" ? e.onClick() : console.error("UserMenuButton item is missing onClick handler or onClick is not a function:", e);
|
|
6149
6149
|
},
|
|
6150
|
-
children: [e.iconName && /* @__PURE__ */ _(
|
|
6150
|
+
children: [e.iconName && /* @__PURE__ */ _(P, {
|
|
6151
6151
|
name: e.iconName,
|
|
6152
6152
|
className: "pkt-link__icon",
|
|
6153
6153
|
"aria-hidden": "true"
|
|
@@ -6247,15 +6247,15 @@ var Gi = (e) => typeof e.target == "string" ? {
|
|
|
6247
6247
|
Ji.displayName = "PktHeaderUserMenu";
|
|
6248
6248
|
//#endregion
|
|
6249
6249
|
//#region src/components/textinput/Textinput.tsx
|
|
6250
|
-
var Yi = a(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, counterMaxLength: a, className: o, disabled: s = !1, errorMessage: c, hasError: u = !1, helptext: d, helptextDropdown: f, helptextDropdownButton: p, iconNameRight: m, inline: g = !1, fullwidth: y = !1, label: b, name: x, optionalTag: S = !1, optionalText: C, requiredTag: w = !1, requiredText: T, tagText: E = null, placeholder: D, prefix: O, suffix: k, type: A = "text", useWrapper: ee = !0, omitSearchIcon: j = !1, value: M, minLength: te, maxLength: ne, min: re, max: ie, step: ae, size: oe, readonly:
|
|
6251
|
-
let
|
|
6250
|
+
var Yi = a(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, counterMaxLength: a, className: o, disabled: s = !1, errorMessage: c, hasError: u = !1, helptext: d, helptextDropdown: f, helptextDropdownButton: p, iconNameRight: m, inline: g = !1, fullwidth: y = !1, label: b, name: x, optionalTag: S = !1, optionalText: C, requiredTag: w = !1, requiredText: T, tagText: E = null, placeholder: D, prefix: O, suffix: k, type: A = "text", useWrapper: ee = !0, omitSearchIcon: j = !1, value: M, minLength: te, maxLength: ne, min: re, max: ie, step: ae, size: oe, readonly: se, required: N, dataTestid: ce, onChange: le, skipForwardTestid: ue = !1, ...F }, I) => {
|
|
6251
|
+
let L = [o, "pkt-textinput"].join(" "), de = A === "search" && !m && !j, R = A === "date" && M ? M.slice(0, 10) : M, [z, B] = h(M?.length || 0), V = `${e}`, H = `${V}-label`, fe = n || H, U = (e) => {
|
|
6252
6252
|
i && B(e.currentTarget?.value?.length || 0), le && le(e);
|
|
6253
6253
|
};
|
|
6254
6254
|
return l(() => {
|
|
6255
6255
|
M !== void 0 && B(M?.length || 0);
|
|
6256
6256
|
}, [M]), /* @__PURE__ */ _(bn, {
|
|
6257
6257
|
ariaDescribedby: t,
|
|
6258
|
-
className:
|
|
6258
|
+
className: L,
|
|
6259
6259
|
disabled: s,
|
|
6260
6260
|
errorMessage: c,
|
|
6261
6261
|
forId: V,
|
|
@@ -6277,15 +6277,15 @@ var Yi = a(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
6277
6277
|
children: /* @__PURE__ */ v("div", {
|
|
6278
6278
|
className: "pkt-input__container",
|
|
6279
6279
|
"data-testid": ce,
|
|
6280
|
-
"data-skip-forward-testid":
|
|
6280
|
+
"data-skip-forward-testid": ue ? "true" : void 0,
|
|
6281
6281
|
children: [
|
|
6282
6282
|
O && /* @__PURE__ */ _("div", {
|
|
6283
6283
|
className: "pkt-input-prefix",
|
|
6284
6284
|
children: O
|
|
6285
6285
|
}),
|
|
6286
6286
|
/* @__PURE__ */ _("input", {
|
|
6287
|
-
...
|
|
6288
|
-
ref:
|
|
6287
|
+
...F,
|
|
6288
|
+
ref: I,
|
|
6289
6289
|
className: `pkt-input ${y ? "pkt-input--fullwidth" : ""} ${a && z > a ? "pkt-input--counter-error" : ""}`,
|
|
6290
6290
|
type: A,
|
|
6291
6291
|
name: `${x || e}`,
|
|
@@ -6304,28 +6304,28 @@ var Yi = a(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
6304
6304
|
minLength: te,
|
|
6305
6305
|
maxLength: ne,
|
|
6306
6306
|
size: oe,
|
|
6307
|
-
readOnly:
|
|
6308
|
-
required:
|
|
6307
|
+
readOnly: se,
|
|
6308
|
+
required: N
|
|
6309
6309
|
}),
|
|
6310
6310
|
k && /* @__PURE__ */ v("p", {
|
|
6311
6311
|
className: "pkt-input-suffix",
|
|
6312
6312
|
children: [
|
|
6313
6313
|
k,
|
|
6314
|
-
m && /* @__PURE__ */ _(
|
|
6314
|
+
m && /* @__PURE__ */ _(P, {
|
|
6315
6315
|
className: "pkt-input-suffix-icon",
|
|
6316
6316
|
name: m
|
|
6317
6317
|
}),
|
|
6318
|
-
de && /* @__PURE__ */ _(
|
|
6318
|
+
de && /* @__PURE__ */ _(P, {
|
|
6319
6319
|
className: "pkt-input-suffix-icon",
|
|
6320
6320
|
name: "magnifying-glass-big"
|
|
6321
6321
|
})
|
|
6322
6322
|
]
|
|
6323
6323
|
}),
|
|
6324
|
-
!k && m && /* @__PURE__ */ _(
|
|
6324
|
+
!k && m && /* @__PURE__ */ _(P, {
|
|
6325
6325
|
className: "pkt-input-icon",
|
|
6326
6326
|
name: m
|
|
6327
6327
|
}),
|
|
6328
|
-
!k && de && /* @__PURE__ */ _(
|
|
6328
|
+
!k && de && /* @__PURE__ */ _(P, {
|
|
6329
6329
|
className: "pkt-input-icon",
|
|
6330
6330
|
name: "magnifying-glass-big"
|
|
6331
6331
|
})
|
|
@@ -6336,8 +6336,10 @@ var Yi = a(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
6336
6336
|
Yi.displayName = "PktTextinput";
|
|
6337
6337
|
//#endregion
|
|
6338
6338
|
//#region src/components/header/HeaderService.tsx
|
|
6339
|
-
var Xi =
|
|
6340
|
-
|
|
6339
|
+
var Xi = "https://punkt-cdn.oslo.kommune.no/16.25/logos/";
|
|
6340
|
+
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || Xi);
|
|
6341
|
+
var Zi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: o = "none", logOut: c, openedMenu: u, showSearch: d = !1, onSearch: f, onSearchChange: y, searchValue: b, searchPlaceholder: x = "Søk", representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: ee, hideLogo: M = !1, logoLink: te, logoClick: ne, logoPath: re = typeof window < "u" ? window.pktLogoPath : Xi, position: ie = "fixed", scrollBehavior: ae = "hide", slotMenuVariant: oe = "icon-only", slotMenuText: se = "Meny" }, N) => {
|
|
6342
|
+
let ce = ie === "fixed", le = ae === "hide";
|
|
6341
6343
|
l(() => {
|
|
6342
6344
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
6343
6345
|
}, [O]), l(() => {
|
|
@@ -6345,86 +6347,86 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6345
6347
|
}, [k]), l(() => {
|
|
6346
6348
|
E?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the user object is deprecated and will be removed in a future version."), S?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the representing object is deprecated and will be removed in a future version.");
|
|
6347
6349
|
}, [E?.shortname, S?.shortname]);
|
|
6348
|
-
let
|
|
6350
|
+
let ue = p(() => {
|
|
6349
6351
|
if (E?.lastLoggedIn) return typeof E.lastLoggedIn == "string" ? E.lastLoggedIn : new Date(E.lastLoggedIn).toLocaleString("nb-NO", {
|
|
6350
6352
|
year: "numeric",
|
|
6351
6353
|
month: "long",
|
|
6352
6354
|
day: "numeric"
|
|
6353
6355
|
});
|
|
6354
|
-
}, [E?.lastLoggedIn]), [
|
|
6356
|
+
}, [E?.lastLoggedIn]), [F, L] = h(u || "none");
|
|
6355
6357
|
l(() => {
|
|
6356
|
-
u !== void 0 &&
|
|
6358
|
+
u !== void 0 && L(u);
|
|
6357
6359
|
}, [u]);
|
|
6358
|
-
let [
|
|
6359
|
-
|
|
6360
|
+
let [de, R] = h(!1), [z, B] = h(0), [V, H] = h(!1), [fe, U] = h(!1), W = m(null), pe = m(null), G = m(null), K = m(null), me = m(null), q = m(null), J = m(null), Y = m(!1), X = Hi(W), Z = X < e, he = X < t, ge = s((e) => {
|
|
6361
|
+
W.current = e, typeof N == "function" ? N(e) : N && (N.current = e);
|
|
6360
6362
|
}, [N]);
|
|
6361
|
-
Ui(
|
|
6362
|
-
let
|
|
6363
|
+
Ui(ce && Z && F !== "none");
|
|
6364
|
+
let _e = s((e, t) => {
|
|
6363
6365
|
let n = e.relatedTarget, r;
|
|
6364
6366
|
switch (t) {
|
|
6365
6367
|
case "user":
|
|
6366
|
-
r =
|
|
6368
|
+
r = pe;
|
|
6367
6369
|
break;
|
|
6368
6370
|
case "slot":
|
|
6369
|
-
r =
|
|
6371
|
+
r = G;
|
|
6370
6372
|
break;
|
|
6371
6373
|
case "search":
|
|
6372
|
-
r =
|
|
6374
|
+
r = K;
|
|
6373
6375
|
break;
|
|
6374
6376
|
default: return;
|
|
6375
6377
|
}
|
|
6376
6378
|
let i = r.current;
|
|
6377
|
-
i && (!n || !i.contains(n)) &&
|
|
6378
|
-
}, []),
|
|
6379
|
-
|
|
6379
|
+
i && (!n || !i.contains(n)) && L("none");
|
|
6380
|
+
}, []), ve = s(() => {
|
|
6381
|
+
Y.current && J.current && document.contains(J.current) && J.current.focus(), J.current = null, Y.current = !1;
|
|
6380
6382
|
}, []);
|
|
6381
6383
|
l(() => {
|
|
6382
6384
|
let e = (e) => {
|
|
6383
|
-
E &&
|
|
6385
|
+
E && F === "user" && !e.target.closest(".pkt-header-service__user-container") && L("none"), F === "slot" && !e.target.closest(".pkt-header-service__slot-container") && L("none"), F === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && L("none");
|
|
6384
6386
|
}, t = (e) => {
|
|
6385
|
-
e.key === "Escape" &&
|
|
6387
|
+
e.key === "Escape" && F !== "none" && (e.preventDefault(), Y.current = !0, L("none"));
|
|
6386
6388
|
};
|
|
6387
|
-
if (
|
|
6389
|
+
if (F !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
6388
6390
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
6389
6391
|
};
|
|
6390
|
-
|
|
6392
|
+
ve();
|
|
6391
6393
|
}, [
|
|
6392
|
-
|
|
6394
|
+
F,
|
|
6393
6395
|
E,
|
|
6394
|
-
|
|
6396
|
+
ve
|
|
6395
6397
|
]), l(() => {
|
|
6396
6398
|
let e = () => {
|
|
6397
|
-
if (
|
|
6399
|
+
if (le) {
|
|
6398
6400
|
let e = window.pageYOffset || document.documentElement.scrollTop;
|
|
6399
|
-
if (e < 0 || Math.abs(e -
|
|
6400
|
-
|
|
6401
|
+
if (e < 0 || Math.abs(e - z) < 60) return;
|
|
6402
|
+
R(e > z), B(e);
|
|
6401
6403
|
}
|
|
6402
6404
|
};
|
|
6403
6405
|
return document && window.addEventListener("scroll", e), () => {
|
|
6404
6406
|
document && window.removeEventListener("scroll", e);
|
|
6405
6407
|
};
|
|
6406
|
-
}, [
|
|
6407
|
-
let
|
|
6408
|
-
let t = e === "slot" ?
|
|
6409
|
-
if (!t.current || !n.current || !
|
|
6408
|
+
}, [le, z]);
|
|
6409
|
+
let ye = s((e) => {
|
|
6410
|
+
let t = e === "slot" ? G : K, n = e === "slot" ? me : q;
|
|
6411
|
+
if (!t.current || !n.current || !he || Z) return;
|
|
6410
6412
|
let r = t.current.getBoundingClientRect(), i = n.current.offsetWidth, a = r.left + i > window.innerWidth;
|
|
6411
|
-
e === "slot" ?
|
|
6412
|
-
}, [
|
|
6413
|
-
if (!
|
|
6413
|
+
e === "slot" ? H(a) : U(a);
|
|
6414
|
+
}, [he, Z]), be = s((e) => {
|
|
6415
|
+
if (!he || F !== "slot") return;
|
|
6414
6416
|
let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
|
|
6415
|
-
!t || !
|
|
6416
|
-
}, [
|
|
6417
|
-
|
|
6418
|
-
}, [
|
|
6417
|
+
!t || !me.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || L("none");
|
|
6418
|
+
}, [he, F]), xe = s((e) => {
|
|
6419
|
+
F === "none" ? (J.current = document.activeElement, L(e)) : L("none");
|
|
6420
|
+
}, [F]);
|
|
6419
6421
|
l(() => {
|
|
6420
|
-
(
|
|
6421
|
-
|
|
6422
|
+
(F === "slot" || F === "search") && requestAnimationFrame(() => {
|
|
6423
|
+
ye(F);
|
|
6422
6424
|
});
|
|
6423
|
-
}, [
|
|
6424
|
-
let
|
|
6425
|
-
className: (0, j.default)("pkt-header-service", i && "pkt-header-service--compact",
|
|
6425
|
+
}, [F, ye]);
|
|
6426
|
+
let Se = /* @__PURE__ */ v("header", {
|
|
6427
|
+
className: (0, j.default)("pkt-header-service", i && "pkt-header-service--compact", Z && "pkt-header-service--mobile", he && "pkt-header-service--tablet", ce && "pkt-header-service--fixed", le && "pkt-header-service--scroll-to-hide", de && "pkt-header-service--hidden", r),
|
|
6426
6428
|
"data-mode": a,
|
|
6427
|
-
ref:
|
|
6429
|
+
ref: ge,
|
|
6428
6430
|
children: [
|
|
6429
6431
|
/* @__PURE__ */ v("div", {
|
|
6430
6432
|
className: (0, j.default)("pkt-header-service__logo-area", (!T || T === "") && "pkt-header-service__logo-area--without-service"),
|
|
@@ -6433,24 +6435,24 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6433
6435
|
children: te ? /* @__PURE__ */ _("a", {
|
|
6434
6436
|
href: te,
|
|
6435
6437
|
"aria-label": "Tilbake til forside",
|
|
6436
|
-
children: /* @__PURE__ */ _(
|
|
6438
|
+
children: /* @__PURE__ */ _(P, {
|
|
6437
6439
|
name: "oslologo",
|
|
6438
6440
|
"aria-hidden": "true",
|
|
6439
|
-
path:
|
|
6441
|
+
path: re
|
|
6440
6442
|
})
|
|
6441
6443
|
}) : ne ? /* @__PURE__ */ _("button", {
|
|
6442
6444
|
"aria-label": "Tilbake til forside",
|
|
6443
6445
|
className: "pkt-link-button pkt-link pkt-header-service__logo-link",
|
|
6444
6446
|
onClick: ne,
|
|
6445
|
-
children: /* @__PURE__ */ _(
|
|
6447
|
+
children: /* @__PURE__ */ _(P, {
|
|
6446
6448
|
name: "oslologo",
|
|
6447
6449
|
"aria-hidden": "true",
|
|
6448
|
-
path:
|
|
6450
|
+
path: re
|
|
6449
6451
|
})
|
|
6450
|
-
}) : /* @__PURE__ */ _(
|
|
6452
|
+
}) : /* @__PURE__ */ _(P, {
|
|
6451
6453
|
name: "oslologo",
|
|
6452
6454
|
"aria-hidden": "true",
|
|
6453
|
-
path:
|
|
6455
|
+
path: re
|
|
6454
6456
|
})
|
|
6455
6457
|
}), T && /* @__PURE__ */ _("span", {
|
|
6456
6458
|
className: "pkt-header-service__service-name",
|
|
@@ -6469,56 +6471,56 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6469
6471
|
})
|
|
6470
6472
|
})]
|
|
6471
6473
|
}),
|
|
6472
|
-
n || d ||
|
|
6474
|
+
n || d || he && c && (o === "header" || o === "both") ? /* @__PURE__ */ v("div", {
|
|
6473
6475
|
className: "pkt-header-service__content",
|
|
6474
6476
|
children: [
|
|
6475
6477
|
/* @__PURE__ */ v("div", {
|
|
6476
|
-
className: (0, j.default)("pkt-header-service__slot-container",
|
|
6477
|
-
onBlur: (e) =>
|
|
6478
|
-
ref:
|
|
6479
|
-
children: [
|
|
6478
|
+
className: (0, j.default)("pkt-header-service__slot-container", F === "slot" && "is-open"),
|
|
6479
|
+
onBlur: (e) => _e(e, "slot"),
|
|
6480
|
+
ref: G,
|
|
6481
|
+
children: [he && n && /* @__PURE__ */ _(I, {
|
|
6480
6482
|
skin: "secondary",
|
|
6481
|
-
variant:
|
|
6483
|
+
variant: oe,
|
|
6482
6484
|
iconName: "menu",
|
|
6483
|
-
size:
|
|
6484
|
-
state:
|
|
6485
|
-
onClick: () =>
|
|
6486
|
-
"aria-expanded":
|
|
6485
|
+
size: Z ? "small" : "medium",
|
|
6486
|
+
state: F === "slot" ? "active" : "normal",
|
|
6487
|
+
onClick: () => xe("slot"),
|
|
6488
|
+
"aria-expanded": F === "slot",
|
|
6487
6489
|
"aria-controls": "mobile-slot-menu",
|
|
6488
6490
|
"aria-label": "Åpne meny",
|
|
6489
|
-
children:
|
|
6491
|
+
children: se
|
|
6490
6492
|
}), /* @__PURE__ */ _("div", {
|
|
6491
|
-
className: (0, j.default)("pkt-header-service__slot-content",
|
|
6493
|
+
className: (0, j.default)("pkt-header-service__slot-content", V && "align-right"),
|
|
6492
6494
|
id: "mobile-slot-menu",
|
|
6493
|
-
role:
|
|
6494
|
-
"aria-label":
|
|
6495
|
-
ref:
|
|
6496
|
-
onClick:
|
|
6495
|
+
role: he ? "menu" : void 0,
|
|
6496
|
+
"aria-label": he ? "Meny" : void 0,
|
|
6497
|
+
ref: me,
|
|
6498
|
+
onClick: be,
|
|
6497
6499
|
children: /* @__PURE__ */ _("div", {
|
|
6498
6500
|
className: "pkt-contents",
|
|
6499
6501
|
children: n
|
|
6500
6502
|
})
|
|
6501
6503
|
})]
|
|
6502
6504
|
}),
|
|
6503
|
-
d && /* @__PURE__ */ _(g, { children:
|
|
6504
|
-
className: (0, j.default)("pkt-header-service__search-container",
|
|
6505
|
-
onBlur: (e) =>
|
|
6506
|
-
ref:
|
|
6507
|
-
children: [/* @__PURE__ */ _(
|
|
6505
|
+
d && /* @__PURE__ */ _(g, { children: he ? /* @__PURE__ */ v("div", {
|
|
6506
|
+
className: (0, j.default)("pkt-header-service__search-container", F === "search" && "is-open"),
|
|
6507
|
+
onBlur: (e) => _e(e, "search"),
|
|
6508
|
+
ref: K,
|
|
6509
|
+
children: [/* @__PURE__ */ _(I, {
|
|
6508
6510
|
skin: "secondary",
|
|
6509
6511
|
variant: "icon-only",
|
|
6510
6512
|
iconName: "magnifying-glass-big",
|
|
6511
|
-
size:
|
|
6512
|
-
onClick: () =>
|
|
6513
|
-
state:
|
|
6514
|
-
"aria-expanded":
|
|
6513
|
+
size: Z ? "small" : "medium",
|
|
6514
|
+
onClick: () => xe("search"),
|
|
6515
|
+
state: F === "search" ? "active" : "normal",
|
|
6516
|
+
"aria-expanded": F === "search",
|
|
6515
6517
|
"aria-controls": "mobile-search-menu",
|
|
6516
6518
|
"aria-label": "Åpne søkefelt",
|
|
6517
6519
|
children: "Søk"
|
|
6518
6520
|
}), /* @__PURE__ */ _("div", {
|
|
6519
|
-
className: (0, j.default)("pkt-header-service__mobile-menu",
|
|
6520
|
-
ref:
|
|
6521
|
-
children:
|
|
6521
|
+
className: (0, j.default)("pkt-header-service__mobile-menu", F === "search" && "is-open", fe && "align-right"),
|
|
6522
|
+
ref: q,
|
|
6523
|
+
children: F === "search" && /* @__PURE__ */ _(Yi, {
|
|
6522
6524
|
id: "mobile-search-menu",
|
|
6523
6525
|
className: "pkt-header-service__search-input",
|
|
6524
6526
|
type: "search",
|
|
@@ -6547,9 +6549,9 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6547
6549
|
e.key === "Enter" && f?.(e.target.value);
|
|
6548
6550
|
}
|
|
6549
6551
|
}) }),
|
|
6550
|
-
|
|
6552
|
+
Z && c && (o === "header" || o === "both") && /* @__PURE__ */ _(I, {
|
|
6551
6553
|
skin: "secondary",
|
|
6552
|
-
size:
|
|
6554
|
+
size: Z ? "small" : "medium",
|
|
6553
6555
|
variant: "icon-only",
|
|
6554
6556
|
iconName: "exit",
|
|
6555
6557
|
onClick: c,
|
|
@@ -6557,21 +6559,21 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6557
6559
|
})
|
|
6558
6560
|
]
|
|
6559
6561
|
}) : null,
|
|
6560
|
-
(E || !
|
|
6562
|
+
(E || !Z && c && (o === "header" || o === "both")) && /* @__PURE__ */ v("div", {
|
|
6561
6563
|
className: "pkt-header-service__user",
|
|
6562
6564
|
children: [E && /* @__PURE__ */ v("div", {
|
|
6563
6565
|
className: "pkt-header-service__user-container",
|
|
6564
|
-
onBlur: (e) =>
|
|
6565
|
-
ref:
|
|
6566
|
-
children: [/* @__PURE__ */ v(
|
|
6567
|
-
className: (0, j.default)("pkt-header-service__user-button",
|
|
6566
|
+
onBlur: (e) => _e(e, "user"),
|
|
6567
|
+
ref: pe,
|
|
6568
|
+
children: [/* @__PURE__ */ v(I, {
|
|
6569
|
+
className: (0, j.default)("pkt-header-service__user-button", Z && "pkt-header-service__user-button--mobile"),
|
|
6568
6570
|
skin: "secondary",
|
|
6569
|
-
size:
|
|
6570
|
-
state:
|
|
6571
|
+
size: Z ? "small" : "medium",
|
|
6572
|
+
state: F === "user" ? "active" : "normal",
|
|
6571
6573
|
variant: "icons-right-and-left",
|
|
6572
6574
|
iconName: "user",
|
|
6573
|
-
secondIconName:
|
|
6574
|
-
onClick: () =>
|
|
6575
|
+
secondIconName: F === "user" ? "chevron-thin-up" : "chevron-thin-down",
|
|
6576
|
+
onClick: () => xe("user"),
|
|
6575
6577
|
children: [/* @__PURE__ */ _("span", {
|
|
6576
6578
|
className: "pkt-sr-only",
|
|
6577
6579
|
children: "Brukermeny: "
|
|
@@ -6579,11 +6581,11 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6579
6581
|
translate: "no",
|
|
6580
6582
|
children: S?.name || E.name
|
|
6581
6583
|
})]
|
|
6582
|
-
}),
|
|
6583
|
-
className: (0, j.default)(
|
|
6584
|
+
}), F === "user" && E && /* @__PURE__ */ _("div", {
|
|
6585
|
+
className: (0, j.default)(Z ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
|
|
6584
6586
|
children: /* @__PURE__ */ _(Ji, {
|
|
6585
6587
|
user: E,
|
|
6586
|
-
formattedLastLoggedIn:
|
|
6588
|
+
formattedLastLoggedIn: ue,
|
|
6587
6589
|
representing: S,
|
|
6588
6590
|
userMenu: D,
|
|
6589
6591
|
canChangeRepresentation: A,
|
|
@@ -6591,7 +6593,7 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6591
6593
|
logoutOnClick: o === "userMenu" || o === "both" ? c : void 0
|
|
6592
6594
|
})
|
|
6593
6595
|
})]
|
|
6594
|
-
}), !
|
|
6596
|
+
}), !Z && c && (o === "header" || o === "both") && /* @__PURE__ */ _(I, {
|
|
6595
6597
|
skin: "tertiary",
|
|
6596
6598
|
size: "medium",
|
|
6597
6599
|
variant: "icon-right",
|
|
@@ -6602,22 +6604,22 @@ var Xi = a(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
6602
6604
|
})
|
|
6603
6605
|
]
|
|
6604
6606
|
});
|
|
6605
|
-
return
|
|
6607
|
+
return ce ? /* @__PURE__ */ v("div", {
|
|
6606
6608
|
className: "pkt-header-service-wrapper",
|
|
6607
|
-
children: [
|
|
6608
|
-
}) :
|
|
6609
|
+
children: [Se, /* @__PURE__ */ _("div", { className: (0, j.default)("pkt-header-service-spacer", i && "pkt-header-service-spacer--compact", E && "pkt-header-service-spacer--has-user", Z && "pkt-header-service-spacer--mobile", he && "pkt-header-service-spacer--tablet") })]
|
|
6610
|
+
}) : Se;
|
|
6609
6611
|
});
|
|
6610
|
-
|
|
6612
|
+
Zi.displayName = "PktHeaderService";
|
|
6611
6613
|
//#endregion
|
|
6612
6614
|
//#region src/components/header/Header.tsx
|
|
6613
|
-
var
|
|
6615
|
+
var Qi = a((e, t) => /* @__PURE__ */ _(Zi, {
|
|
6614
6616
|
...e,
|
|
6615
6617
|
ref: t
|
|
6616
6618
|
}));
|
|
6617
|
-
|
|
6619
|
+
Qi.displayName = "PktHeader";
|
|
6618
6620
|
//#endregion
|
|
6619
6621
|
//#region ../../shared-utils/header-menu/icon-map.ts
|
|
6620
|
-
var
|
|
6622
|
+
var $i = {
|
|
6621
6623
|
automat: "parking-meter",
|
|
6622
6624
|
bike: "bicycle",
|
|
6623
6625
|
corona: "virus",
|
|
@@ -6642,10 +6644,10 @@ var Qi = {
|
|
|
6642
6644
|
treatment: "processing",
|
|
6643
6645
|
"warning-triangle": "alert-warning"
|
|
6644
6646
|
};
|
|
6645
|
-
function
|
|
6646
|
-
return e && (
|
|
6647
|
+
function ea(e) {
|
|
6648
|
+
return e && ($i[e] ?? e);
|
|
6647
6649
|
}
|
|
6648
|
-
var
|
|
6650
|
+
var ta = {
|
|
6649
6651
|
"facebook.com": "facebook",
|
|
6650
6652
|
"fb.com": "facebook",
|
|
6651
6653
|
"instagram.com": "instagram",
|
|
@@ -6653,31 +6655,31 @@ var ea = {
|
|
|
6653
6655
|
"x.com": "x",
|
|
6654
6656
|
"github.com": "github"
|
|
6655
6657
|
};
|
|
6656
|
-
function
|
|
6658
|
+
function na(e) {
|
|
6657
6659
|
return e.toLowerCase().replace(/^(?:www|m)\./, "");
|
|
6658
6660
|
}
|
|
6659
|
-
function
|
|
6661
|
+
function ra(e, t) {
|
|
6660
6662
|
if (e) try {
|
|
6661
|
-
let t =
|
|
6663
|
+
let t = ta[na(new URL(e).hostname)];
|
|
6662
6664
|
if (t) return t;
|
|
6663
6665
|
} catch {}
|
|
6664
6666
|
if (t) {
|
|
6665
6667
|
let e = t.trim().toLowerCase().replace(/\s+/g, "-");
|
|
6666
6668
|
if (e) {
|
|
6667
|
-
let t =
|
|
6669
|
+
let t = ea(e);
|
|
6668
6670
|
if (t) return t;
|
|
6669
6671
|
}
|
|
6670
6672
|
}
|
|
6671
6673
|
}
|
|
6672
6674
|
//#endregion
|
|
6673
6675
|
//#region ../../shared-utils/header-menu/select-megamenu.ts
|
|
6674
|
-
var
|
|
6675
|
-
function
|
|
6676
|
-
if (e) return e[t] ?? e[
|
|
6676
|
+
var ia = "nb-NO";
|
|
6677
|
+
function aa(e, t = ia) {
|
|
6678
|
+
if (e) return e[t] ?? e[ia];
|
|
6677
6679
|
}
|
|
6678
6680
|
//#endregion
|
|
6679
6681
|
//#region ../../shared-utils/header-menu/fetch-header-footer-data.ts
|
|
6680
|
-
async function
|
|
6682
|
+
async function oa(e = hr, t) {
|
|
6681
6683
|
let n = await fetch(e, { signal: t });
|
|
6682
6684
|
if (!n.ok) throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);
|
|
6683
6685
|
let r = await n.json();
|
|
@@ -6686,7 +6688,7 @@ async function aa(e = hr, t) {
|
|
|
6686
6688
|
}
|
|
6687
6689
|
//#endregion
|
|
6688
6690
|
//#region src/components/header-menu/HeaderMenu.tsx
|
|
6689
|
-
var
|
|
6691
|
+
var sa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileBreakpoint: i = 768, ariaLabelledBy: a, className: o, onDataLoaded: s, onDataError: c, ref: u, ...d }) => {
|
|
6690
6692
|
let [f, y] = h(t ? "ready" : "idle"), [b, x] = h(void 0), [S, C] = h(!1), w = m(s), T = m(c);
|
|
6691
6693
|
l(() => {
|
|
6692
6694
|
w.current = s;
|
|
@@ -6703,13 +6705,13 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6703
6705
|
}, [t]), l(() => {
|
|
6704
6706
|
if (t) return;
|
|
6705
6707
|
let n = new AbortController();
|
|
6706
|
-
return y("loading"),
|
|
6708
|
+
return y("loading"), oa(e, n.signal).then((e) => {
|
|
6707
6709
|
n.signal.aborted || (x(e), y("ready"), w.current?.(e));
|
|
6708
6710
|
}).catch((e) => {
|
|
6709
6711
|
e.name !== "AbortError" && (y("error"), T.current?.(e));
|
|
6710
6712
|
}), () => n.abort();
|
|
6711
6713
|
}, [t, e]);
|
|
6712
|
-
let E = t ?? b, D = p(() =>
|
|
6714
|
+
let E = t ?? b, D = p(() => aa(E, n), [E, n]), O = [
|
|
6713
6715
|
"pkt-header-menu",
|
|
6714
6716
|
r && "pkt-header-menu--open",
|
|
6715
6717
|
o
|
|
@@ -6747,38 +6749,38 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6747
6749
|
children: /* @__PURE__ */ v("nav", {
|
|
6748
6750
|
"aria-label": ee,
|
|
6749
6751
|
children: [
|
|
6750
|
-
S ? /* @__PURE__ */ _(
|
|
6752
|
+
S ? /* @__PURE__ */ _(la, {
|
|
6751
6753
|
services: k.services,
|
|
6752
6754
|
sections: k.sections
|
|
6753
6755
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
6754
|
-
/* @__PURE__ */ _(
|
|
6755
|
-
/* @__PURE__ */ _(
|
|
6756
|
+
/* @__PURE__ */ _(ua, { services: k.services }),
|
|
6757
|
+
/* @__PURE__ */ _(da, {
|
|
6756
6758
|
buttons: k.buttons,
|
|
6757
6759
|
mobile: !1
|
|
6758
6760
|
}),
|
|
6759
|
-
/* @__PURE__ */ _(
|
|
6761
|
+
/* @__PURE__ */ _(fa, { sections: k.sections })
|
|
6760
6762
|
] }),
|
|
6761
|
-
/* @__PURE__ */ _(
|
|
6763
|
+
/* @__PURE__ */ _(da, {
|
|
6762
6764
|
buttons: k.buttons,
|
|
6763
6765
|
mobile: !0
|
|
6764
6766
|
}),
|
|
6765
|
-
/* @__PURE__ */ _(
|
|
6767
|
+
/* @__PURE__ */ _(ma, {
|
|
6766
6768
|
links: k.links,
|
|
6767
6769
|
some: k.some
|
|
6768
6770
|
})
|
|
6769
6771
|
]
|
|
6770
6772
|
})
|
|
6771
6773
|
});
|
|
6772
|
-
},
|
|
6774
|
+
}, ca = ({ services: e }) => /* @__PURE__ */ _("ul", {
|
|
6773
6775
|
className: "pkt-header-menu__services-list",
|
|
6774
6776
|
children: e.links.map((e, t) => /* @__PURE__ */ _("li", {
|
|
6775
6777
|
className: "pkt-header-menu__service",
|
|
6776
6778
|
children: /* @__PURE__ */ v("a", {
|
|
6777
6779
|
className: "pkt-header-menu__service-link",
|
|
6778
6780
|
href: e.url,
|
|
6779
|
-
children: [/* @__PURE__ */ _(
|
|
6781
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6780
6782
|
className: "pkt-header-menu__service-icon",
|
|
6781
|
-
name:
|
|
6783
|
+
name: ea(e.icon),
|
|
6782
6784
|
"aria-hidden": "true"
|
|
6783
6785
|
}), /* @__PURE__ */ _("span", {
|
|
6784
6786
|
className: "pkt-header-menu__service-text",
|
|
@@ -6786,47 +6788,47 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6786
6788
|
})]
|
|
6787
6789
|
})
|
|
6788
6790
|
}, `service-${t}`))
|
|
6789
|
-
}),
|
|
6791
|
+
}), la = ({ services: e, sections: t }) => /* @__PURE__ */ _("div", {
|
|
6790
6792
|
className: "pkt-header-menu__sections",
|
|
6791
6793
|
children: /* @__PURE__ */ v(ee, {
|
|
6792
6794
|
className: "pkt-header-menu__sections-inner",
|
|
6793
6795
|
skin: "plus-minus",
|
|
6794
6796
|
name: "header-menu-accordion",
|
|
6795
|
-
children: [/* @__PURE__ */ _(
|
|
6797
|
+
children: [/* @__PURE__ */ _(F, {
|
|
6796
6798
|
className: "pkt-header-menu__section",
|
|
6797
6799
|
skin: "plus-minus",
|
|
6798
6800
|
id: "pkt-header-menu-services",
|
|
6799
6801
|
title: e.title,
|
|
6800
|
-
children: /* @__PURE__ */ _(
|
|
6801
|
-
}), t.map((e, t) => /* @__PURE__ */ _(
|
|
6802
|
+
children: /* @__PURE__ */ _(ca, { services: e })
|
|
6803
|
+
}), t.map((e, t) => /* @__PURE__ */ _(F, {
|
|
6802
6804
|
className: "pkt-header-menu__section",
|
|
6803
6805
|
skin: "plus-minus",
|
|
6804
6806
|
id: `pkt-header-menu-section-${t}`,
|
|
6805
6807
|
title: e.title,
|
|
6806
|
-
children: /* @__PURE__ */ _(
|
|
6808
|
+
children: /* @__PURE__ */ _(pa, { links: e.links })
|
|
6807
6809
|
}, `section-${t}`))]
|
|
6808
6810
|
})
|
|
6809
|
-
}),
|
|
6811
|
+
}), ua = ({ services: e }) => /* @__PURE__ */ v("div", {
|
|
6810
6812
|
className: "pkt-header-menu__services",
|
|
6811
6813
|
children: [/* @__PURE__ */ _("h2", {
|
|
6812
6814
|
className: "pkt-header-menu__services-title",
|
|
6813
6815
|
children: e.title
|
|
6814
|
-
}), /* @__PURE__ */ _(
|
|
6815
|
-
}),
|
|
6816
|
+
}), /* @__PURE__ */ _(ca, { services: e })]
|
|
6817
|
+
}), da = ({ buttons: e, mobile: t }) => !e || e.length === 0 ? null : /* @__PURE__ */ _("div", {
|
|
6816
6818
|
className: ["pkt-header-menu__buttons", t && "pkt-header-menu__buttons--mobile"].filter(Boolean).join(" "),
|
|
6817
6819
|
children: e.map((e, t) => /* @__PURE__ */ v("a", {
|
|
6818
6820
|
className: "pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small",
|
|
6819
6821
|
href: e.url,
|
|
6820
|
-
children: [/* @__PURE__ */ _(
|
|
6822
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6821
6823
|
className: "pkt-btn__icon",
|
|
6822
|
-
name: e.iconName ?
|
|
6824
|
+
name: e.iconName ? ea(e.iconName) : "user",
|
|
6823
6825
|
"aria-hidden": "true"
|
|
6824
6826
|
}), /* @__PURE__ */ _("span", {
|
|
6825
6827
|
className: "pkt-btn__text",
|
|
6826
6828
|
children: e.text
|
|
6827
6829
|
})]
|
|
6828
6830
|
}, `button-${t}`))
|
|
6829
|
-
}),
|
|
6831
|
+
}), fa = ({ sections: e }) => !e || e.length === 0 ? null : /* @__PURE__ */ _("div", {
|
|
6830
6832
|
className: "pkt-header-menu__sections",
|
|
6831
6833
|
children: /* @__PURE__ */ _("div", {
|
|
6832
6834
|
className: "pkt-header-menu__sections-inner",
|
|
@@ -6835,17 +6837,17 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6835
6837
|
children: [/* @__PURE__ */ _("h2", {
|
|
6836
6838
|
className: "pkt-header-menu__section-title",
|
|
6837
6839
|
children: e.title
|
|
6838
|
-
}), /* @__PURE__ */ _(
|
|
6840
|
+
}), /* @__PURE__ */ _(pa, { links: e.links })]
|
|
6839
6841
|
}, `section-${t}`))
|
|
6840
6842
|
})
|
|
6841
|
-
}),
|
|
6843
|
+
}), pa = ({ links: e }) => /* @__PURE__ */ _("ul", {
|
|
6842
6844
|
className: "pkt-header-menu__section-list",
|
|
6843
6845
|
children: e.map((e, t) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _("a", {
|
|
6844
6846
|
className: "pkt-header-menu__section-link",
|
|
6845
6847
|
href: e.url,
|
|
6846
6848
|
children: e.text
|
|
6847
6849
|
}) }, `section-link-${t}`))
|
|
6848
|
-
}),
|
|
6850
|
+
}), ma = ({ links: e, some: t }) => {
|
|
6849
6851
|
let n = e && e.length > 0, r = t && t.length > 0;
|
|
6850
6852
|
return !n && !r ? null : /* @__PURE__ */ v("div", {
|
|
6851
6853
|
className: "pkt-header-menu__footer",
|
|
@@ -6858,21 +6860,21 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6858
6860
|
}) }, `footer-link-${t}`))
|
|
6859
6861
|
}), r && /* @__PURE__ */ _("ul", {
|
|
6860
6862
|
className: "pkt-header-menu__footer-list pkt-header-menu__footer-list--social",
|
|
6861
|
-
children: t.map((e, t) => /* @__PURE__ */ _(
|
|
6863
|
+
children: t.map((e, t) => /* @__PURE__ */ _(ha, { entry: e }, `some-${t}`))
|
|
6862
6864
|
})]
|
|
6863
6865
|
});
|
|
6864
|
-
},
|
|
6865
|
-
let t =
|
|
6866
|
+
}, ha = ({ entry: e }) => {
|
|
6867
|
+
let t = ra(e.url, e.text);
|
|
6866
6868
|
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _("a", {
|
|
6867
6869
|
className: "pkt-header-menu__social-link",
|
|
6868
6870
|
href: e.url,
|
|
6869
6871
|
"aria-label": e.text,
|
|
6870
|
-
children: t ? /* @__PURE__ */ _(
|
|
6872
|
+
children: t ? /* @__PURE__ */ _(P, {
|
|
6871
6873
|
name: t,
|
|
6872
6874
|
"aria-hidden": "true"
|
|
6873
6875
|
}) : /* @__PURE__ */ _("span", { children: e.text })
|
|
6874
6876
|
}) });
|
|
6875
|
-
},
|
|
6877
|
+
}, ga = (e) => {
|
|
6876
6878
|
switch (e) {
|
|
6877
6879
|
case 1: return "xlarge";
|
|
6878
6880
|
case 2: return "large";
|
|
@@ -6882,7 +6884,7 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6882
6884
|
case 6: return "xsmall";
|
|
6883
6885
|
default: return "medium";
|
|
6884
6886
|
}
|
|
6885
|
-
},
|
|
6887
|
+
}, _a = (e) => {
|
|
6886
6888
|
switch (e) {
|
|
6887
6889
|
case 1:
|
|
6888
6890
|
case 2: return "regular";
|
|
@@ -6892,8 +6894,8 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6892
6894
|
case 6: return "medium";
|
|
6893
6895
|
default: return "medium";
|
|
6894
6896
|
}
|
|
6895
|
-
},
|
|
6896
|
-
let l = t ??
|
|
6897
|
+
}, va = a(function({ level: e = 2, size: t, weight: n, visuallyHidden: r, align: i, className: a, children: o, ...s }, c) {
|
|
6898
|
+
let l = t ?? ga(e), u = n ?? _a(e), d = (0, j.default)("pkt-heading", `pkt-heading--${l}`, `pkt-heading--fw-${u}`, i && `pkt-heading--${i}`, r && "pkt-sr-only", a);
|
|
6897
6899
|
return /* @__PURE__ */ _(`h${e}`, {
|
|
6898
6900
|
...s,
|
|
6899
6901
|
ref: c,
|
|
@@ -6902,10 +6904,10 @@ var oa = ({ dataUrl: e = hr, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6902
6904
|
children: o
|
|
6903
6905
|
});
|
|
6904
6906
|
});
|
|
6905
|
-
|
|
6907
|
+
va.displayName = "PktHeading";
|
|
6906
6908
|
//#endregion
|
|
6907
6909
|
//#region src/components/input/Input.tsx
|
|
6908
|
-
var
|
|
6910
|
+
var ya = a(({ label: e, id: t, children: n, ...r }, i) => /* @__PURE__ */ v("div", {
|
|
6909
6911
|
className: "pkt-form-group",
|
|
6910
6912
|
children: [
|
|
6911
6913
|
/* @__PURE__ */ _("label", {
|
|
@@ -6922,10 +6924,10 @@ var va = a(({ label: e, id: t, children: n, ...r }, i) => /* @__PURE__ */ v("div
|
|
|
6922
6924
|
n
|
|
6923
6925
|
]
|
|
6924
6926
|
}));
|
|
6925
|
-
|
|
6927
|
+
ya.displayName = "PktInput";
|
|
6926
6928
|
//#endregion
|
|
6927
6929
|
//#region src/components/linkcard/LinkCard.tsx
|
|
6928
|
-
var
|
|
6930
|
+
var ba = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab: a, external: o, className: s, ...c }) => {
|
|
6929
6931
|
let l = ["pkt-linkcard", t && `pkt-linkcard--${t}`].filter(Boolean).join(" "), u = ["pkt-linkcard__title", o && "pkt-link pkt-link--external"].filter(Boolean).join(" ");
|
|
6930
6932
|
return /* @__PURE__ */ v("a", {
|
|
6931
6933
|
...c,
|
|
@@ -6934,7 +6936,7 @@ var ya = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab:
|
|
|
6934
6936
|
target: a ? "_blank" : "_self",
|
|
6935
6937
|
rel: a ? "noopener noreferrer" : void 0,
|
|
6936
6938
|
children: [
|
|
6937
|
-
i && /* @__PURE__ */ _(
|
|
6939
|
+
i && /* @__PURE__ */ _(P, {
|
|
6938
6940
|
className: "pkt-link__icon",
|
|
6939
6941
|
name: i
|
|
6940
6942
|
}),
|
|
@@ -6951,14 +6953,14 @@ var ya = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab:
|
|
|
6951
6953
|
};
|
|
6952
6954
|
//#endregion
|
|
6953
6955
|
//#region src/components/loader/Loader.tsx
|
|
6954
|
-
|
|
6955
|
-
var
|
|
6956
|
+
ba.displayName = "PktLinkCard", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/16.25/animations/");
|
|
6957
|
+
var xa = (e) => {
|
|
6956
6958
|
switch (e) {
|
|
6957
6959
|
case "blue": return "spinner-blue";
|
|
6958
6960
|
case "rainbow": return "spinner";
|
|
6959
6961
|
default: return "loader";
|
|
6960
6962
|
}
|
|
6961
|
-
},
|
|
6963
|
+
}, Sa = a(function({ delay: e = 0, inline: t = !1, isLoading: n = !0, message: r = null, size: i = "medium", variant: a = "shapes", loadingAnimationPath: o = typeof window < "u" ? window.pktAnimationPath : void 0, className: s, children: c, ...u }, d) {
|
|
6962
6964
|
let [f, p] = h(e === 0);
|
|
6963
6965
|
l(() => {
|
|
6964
6966
|
if (e > 0) {
|
|
@@ -6978,8 +6980,8 @@ var ba = (e) => {
|
|
|
6978
6980
|
className: m,
|
|
6979
6981
|
children: [n && f && /* @__PURE__ */ v("div", {
|
|
6980
6982
|
className: "pkt-loader__spinner",
|
|
6981
|
-
children: [/* @__PURE__ */ _(
|
|
6982
|
-
name:
|
|
6983
|
+
children: [/* @__PURE__ */ _(P, {
|
|
6984
|
+
name: xa(a),
|
|
6983
6985
|
path: o,
|
|
6984
6986
|
className: `pkt-loader__svg pkt-loader__${a}`
|
|
6985
6987
|
}), r && /* @__PURE__ */ _("p", { children: r })]
|
|
@@ -6989,10 +6991,10 @@ var ba = (e) => {
|
|
|
6989
6991
|
})]
|
|
6990
6992
|
});
|
|
6991
6993
|
});
|
|
6992
|
-
|
|
6994
|
+
Sa.displayName = "PktLoader";
|
|
6993
6995
|
//#endregion
|
|
6994
6996
|
//#region src/components/messagebox/Messagebox.tsx
|
|
6995
|
-
var
|
|
6997
|
+
var Ca = ({ children: e, className: t, skin: n, title: r, compact: a, closable: o, onClose: c, ...l }) => {
|
|
6996
6998
|
let [u, d] = h(!1), f = {
|
|
6997
6999
|
"pkt-messagebox": !0,
|
|
6998
7000
|
"pkt-messagebox--compact": a,
|
|
@@ -7013,7 +7015,7 @@ var Sa = ({ children: e, className: t, skin: n, title: r, compact: a, closable:
|
|
|
7013
7015
|
onClick: m,
|
|
7014
7016
|
className: "pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",
|
|
7015
7017
|
"aria-label": "Lukk",
|
|
7016
|
-
children: /* @__PURE__ */ _(
|
|
7018
|
+
children: /* @__PURE__ */ _(P, {
|
|
7017
7019
|
name: "close",
|
|
7018
7020
|
className: "pkt-link__icon"
|
|
7019
7021
|
})
|
|
@@ -7030,10 +7032,10 @@ var Sa = ({ children: e, className: t, skin: n, title: r, compact: a, closable:
|
|
|
7030
7032
|
]
|
|
7031
7033
|
});
|
|
7032
7034
|
};
|
|
7033
|
-
|
|
7035
|
+
Ca.displayName = "PktMessagebox";
|
|
7034
7036
|
//#endregion
|
|
7035
7037
|
//#region src/components/radio/RadioButton.tsx
|
|
7036
|
-
var
|
|
7038
|
+
var wa = a(({ id: e, name: t, label: n, className: r, hasTile: i = !1, disabled: a = !1, checkHelptext: o, hasError: s = !1, defaultChecked: c, checked: l, optionalTag: u, optionalText: d, requiredTag: f, requiredText: p, tagText: m, ...h }, y) => {
|
|
7037
7039
|
let b = [r, "pkt-input-check"].filter(Boolean).join(" "), x = [
|
|
7038
7040
|
"pkt-input-check__input",
|
|
7039
7041
|
i ? "pkt-input-check__input--tile" : "",
|
|
@@ -7085,10 +7087,10 @@ var Ca = a(({ id: e, name: t, label: n, className: r, hasTile: i = !1, disabled:
|
|
|
7085
7087
|
})
|
|
7086
7088
|
});
|
|
7087
7089
|
});
|
|
7088
|
-
|
|
7090
|
+
wa.displayName = "PktRadioButton";
|
|
7089
7091
|
//#endregion
|
|
7090
7092
|
//#region src/components/searchinput/SearchInput.tsx
|
|
7091
|
-
var
|
|
7093
|
+
var Ta = a(({ appearance: e = "local", disabled: t = !1, fullwidth: n = !1, id: r, label: i, name: a, placeholder: o = "Søk…", suggestions: s, value: c = "", action: l, method: u, onChange: d, onSearch: f, onSuggestionClick: p, ...m }, h) => {
|
|
7092
7094
|
let y = (e, t) => {
|
|
7093
7095
|
e ? e() : p && p(t);
|
|
7094
7096
|
}, b = (e) => {
|
|
@@ -7137,7 +7139,7 @@ var wa = a(({ appearance: e = "local", disabled: t = !1, fullwidth: n = !1, id:
|
|
|
7137
7139
|
e.key === "Enter" && (e.preventDefault(), f(c));
|
|
7138
7140
|
}),
|
|
7139
7141
|
...m
|
|
7140
|
-
}), /* @__PURE__ */ _(
|
|
7142
|
+
}), /* @__PURE__ */ _(I, {
|
|
7141
7143
|
className: `pkt-searchinput__button ${e === "local" ? "pkt-input-icon" : ""}`,
|
|
7142
7144
|
variant: "icon-only",
|
|
7143
7145
|
iconName: "magnifying-glass-big",
|
|
@@ -7172,10 +7174,10 @@ var wa = a(({ appearance: e = "local", disabled: t = !1, fullwidth: n = !1, id:
|
|
|
7172
7174
|
})
|
|
7173
7175
|
] }));
|
|
7174
7176
|
});
|
|
7175
|
-
|
|
7177
|
+
Ta.displayName = "PktSearchInput";
|
|
7176
7178
|
//#endregion
|
|
7177
7179
|
//#region src/components/select/Select.tsx
|
|
7178
|
-
var
|
|
7180
|
+
var Ea = a(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r, disabled: i = !1, errorMessage: a, hasError: o, helptext: s, helptextDropdown: c, helptextDropdownButton: l, id: u, inline: d = !1, fullwidth: f = !1, label: p, name: m, optionalTag: h = !1, optionalText: g, requiredTag: v = !1, requiredText: y, tagText: b, ...x }, S) => /* @__PURE__ */ _(bn, {
|
|
7179
7181
|
className: [r, "pkt-select"].join(" "),
|
|
7180
7182
|
forId: `${u}-input`,
|
|
7181
7183
|
label: p,
|
|
@@ -7205,10 +7207,10 @@ var Ta = a(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r,
|
|
|
7205
7207
|
children: n
|
|
7206
7208
|
})
|
|
7207
7209
|
}));
|
|
7208
|
-
|
|
7210
|
+
Ea.displayName = "PktSelect";
|
|
7209
7211
|
//#endregion
|
|
7210
7212
|
//#region src/components/stepper/Step.tsx
|
|
7211
|
-
var
|
|
7213
|
+
var Da = /* @__PURE__ */ _("svg", {
|
|
7212
7214
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7213
7215
|
width: "24",
|
|
7214
7216
|
height: "24",
|
|
@@ -7219,7 +7221,7 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7219
7221
|
r: "7",
|
|
7220
7222
|
style: { fill: "var(--pkt-color-grays-grey-200, #CCC)" }
|
|
7221
7223
|
})
|
|
7222
|
-
}),
|
|
7224
|
+
}), Oa = /* @__PURE__ */ v("svg", {
|
|
7223
7225
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7224
7226
|
width: "24",
|
|
7225
7227
|
height: "24",
|
|
@@ -7236,7 +7238,7 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7236
7238
|
r: "6",
|
|
7237
7239
|
fill: "#2A2859"
|
|
7238
7240
|
})]
|
|
7239
|
-
}),
|
|
7241
|
+
}), ka = /* @__PURE__ */ v("svg", {
|
|
7240
7242
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7241
7243
|
width: "24",
|
|
7242
7244
|
height: "24",
|
|
@@ -7248,7 +7250,7 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7248
7250
|
d: "m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",
|
|
7249
7251
|
fill: "#F1FDFF"
|
|
7250
7252
|
})]
|
|
7251
|
-
}),
|
|
7253
|
+
}), Aa = ({ children: e, className: t, status: n = "incomplete", title: r }) => /* @__PURE__ */ v("li", {
|
|
7252
7254
|
className: (0, j.default)("pkt-step", t, `pkt-step--${n}`),
|
|
7253
7255
|
"data-testid": "pkt-step",
|
|
7254
7256
|
children: [
|
|
@@ -7262,7 +7264,7 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7262
7264
|
}),
|
|
7263
7265
|
/* @__PURE__ */ _("span", {
|
|
7264
7266
|
className: (0, j.default)("pkt-step__indicator"),
|
|
7265
|
-
children: n === "current" ?
|
|
7267
|
+
children: n === "current" ? Oa : n === "completed" ? ka : Da
|
|
7266
7268
|
}),
|
|
7267
7269
|
/* @__PURE__ */ _("span", {
|
|
7268
7270
|
className: "pkt-step__line pkt-step__line--3",
|
|
@@ -7279,7 +7281,7 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7279
7281
|
})]
|
|
7280
7282
|
})
|
|
7281
7283
|
]
|
|
7282
|
-
}),
|
|
7284
|
+
}), ja = a(({ activeStep: t, className: r, children: i, hideNonActiveSteps: a = !1, hideNonActiveStepsContent: s = !0, orientation: c = "vertical", ...l }, u) => {
|
|
7283
7285
|
let d = (0, j.default)(r, "pkt-stepper", c === "horizontal" ? "pkt-stepper--horizontal" : "pkt-stepper--vertical"), f = e.map(i, (e, r) => o(e) ? n(e, { className: (0, j.default)(e.props.className, {
|
|
7284
7286
|
"pkt-step--hideStep": a && r !== t,
|
|
7285
7287
|
"pkt-step--hideContent": s && r !== t
|
|
@@ -7292,10 +7294,10 @@ var Ea = /* @__PURE__ */ _("svg", {
|
|
|
7292
7294
|
children: f
|
|
7293
7295
|
});
|
|
7294
7296
|
});
|
|
7295
|
-
|
|
7297
|
+
ja.displayName = "PktStepper";
|
|
7296
7298
|
//#endregion
|
|
7297
7299
|
//#region src/components/table/Table.tsx
|
|
7298
|
-
var
|
|
7300
|
+
var Ma = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r = !0, children: i, ...a }) => /* @__PURE__ */ _("table", {
|
|
7299
7301
|
"data-testid": "pkt-table",
|
|
7300
7302
|
className: (0, j.default)(e, "pkt-table", {
|
|
7301
7303
|
"pkt-table--responsive": r,
|
|
@@ -7306,36 +7308,36 @@ var ja = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
7306
7308
|
role: "table",
|
|
7307
7309
|
...a,
|
|
7308
7310
|
children: i
|
|
7309
|
-
}),
|
|
7311
|
+
}), Na = ({ id: e, children: t, className: n, ...r }) => /* @__PURE__ */ _("tbody", {
|
|
7310
7312
|
id: e,
|
|
7311
7313
|
className: (0, j.default)(n, "pkt-table__body", {}),
|
|
7312
7314
|
...r,
|
|
7313
7315
|
role: "rowgroup",
|
|
7314
7316
|
children: t
|
|
7315
|
-
}),
|
|
7317
|
+
}), Pa = ({ children: e, className: t, dataLabel: n, ...r }) => /* @__PURE__ */ _("td", {
|
|
7316
7318
|
className: (0, j.default)(t, "pkt-table__data-cell", {}),
|
|
7317
7319
|
"data-label": n,
|
|
7318
7320
|
role: "cell",
|
|
7319
7321
|
"data-testid": "pkt-table__data-cell",
|
|
7320
7322
|
...r,
|
|
7321
7323
|
children: e
|
|
7322
|
-
}),
|
|
7324
|
+
}), Fa = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("thead", {
|
|
7323
7325
|
className: (0, j.default)(e, "pkt-table__header", {}),
|
|
7324
7326
|
role: "rowgroup",
|
|
7325
7327
|
...n,
|
|
7326
7328
|
children: t
|
|
7327
|
-
}),
|
|
7329
|
+
}), Ia = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("th", {
|
|
7328
7330
|
className: (0, j.default)(e, "pkt-table__header-cell", {}),
|
|
7329
7331
|
role: "columnheader",
|
|
7330
7332
|
...n,
|
|
7331
7333
|
children: t
|
|
7332
|
-
}),
|
|
7334
|
+
}), La = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("tr", {
|
|
7333
7335
|
className: (0, j.default)(e, "pkt-table__row", {}),
|
|
7334
7336
|
role: "row",
|
|
7335
7337
|
...n,
|
|
7336
7338
|
children: t
|
|
7337
|
-
}),
|
|
7338
|
-
let { arrowNav: d, registerTabRef: f, handleKeyPress: p, selectTab: m } =
|
|
7339
|
+
}), Ra = a(({ children: e, active: t, disabled: n = !1, href: r, onClick: i, icon: a, controls: o, tag: s, tagSkin: c, index: l = 0 }, u) => {
|
|
7340
|
+
let { arrowNav: d, registerTabRef: f, handleKeyPress: p, selectTab: m } = Ba(), h = !!t && !n, y = {
|
|
7339
7341
|
"aria-selected": d ? h : void 0,
|
|
7340
7342
|
"aria-controls": o,
|
|
7341
7343
|
role: d ? "tab" : void 0,
|
|
@@ -7358,7 +7360,7 @@ var ja = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
7358
7360
|
f(l, e, n), typeof u == "function" ? u(e) : u && (u.current = e);
|
|
7359
7361
|
}
|
|
7360
7362
|
}, b = /* @__PURE__ */ v(g, { children: [
|
|
7361
|
-
a && /* @__PURE__ */ _(
|
|
7363
|
+
a && /* @__PURE__ */ _(P, {
|
|
7362
7364
|
name: a,
|
|
7363
7365
|
className: `pkt-icon--small ${a === "check" ? "pkt-tabs__status-icon" : ""}`
|
|
7364
7366
|
}),
|
|
@@ -7384,14 +7386,14 @@ var ja = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
7384
7386
|
children: b
|
|
7385
7387
|
});
|
|
7386
7388
|
});
|
|
7387
|
-
|
|
7389
|
+
Ra.displayName = "PktTabItem";
|
|
7388
7390
|
//#endregion
|
|
7389
7391
|
//#region src/components/tabs/Tabs.tsx
|
|
7390
|
-
var
|
|
7391
|
-
let e = c(
|
|
7392
|
+
var za = r(null), Ba = () => {
|
|
7393
|
+
let e = c(za);
|
|
7392
7394
|
if (!e) throw Error("TabItem must be used within a Tabs component");
|
|
7393
7395
|
return e;
|
|
7394
|
-
},
|
|
7396
|
+
}, Va = a(({ arrowNav: t = !0, disableArrowNav: n = !1, separatorIconName: r, separatorIconPath: i, tabs: a, onTabSelected: o, children: s }, c) => {
|
|
7395
7397
|
let u = m([]), d = m({}), f = t && !n, p = e.toArray(s), h = p.length > 0, g = h ? p.length : a?.length || 0, v = !!(r || i);
|
|
7396
7398
|
l(() => {
|
|
7397
7399
|
u.current = u.current.slice(0, g), Object.keys(d.current).forEach((e) => {
|
|
@@ -7434,11 +7436,11 @@ var Ra = r(null), za = () => {
|
|
|
7434
7436
|
src: i,
|
|
7435
7437
|
alt: "",
|
|
7436
7438
|
"aria-hidden": "true"
|
|
7437
|
-
}) : r ? /* @__PURE__ */ _(
|
|
7439
|
+
}) : r ? /* @__PURE__ */ _(P, {
|
|
7438
7440
|
name: r,
|
|
7439
7441
|
className: "pkt-tabs__separator-icon"
|
|
7440
7442
|
}) : null
|
|
7441
|
-
}, e), T = (e) => !v || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, w(`separator-${n}`)] : [t]), E = a?.map((e, t) => /* @__PURE__ */ _(
|
|
7443
|
+
}, e), T = (e) => !v || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, w(`separator-${n}`)] : [t]), E = a?.map((e, t) => /* @__PURE__ */ _(Ra, {
|
|
7442
7444
|
active: e.disabled ? !1 : e.active,
|
|
7443
7445
|
disabled: e.disabled,
|
|
7444
7446
|
href: e.href,
|
|
@@ -7449,7 +7451,7 @@ var Ra = r(null), za = () => {
|
|
|
7449
7451
|
index: t,
|
|
7450
7452
|
children: e.text
|
|
7451
7453
|
}, t)), D = ["pkt-tabs", v && "pkt-tabs--with-separator"].filter(Boolean).join(" "), O = T(h ? p : E || []);
|
|
7452
|
-
return /* @__PURE__ */ _(
|
|
7454
|
+
return /* @__PURE__ */ _(za.Provider, {
|
|
7453
7455
|
value: {
|
|
7454
7456
|
arrowNav: f,
|
|
7455
7457
|
registerTabRef: C,
|
|
@@ -7467,25 +7469,25 @@ var Ra = r(null), za = () => {
|
|
|
7467
7469
|
})
|
|
7468
7470
|
});
|
|
7469
7471
|
});
|
|
7470
|
-
|
|
7472
|
+
Va.displayName = "PktTabs";
|
|
7471
7473
|
//#endregion
|
|
7472
7474
|
//#region ../../shared-utils/timepicker/options.ts
|
|
7473
|
-
var
|
|
7475
|
+
var Ha = (e) => e ? Math.max(1, Math.round(e / 60)) : 1, Ua = (e, t) => {
|
|
7474
7476
|
let n = e ? parseInt(String(e).split(":")[0], 10) : 0, r = t ? parseInt(String(t).split(":")[0], 10) : 23;
|
|
7475
7477
|
return Array.from({ length: r - n + 1 }, (e, t) => t + n);
|
|
7476
|
-
},
|
|
7477
|
-
let t =
|
|
7478
|
+
}, Wa = (e) => {
|
|
7479
|
+
let t = Ha(e);
|
|
7478
7480
|
return Array.from({ length: Math.floor(60 / t) }, (e, n) => n * t);
|
|
7479
|
-
},
|
|
7481
|
+
}, Ga = (e, t, n, r) => {
|
|
7480
7482
|
let i = e === "" ? n === 1 ? 0 : 23 : parseInt(e, 10), a = t === "" ? n === 1 ? 0 : Math.floor(59 / r) * r : parseInt(t, 10);
|
|
7481
7483
|
return a += n * r, a > 59 ? (a = 0, i = (i + 1) % 24) : a < 0 && (a = Math.floor(59 / r) * r, i = (i - 1 + 24) % 24), {
|
|
7482
7484
|
hours: String(i).padStart(2, "0"),
|
|
7483
7485
|
minutes: String(a).padStart(2, "0")
|
|
7484
7486
|
};
|
|
7485
|
-
},
|
|
7487
|
+
}, Ka = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && parseInt(e.slice(3), 10) <= 59, qa = (e) => {
|
|
7486
7488
|
let [t, n] = e.split(":").map(Number);
|
|
7487
7489
|
return t * 60 + n;
|
|
7488
|
-
},
|
|
7490
|
+
}, Ja = {
|
|
7489
7491
|
required: "Dette feltet er påkrevd",
|
|
7490
7492
|
invalid: "Ugyldig verdi",
|
|
7491
7493
|
timeStepMismatch: "Må treffe på et steg, for eksempel 0, {step} minutter",
|
|
@@ -7494,66 +7496,66 @@ var Va = (e) => e ? Math.max(1, Math.round(e / 60)) : 1, Ha = (e, t) => {
|
|
|
7494
7496
|
rangeUnderflowMin: "Verdien må være større enn eller lik {min}.",
|
|
7495
7497
|
rangeOverflowMax: "Verdien må være mindre enn eller lik {max}."
|
|
7496
7498
|
};
|
|
7497
|
-
function
|
|
7498
|
-
if (e &&
|
|
7499
|
+
function Ya(e) {
|
|
7500
|
+
if (e && Ka(e)) {
|
|
7499
7501
|
let [t, n] = e.split(":");
|
|
7500
7502
|
return [t, n];
|
|
7501
7503
|
}
|
|
7502
7504
|
return ["", ""];
|
|
7503
7505
|
}
|
|
7504
|
-
function
|
|
7506
|
+
function Xa(e, t) {
|
|
7505
7507
|
return `${String(parseInt(e, 10)).padStart(2, "0")}:${String(parseInt(t, 10)).padStart(2, "0")}`;
|
|
7506
7508
|
}
|
|
7507
|
-
function
|
|
7509
|
+
function Za(e, t) {
|
|
7508
7510
|
let { required: n, min: r, max: i, step: a } = t;
|
|
7509
7511
|
if (n && !e) return {
|
|
7510
7512
|
valid: !1,
|
|
7511
|
-
message:
|
|
7513
|
+
message: Ja.required
|
|
7512
7514
|
};
|
|
7513
7515
|
if (!e) return { valid: !0 };
|
|
7514
|
-
if (!
|
|
7516
|
+
if (!Ka(e)) return {
|
|
7515
7517
|
valid: !1,
|
|
7516
|
-
message:
|
|
7518
|
+
message: Ja.invalid
|
|
7517
7519
|
};
|
|
7518
|
-
let o =
|
|
7519
|
-
return r && o <
|
|
7520
|
+
let o = qa(e), s = Ha(a);
|
|
7521
|
+
return r && o < qa(String(r)) ? {
|
|
7520
7522
|
valid: !1,
|
|
7521
|
-
message:
|
|
7522
|
-
} : i && o >
|
|
7523
|
+
message: Ja.rangeUnderflowMin.replace("{min}", String(r))
|
|
7524
|
+
} : i && o > qa(String(i)) ? {
|
|
7523
7525
|
valid: !1,
|
|
7524
|
-
message:
|
|
7526
|
+
message: Ja.rangeOverflowMax.replace("{max}", String(i))
|
|
7525
7527
|
} : a && o % s !== 0 ? {
|
|
7526
7528
|
valid: !1,
|
|
7527
|
-
message: s === 60 ?
|
|
7529
|
+
message: s === 60 ? Ja.timeStepMismatchHour : s === 30 ? Ja.timeStepMismatchHalfHour : Ja.timeStepMismatch.replace("{step}", `${s}, ${s * 2}, ${s * 3}`)
|
|
7528
7530
|
} : { valid: !0 };
|
|
7529
7531
|
}
|
|
7530
|
-
function
|
|
7532
|
+
function Qa(e) {
|
|
7531
7533
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
7532
7534
|
}
|
|
7533
|
-
function
|
|
7534
|
-
let { id: n, label: r, value: i, defaultValue: a, min: o, max: c, step: u = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: ee, inline: j = !1, useWrapper: M = !0, ariaDescribedby: te, strings: ne, className: re, onValueChange: ie, onFocus: ae, onBlur: oe } = e,
|
|
7535
|
-
z.current = e,
|
|
7535
|
+
function $a(e, t) {
|
|
7536
|
+
let { id: n, label: r, value: i, defaultValue: a, min: o, max: c, step: u = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: ee, inline: j = !1, useWrapper: M = !0, ariaDescribedby: te, strings: ne, className: re, onValueChange: ie, onFocus: ae, onBlur: oe } = e, se = p(() => ne ?? gr, [ne]), N = i !== void 0, ce = i === void 0 ? a ?? "" : i ?? "", le = m(ce), [ue, P] = h(() => ce), F = N ? i ?? "" : ue, [I, L] = h(() => Ya(i === void 0 ? a : i)[0]), [de, R] = h(() => Ya(i === void 0 ? a : i)[1]), z = m(I), B = m(de), V = s((e) => {
|
|
7537
|
+
z.current = e, L(e);
|
|
7536
7538
|
}, []), H = s((e) => {
|
|
7537
7539
|
B.current = e, R(e);
|
|
7538
7540
|
}, []), [fe, U] = h(!1), [W, pe] = h(!1), G = m(i);
|
|
7539
7541
|
l(() => {
|
|
7540
|
-
if (!
|
|
7542
|
+
if (!N || i === G.current) return;
|
|
7541
7543
|
G.current = i;
|
|
7542
|
-
let [e, t] =
|
|
7544
|
+
let [e, t] = Ya(i);
|
|
7543
7545
|
V(e), H(t);
|
|
7544
7546
|
}, [
|
|
7545
7547
|
i,
|
|
7546
|
-
|
|
7548
|
+
N,
|
|
7547
7549
|
V,
|
|
7548
7550
|
H
|
|
7549
7551
|
]), l(() => {
|
|
7550
|
-
u != null && !
|
|
7552
|
+
u != null && !Qa(u) && console.warn(`PktTimepicker: step="${u}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`);
|
|
7551
7553
|
}, [u]);
|
|
7552
|
-
let K = m(null), me = m(null), q = m(null), J = m(null), Y = m(null), X = m(null), Z = m(0), he = m(-1), ge = m(0), _e = m(-1), [ve, ye] = h(!1), be = p(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), xe = p(() =>
|
|
7554
|
+
let K = m(null), me = m(null), q = m(null), J = m(null), Y = m(null), X = m(null), Z = m(0), he = m(-1), ge = m(0), _e = m(-1), [ve, ye] = h(!1), be = p(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), xe = p(() => Ha(u), [u]), Se = p(() => Ua(o, c), [o, c]), Ce = p(() => Wa(u), [u]), we = `${n}-hours`, Te = `${n}-minutes`, Ee = `${n}-popup`, De = `${n}-input`;
|
|
7553
7555
|
l(() => {
|
|
7554
7556
|
let e = K.current;
|
|
7555
7557
|
if (!e) return;
|
|
7556
|
-
let t =
|
|
7558
|
+
let t = Za(F, {
|
|
7557
7559
|
required: x,
|
|
7558
7560
|
min: o,
|
|
7559
7561
|
max: c,
|
|
@@ -7561,7 +7563,7 @@ function Qa(e, t) {
|
|
|
7561
7563
|
});
|
|
7562
7564
|
e.setCustomValidity(t.valid ? "" : t.message ?? ""), pe(ve && !t.valid);
|
|
7563
7565
|
}, [
|
|
7564
|
-
|
|
7566
|
+
F,
|
|
7565
7567
|
x,
|
|
7566
7568
|
o,
|
|
7567
7569
|
c,
|
|
@@ -7569,30 +7571,30 @@ function Qa(e, t) {
|
|
|
7569
7571
|
ve
|
|
7570
7572
|
]);
|
|
7571
7573
|
let Oe = s((e) => {
|
|
7572
|
-
|
|
7574
|
+
N || P(e);
|
|
7573
7575
|
let t = X.current;
|
|
7574
7576
|
!t || !be || (be.call(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), ie?.(e));
|
|
7575
7577
|
}, [
|
|
7576
|
-
|
|
7578
|
+
N,
|
|
7577
7579
|
be,
|
|
7578
7580
|
ie
|
|
7579
7581
|
]), Q = s(() => {
|
|
7580
7582
|
let e = z.current, t = B.current;
|
|
7581
7583
|
if (e !== "" && t !== "") {
|
|
7582
|
-
let n =
|
|
7583
|
-
n !==
|
|
7584
|
-
} else
|
|
7585
|
-
}, [
|
|
7584
|
+
let n = Xa(e, t);
|
|
7585
|
+
n !== F && Oe(n);
|
|
7586
|
+
} else F !== "" && Oe("");
|
|
7587
|
+
}, [F, Oe]), ke = s(() => {
|
|
7586
7588
|
let e = z.current, t = B.current;
|
|
7587
7589
|
if (e !== "" && t !== "") {
|
|
7588
|
-
let n =
|
|
7589
|
-
n ===
|
|
7590
|
-
} else
|
|
7591
|
-
}, [
|
|
7590
|
+
let n = Xa(e, t);
|
|
7591
|
+
n === F ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe(n);
|
|
7592
|
+
} else F === "" ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe("");
|
|
7593
|
+
}, [F, Oe]), Ae = s(() => {
|
|
7592
7594
|
ye(!0), Q();
|
|
7593
7595
|
let e = K.current, t = X.current;
|
|
7594
7596
|
if (!e) return;
|
|
7595
|
-
let n =
|
|
7597
|
+
let n = Za(t?.value ?? "", {
|
|
7596
7598
|
required: x,
|
|
7597
7599
|
min: o,
|
|
7598
7600
|
max: c,
|
|
@@ -7619,8 +7621,8 @@ function Qa(e, t) {
|
|
|
7619
7621
|
};
|
|
7620
7622
|
return e.addEventListener("pointerdown", n, !0), () => e.removeEventListener("pointerdown", n, !0);
|
|
7621
7623
|
}, [Ae]), l(() => {
|
|
7622
|
-
X.current && (X.current.value =
|
|
7623
|
-
}, [
|
|
7624
|
+
X.current && (X.current.value = F);
|
|
7625
|
+
}, [F]);
|
|
7624
7626
|
let je = s(() => {
|
|
7625
7627
|
U(!1), Q();
|
|
7626
7628
|
}, [Q]);
|
|
@@ -7665,11 +7667,11 @@ function Qa(e, t) {
|
|
|
7665
7667
|
V,
|
|
7666
7668
|
H
|
|
7667
7669
|
]), Pe = s((e) => {
|
|
7668
|
-
let t =
|
|
7669
|
-
V(t.hours), H(t.minutes), `${t.hours}:${t.minutes}` !==
|
|
7670
|
+
let t = Ga(z.current, B.current, e, xe);
|
|
7671
|
+
V(t.hours), H(t.minutes), `${t.hours}:${t.minutes}` !== F && Oe(`${t.hours}:${t.minutes}`);
|
|
7670
7672
|
}, [
|
|
7671
7673
|
xe,
|
|
7672
|
-
|
|
7674
|
+
F,
|
|
7673
7675
|
Oe,
|
|
7674
7676
|
V,
|
|
7675
7677
|
H
|
|
@@ -7682,7 +7684,7 @@ function Qa(e, t) {
|
|
|
7682
7684
|
let t = z.current === "" ? 0 : parseInt(z.current, 10), r = String((t + 1) % 24).padStart(2, "0");
|
|
7683
7685
|
if (V(r), n !== "") {
|
|
7684
7686
|
let e = `${r}:${n}`;
|
|
7685
|
-
e ===
|
|
7687
|
+
e === F ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe(e);
|
|
7686
7688
|
}
|
|
7687
7689
|
break;
|
|
7688
7690
|
}
|
|
@@ -7691,7 +7693,7 @@ function Qa(e, t) {
|
|
|
7691
7693
|
let t = z.current === "" ? 0 : parseInt(z.current, 10), r = String((t - 1 + 24) % 24).padStart(2, "0");
|
|
7692
7694
|
if (V(r), n !== "") {
|
|
7693
7695
|
let e = `${r}:${n}`;
|
|
7694
|
-
e ===
|
|
7696
|
+
e === F ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe(e);
|
|
7695
7697
|
}
|
|
7696
7698
|
break;
|
|
7697
7699
|
}
|
|
@@ -7723,7 +7725,7 @@ function Qa(e, t) {
|
|
|
7723
7725
|
} else e.preventDefault();
|
|
7724
7726
|
}
|
|
7725
7727
|
}, [
|
|
7726
|
-
|
|
7728
|
+
F,
|
|
7727
7729
|
Oe,
|
|
7728
7730
|
V,
|
|
7729
7731
|
ke,
|
|
@@ -7739,7 +7741,7 @@ function Qa(e, t) {
|
|
|
7739
7741
|
let t = B.current === "" ? 0 : parseInt(B.current, 10), r = String((t + xe) % 60).padStart(2, "0");
|
|
7740
7742
|
if (H(r), n !== "") {
|
|
7741
7743
|
let e = `${n}:${r}`;
|
|
7742
|
-
e ===
|
|
7744
|
+
e === F ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe(e);
|
|
7743
7745
|
}
|
|
7744
7746
|
break;
|
|
7745
7747
|
}
|
|
@@ -7748,7 +7750,7 @@ function Qa(e, t) {
|
|
|
7748
7750
|
let t = B.current === "" ? 0 : parseInt(B.current, 10), r = String((t - xe + 60) % 60).padStart(2, "0");
|
|
7749
7751
|
if (H(r), n !== "") {
|
|
7750
7752
|
let e = `${n}:${r}`;
|
|
7751
|
-
e ===
|
|
7753
|
+
e === F ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Oe(e);
|
|
7752
7754
|
}
|
|
7753
7755
|
break;
|
|
7754
7756
|
}
|
|
@@ -7781,7 +7783,7 @@ function Qa(e, t) {
|
|
|
7781
7783
|
}
|
|
7782
7784
|
}, [
|
|
7783
7785
|
xe,
|
|
7784
|
-
|
|
7786
|
+
F,
|
|
7785
7787
|
Oe,
|
|
7786
7788
|
H,
|
|
7787
7789
|
ke,
|
|
@@ -7871,8 +7873,8 @@ function Qa(e, t) {
|
|
|
7871
7873
|
},
|
|
7872
7874
|
set value(e) {
|
|
7873
7875
|
let t = e ?? "";
|
|
7874
|
-
|
|
7875
|
-
let [n, r] =
|
|
7876
|
+
N || P(t);
|
|
7877
|
+
let [n, r] = Ya(t);
|
|
7876
7878
|
V(n), H(r), X.current && (X.current.value = t);
|
|
7877
7879
|
},
|
|
7878
7880
|
focus() {
|
|
@@ -7882,7 +7884,7 @@ function Qa(e, t) {
|
|
|
7882
7884
|
K.current?.blur();
|
|
7883
7885
|
}
|
|
7884
7886
|
}), [
|
|
7885
|
-
|
|
7887
|
+
N,
|
|
7886
7888
|
V,
|
|
7887
7889
|
H
|
|
7888
7890
|
]), l(() => {
|
|
@@ -7890,13 +7892,13 @@ function Qa(e, t) {
|
|
|
7890
7892
|
if (!e) return;
|
|
7891
7893
|
let t = () => {
|
|
7892
7894
|
window.setTimeout(() => {
|
|
7893
|
-
let e = le.current, [t, n] =
|
|
7894
|
-
V(t), H(n),
|
|
7895
|
+
let e = le.current, [t, n] = Ya(e);
|
|
7896
|
+
V(t), H(n), N || P(e), X.current && (X.current.value = e), U(!1), ye(!1);
|
|
7895
7897
|
}, 0);
|
|
7896
7898
|
};
|
|
7897
7899
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
7898
7900
|
}, [
|
|
7899
|
-
|
|
7901
|
+
N,
|
|
7900
7902
|
V,
|
|
7901
7903
|
H
|
|
7902
7904
|
]), {
|
|
@@ -7908,7 +7910,7 @@ function Qa(e, t) {
|
|
|
7908
7910
|
_ ? "pkt-timepicker--stepper" : "",
|
|
7909
7911
|
re ?? ""
|
|
7910
7912
|
].filter(Boolean).join(" "),
|
|
7911
|
-
strings:
|
|
7913
|
+
strings: se,
|
|
7912
7914
|
label: r,
|
|
7913
7915
|
disabled: b,
|
|
7914
7916
|
required: x,
|
|
@@ -7931,7 +7933,7 @@ function Qa(e, t) {
|
|
|
7931
7933
|
min: o,
|
|
7932
7934
|
max: c,
|
|
7933
7935
|
step: u,
|
|
7934
|
-
hours:
|
|
7936
|
+
hours: I,
|
|
7935
7937
|
minutes: de,
|
|
7936
7938
|
hoursId: we,
|
|
7937
7939
|
minutesId: Te,
|
|
@@ -7958,13 +7960,13 @@ function Qa(e, t) {
|
|
|
7958
7960
|
handleClockButtonClick: He,
|
|
7959
7961
|
closePopup: je,
|
|
7960
7962
|
stepTimeDelta: Pe,
|
|
7961
|
-
effectiveValue:
|
|
7963
|
+
effectiveValue: F
|
|
7962
7964
|
};
|
|
7963
7965
|
}
|
|
7964
7966
|
//#endregion
|
|
7965
7967
|
//#region src/components/timepicker/Timepicker.tsx
|
|
7966
|
-
var
|
|
7967
|
-
let { onChange: n, onInput: r } = e, i =
|
|
7968
|
+
var eo = a((e, t) => {
|
|
7969
|
+
let { onChange: n, onInput: r } = e, i = $a(e, t), a = i.strings.hours, o = i.strings.minutes, s = i.label ? `${a}, ${i.label}` : a, c = i.label ? `${o}, ${i.label}` : o, l = (e, t) => {
|
|
7968
7970
|
let n = String(e).padStart(2, "0"), r = e === (t === "hour" ? i.hours === "" ? NaN : parseInt(i.hours, 10) : i.minutes === "" ? NaN : parseInt(i.minutes, 10));
|
|
7969
7971
|
return /* @__PURE__ */ _("button", {
|
|
7970
7972
|
type: "button",
|
|
@@ -8023,7 +8025,7 @@ var $a = a((e, t) => {
|
|
|
8023
8025
|
"aria-label": i.strings.prevTime,
|
|
8024
8026
|
disabled: i.disabled,
|
|
8025
8027
|
onClick: () => i.stepTimeDelta(-1),
|
|
8026
|
-
children: [/* @__PURE__ */ _(
|
|
8028
|
+
children: [/* @__PURE__ */ _(P, { name: "chevron-thin-left" }), /* @__PURE__ */ _("span", {
|
|
8027
8029
|
className: "pkt-btn__text",
|
|
8028
8030
|
children: i.strings.prevTime
|
|
8029
8031
|
})]
|
|
@@ -8090,7 +8092,7 @@ var $a = a((e, t) => {
|
|
|
8090
8092
|
onChange: () => {},
|
|
8091
8093
|
onPaste: (e) => e.preventDefault()
|
|
8092
8094
|
}),
|
|
8093
|
-
i.hidePicker && !i.stepArrows && /* @__PURE__ */ _(
|
|
8095
|
+
i.hidePicker && !i.stepArrows && /* @__PURE__ */ _(P, {
|
|
8094
8096
|
className: "pkt-input-icon pkt-timepicker__icon",
|
|
8095
8097
|
name: "clock",
|
|
8096
8098
|
"aria-hidden": !0
|
|
@@ -8105,7 +8107,7 @@ var $a = a((e, t) => {
|
|
|
8105
8107
|
"aria-controls": i.popupId,
|
|
8106
8108
|
disabled: i.disabled,
|
|
8107
8109
|
onClick: i.handleClockButtonClick,
|
|
8108
|
-
children: [/* @__PURE__ */ _(
|
|
8110
|
+
children: [/* @__PURE__ */ _(P, { name: "clock" }), /* @__PURE__ */ _("span", {
|
|
8109
8111
|
className: "pkt-btn__text",
|
|
8110
8112
|
children: i.strings.openPicker
|
|
8111
8113
|
})]
|
|
@@ -8116,7 +8118,7 @@ var $a = a((e, t) => {
|
|
|
8116
8118
|
"aria-label": i.strings.nextTime,
|
|
8117
8119
|
disabled: i.disabled,
|
|
8118
8120
|
onClick: () => i.stepTimeDelta(1),
|
|
8119
|
-
children: [/* @__PURE__ */ _(
|
|
8121
|
+
children: [/* @__PURE__ */ _(P, { name: "chevron-thin-right" }), /* @__PURE__ */ _("span", {
|
|
8120
8122
|
className: "pkt-btn__text",
|
|
8121
8123
|
children: i.strings.nextTime
|
|
8122
8124
|
})]
|
|
@@ -8165,6 +8167,6 @@ var $a = a((e, t) => {
|
|
|
8165
8167
|
})
|
|
8166
8168
|
});
|
|
8167
8169
|
});
|
|
8168
|
-
|
|
8170
|
+
eo.displayName = "PktTimepicker";
|
|
8169
8171
|
//#endregion
|
|
8170
|
-
export { Rr as FileItem, Ri as ItemRenderers, ee as PktAccordion,
|
|
8172
|
+
export { Rr as FileItem, Ri as ItemRenderers, ee as PktAccordion, F as PktAccordionItem, L as PktAlert, de as PktBackLink, R as PktBreadcrumbs, I as PktButton, fn as PktCalendar, mn as PktCard, hn as PktCheckbox, Gn as PktCombobox, Zn as PktConsent, mr as PktDatepicker, zi as PktFileUpload, Bi as PktFooter, Vi as PktFooterSimple, Qi as PktHeader, sa as PktHeaderMenu, Zi as PktHeaderService, va as PktHeading, yn as PktHelptext, P as PktIcon, ya as PktInput, bn as PktInputWrapper, Wi as PktLink, ba as PktLinkCard, Sa as PktLoader, Ca as PktMessagebox, hi as PktModal, si as PktProgressbar, wa as PktRadioButton, Ta as PktSearchInput, Ea as PktSelect, Aa as PktStep, ja as PktStepper, Ra as PktTabItem, Ma as PktTable, Na as PktTableBody, Pa as PktTableDataCell, Fa as PktTableHeader, Ia as PktTableHeaderCell, La as PktTableRow, Va as PktTabs, pn as PktTag, Hr as PktTextarea, Yi as PktTextinput, eo as PktTimepicker };
|