@oslokommune/punkt-react 19.5.2 → 19.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/inputwrapper/InputWrapper.d.ts +2 -0
- package/dist/components/radio/RadioButton.d.ts +2 -0
- package/dist/components/timepicker/useTimepickerState.d.ts +1 -2
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +196 -185
- package/dist/shared-types/checkbox.d.ts +3 -1
- package/dist/shared-types/size.d.ts +2 -1
- package/package.json +3 -3
- package/src/components/checkbox/Checkbox.test.tsx +24 -0
- package/src/components/checkbox/Checkbox.tsx +4 -1
- package/src/components/inputwrapper/InputWrapper.test.tsx +35 -0
- package/src/components/inputwrapper/InputWrapper.tsx +16 -1
- package/src/components/radio/RadioButton.test.tsx +26 -0
- package/src/components/radio/RadioButton.tsx +6 -1
package/dist/punkt-react.js
CHANGED
|
@@ -62,7 +62,7 @@ var M = /* @__PURE__ */ E(((e, t) => {
|
|
|
62
62
|
return n;
|
|
63
63
|
}) : window.classNames = n;
|
|
64
64
|
})();
|
|
65
|
-
})), N = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json",
|
|
65
|
+
})), N = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", ee = "https://www.oslo.kommune.no", P = {
|
|
66
66
|
headingLevel: 3,
|
|
67
67
|
layout: "vertical",
|
|
68
68
|
skin: "outlined",
|
|
@@ -73,7 +73,7 @@ var M = /* @__PURE__ */ E(((e, t) => {
|
|
|
73
73
|
zoom: !1,
|
|
74
74
|
imageShape: "square",
|
|
75
75
|
restrictImageHeight: !1
|
|
76
|
-
},
|
|
76
|
+
}, te = {
|
|
77
77
|
defaultChecked: !1,
|
|
78
78
|
indeterminate: !1,
|
|
79
79
|
hasTile: !1,
|
|
@@ -84,7 +84,7 @@ var M = /* @__PURE__ */ E(((e, t) => {
|
|
|
84
84
|
labelPosition: "right",
|
|
85
85
|
requiredTag: !1,
|
|
86
86
|
optionalTag: !1
|
|
87
|
-
},
|
|
87
|
+
}, F = {
|
|
88
88
|
devMode: !1,
|
|
89
89
|
i18nLanguage: "nb",
|
|
90
90
|
triggerType: "button"
|
|
@@ -2373,7 +2373,7 @@ function zn(e) {
|
|
|
2373
2373
|
months: T.dates.months,
|
|
2374
2374
|
prevMonth: T.calendar.prevMonth,
|
|
2375
2375
|
nextMonth: T.calendar.nextMonth
|
|
2376
|
-
}), [T]), D = f(() => _ ? rn(_) : nn(), [_]), O = f(() => c ? c.map((e) => typeof e == "string" ? rn(e) : e) : [], [c]), k = t !== void 0, [A, j] = m([]), M = k ? t : A, N = f(() => Tn(M), [M]),
|
|
2376
|
+
}), [T]), D = f(() => _ ? rn(_) : nn(), [_]), O = f(() => c ? c.map((e) => typeof e == "string" ? rn(e) : e) : [], [c]), k = t !== void 0, [A, j] = m([]), M = k ? t : A, N = f(() => Tn(M), [M]), ee = () => {
|
|
2377
2377
|
let e = M.length > 0 && M[0] !== "" ? rn(M[M.length - 1]) : null;
|
|
2378
2378
|
if (e && !isNaN(e.getTime())) return e;
|
|
2379
2379
|
let t = null;
|
|
@@ -2386,10 +2386,10 @@ function zn(e) {
|
|
|
2386
2386
|
!isNaN(e.getTime()) && t < e && (t = e);
|
|
2387
2387
|
}
|
|
2388
2388
|
return t;
|
|
2389
|
-
}, [
|
|
2389
|
+
}, [P, te] = m(() => ee().getFullYear()), [F, I] = m(() => ee().getMonth()), [L, re] = m(() => i && N.length === 2 ? En(N[0], N[1]) : {}), [ie, ae] = m(null), [oe, R] = m(null), z = p(null), se = p([]), B = p(0), [V, ce] = m(!1), [le, H] = m(M);
|
|
2390
2390
|
if (M !== le && (H(M), !V && M.length > 0 && M[0] !== "")) {
|
|
2391
2391
|
let e = rn(M[M.length - 1]);
|
|
2392
|
-
isNaN(e.getTime()) || (
|
|
2392
|
+
isNaN(e.getTime()) || (te(e.getFullYear()), I(e.getMonth()));
|
|
2393
2393
|
}
|
|
2394
2394
|
let [U, ue] = m({
|
|
2395
2395
|
range: i,
|
|
@@ -2414,20 +2414,20 @@ function zn(e) {
|
|
|
2414
2414
|
}, [k, y]), K = o(() => {
|
|
2415
2415
|
b?.();
|
|
2416
2416
|
}, [b]), q = o((e, t) => {
|
|
2417
|
-
|
|
2417
|
+
te(typeof e == "string" ? parseInt(e) : e), I(typeof t == "string" ? parseInt(t) : t), B.current = 0, R(null), se.current = [], ce(!0);
|
|
2418
2418
|
}, []), de = o(() => {
|
|
2419
|
-
let e =
|
|
2419
|
+
let e = F === 0 ? 11 : F - 1, t = F === 0 ? P - 1 : P;
|
|
2420
2420
|
q(t, e);
|
|
2421
2421
|
}, [
|
|
2422
|
+
P,
|
|
2422
2423
|
F,
|
|
2423
|
-
te,
|
|
2424
2424
|
q
|
|
2425
2425
|
]), fe = o(() => {
|
|
2426
|
-
let e =
|
|
2426
|
+
let e = F === 11 ? 0 : F + 1, t = F === 11 ? P + 1 : P;
|
|
2427
2427
|
q(t, e);
|
|
2428
2428
|
}, [
|
|
2429
|
+
P,
|
|
2429
2430
|
F,
|
|
2430
|
-
te,
|
|
2431
2431
|
q
|
|
2432
2432
|
]), pe = o((e) => xn(e, W), [W]), me = o((e, t) => Sn(e, t, W, {
|
|
2433
2433
|
multiple: n,
|
|
@@ -2520,8 +2520,8 @@ function zn(e) {
|
|
|
2520
2520
|
componentId: w,
|
|
2521
2521
|
strings: E,
|
|
2522
2522
|
todayDate: D,
|
|
2523
|
-
year:
|
|
2524
|
-
month:
|
|
2523
|
+
year: P,
|
|
2524
|
+
month: F,
|
|
2525
2525
|
activeSelected: M,
|
|
2526
2526
|
_selected: N,
|
|
2527
2527
|
inRange: L,
|
|
@@ -2940,7 +2940,7 @@ var Yn = i(({ children: e, skin: t = "blue", textStyle: n, size: r = "medium", c
|
|
|
2940
2940
|
Yn.displayName = "PktTag";
|
|
2941
2941
|
//#endregion
|
|
2942
2942
|
//#region src/components/card/Card.tsx
|
|
2943
|
-
var Xn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHover: i =
|
|
2943
|
+
var Xn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHover: i = P.borderOnHover, metaTrail: a, layout: o = P.layout, heading: s = "", headingLevel: c = P.headingLevel, image: l, imageShape: u = P.imageShape, imageAspect: d, restrictImageHeight: f = P.restrictImageHeight, clickCardLink: p, padding: m = P.padding, openLinkInNewTab: h = P.openLinkInNewTab, skin: g = P.skin, subheading: y = "", tagPosition: b = P.tagPosition, zoom: x = P.zoom, tags: S = [], strings: C, ...w }, T) => {
|
|
2944
2944
|
let E = Ce(["card"], C), D = (0, L.default)({
|
|
2945
2945
|
"pkt-card": !0,
|
|
2946
2946
|
[`pkt-card--${g}`]: g,
|
|
@@ -2984,17 +2984,17 @@ var Xn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHove
|
|
|
2984
2984
|
rel: h ? "noopener noreferrer" : void 0,
|
|
2985
2985
|
children: s
|
|
2986
2986
|
})
|
|
2987
|
-
}) : null,
|
|
2987
|
+
}) : null, ee = () => y ? /* @__PURE__ */ _("p", {
|
|
2988
2988
|
className: "pkt-card__subheading",
|
|
2989
2989
|
children: y
|
|
2990
|
-
}) : null,
|
|
2990
|
+
}) : null, te = () => !s && !y ? null : /* @__PURE__ */ v("header", {
|
|
2991
2991
|
className: "pkt-card__header",
|
|
2992
2992
|
children: [
|
|
2993
2993
|
M(),
|
|
2994
2994
|
N(),
|
|
2995
|
-
|
|
2995
|
+
ee()
|
|
2996
2996
|
]
|
|
2997
|
-
}),
|
|
2997
|
+
}), F = () => !r && !a ? null : /* @__PURE__ */ v("footer", {
|
|
2998
2998
|
className: "pkt-card__metadata",
|
|
2999
2999
|
children: [r && /* @__PURE__ */ _("span", {
|
|
3000
3000
|
className: "pkt-card__metadata-lead",
|
|
@@ -3013,13 +3013,13 @@ var Xn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHove
|
|
|
3013
3013
|
className: "pkt-card__wrapper",
|
|
3014
3014
|
children: [
|
|
3015
3015
|
b === "top" && j(),
|
|
3016
|
-
|
|
3016
|
+
te(),
|
|
3017
3017
|
/* @__PURE__ */ _("section", {
|
|
3018
3018
|
className: "pkt-card__content",
|
|
3019
3019
|
children: e
|
|
3020
3020
|
}),
|
|
3021
3021
|
b === "bottom" && j(),
|
|
3022
|
-
|
|
3022
|
+
F()
|
|
3023
3023
|
]
|
|
3024
3024
|
})]
|
|
3025
3025
|
});
|
|
@@ -3039,43 +3039,47 @@ function $n(e) {
|
|
|
3039
3039
|
}
|
|
3040
3040
|
//#endregion
|
|
3041
3041
|
//#region src/components/checkbox/Checkbox.tsx
|
|
3042
|
-
var er = i(({ id: e, hasTile: t =
|
|
3043
|
-
let
|
|
3042
|
+
var er = i(({ id: e, hasTile: t = te.hasTile, disabled: n = te.disabled, label: r, checkHelptext: i, hasError: a = te.hasError, className: o, isSwitch: s = te.isSwitch, hideLabel: l = te.hideLabel, labelPosition: u = te.labelPosition, inputSize: d, defaultChecked: f, checked: m, indeterminate: h, optionalTag: y, optionalText: b, requiredTag: x, requiredText: S, strings: C, tagText: w, "aria-describedby": T, ...E }, D) => {
|
|
3043
|
+
let O = Ce(["forms"], C), k = $n(e), A = p(null);
|
|
3044
3044
|
c(() => {
|
|
3045
|
-
|
|
3046
|
-
}, [
|
|
3047
|
-
typeof
|
|
3048
|
-
}, [
|
|
3049
|
-
let
|
|
3045
|
+
A.current && h !== void 0 && (A.current.indeterminate = h);
|
|
3046
|
+
}, [h]), c(() => {
|
|
3047
|
+
typeof D == "function" ? D(A.current) : D && (D.current = A.current);
|
|
3048
|
+
}, [D]);
|
|
3049
|
+
let j = [
|
|
3050
|
+
o,
|
|
3051
|
+
"pkt-input-check",
|
|
3052
|
+
d ? `pkt-input-check--${d}` : ""
|
|
3053
|
+
].filter(Boolean).join(" "), M = [
|
|
3050
3054
|
"pkt-input-check__input-label",
|
|
3051
3055
|
u === "left" ? "pkt-input-check__input-label--left" : "",
|
|
3052
3056
|
n ? "pkt-input-check__input-label--disabled" : "",
|
|
3053
3057
|
`pkt-input-check__input-label--${u}`,
|
|
3054
3058
|
l ? "pkt-sr-only" : ""
|
|
3055
|
-
].filter(Boolean).join(" "),
|
|
3059
|
+
].filter(Boolean).join(" "), N = [
|
|
3056
3060
|
"pkt-input-check__input",
|
|
3057
3061
|
t ? "pkt-input-check__input--tile" : "",
|
|
3058
3062
|
n && t ? "pkt-input-check__input--tile-disabled" : ""
|
|
3059
|
-
].filter(Boolean).join(" "),
|
|
3063
|
+
].filter(Boolean).join(" "), ee = [
|
|
3060
3064
|
"pkt-tag",
|
|
3061
3065
|
"pkt-tag--small",
|
|
3062
3066
|
"pkt-tag--thin-text"
|
|
3063
3067
|
].join(" "), P = () => /* @__PURE__ */ v(g, { children: [
|
|
3064
|
-
|
|
3065
|
-
className:
|
|
3066
|
-
children:
|
|
3068
|
+
w && /* @__PURE__ */ _("span", {
|
|
3069
|
+
className: ee + " pkt-tag--gray",
|
|
3070
|
+
children: w
|
|
3067
3071
|
}),
|
|
3068
|
-
|
|
3069
|
-
className:
|
|
3070
|
-
children:
|
|
3072
|
+
y && /* @__PURE__ */ _("span", {
|
|
3073
|
+
className: ee + " pkt-tag--blue-light",
|
|
3074
|
+
children: b ?? O.forms.optional
|
|
3071
3075
|
}),
|
|
3072
|
-
|
|
3073
|
-
className:
|
|
3074
|
-
children:
|
|
3076
|
+
x && /* @__PURE__ */ _("span", {
|
|
3077
|
+
className: ee + " pkt-tag--beige",
|
|
3078
|
+
children: S ?? O.forms.required
|
|
3075
3079
|
})
|
|
3076
|
-
] }), F = `${
|
|
3077
|
-
className:
|
|
3078
|
-
htmlFor:
|
|
3080
|
+
] }), F = `${k}-check-label`, I = `${k}-check-helptext`, ne = [i ? I : void 0, T].filter(Boolean).join(" ") || void 0, L = () => /* @__PURE__ */ v("label", {
|
|
3081
|
+
className: M,
|
|
3082
|
+
htmlFor: k,
|
|
3079
3083
|
children: [/* @__PURE__ */ v("span", {
|
|
3080
3084
|
id: F,
|
|
3081
3085
|
children: [
|
|
@@ -3084,30 +3088,30 @@ var er = i(({ id: e, hasTile: t = ee.hasTile, disabled: n = ee.disabled, label:
|
|
|
3084
3088
|
P()
|
|
3085
3089
|
]
|
|
3086
3090
|
}), i && /* @__PURE__ */ _("div", {
|
|
3087
|
-
id:
|
|
3091
|
+
id: I,
|
|
3088
3092
|
className: "pkt-input-check__input-helptext",
|
|
3089
3093
|
children: i
|
|
3090
3094
|
})]
|
|
3091
3095
|
});
|
|
3092
3096
|
return /* @__PURE__ */ _("div", {
|
|
3093
|
-
className:
|
|
3097
|
+
className: j,
|
|
3094
3098
|
children: /* @__PURE__ */ v("div", {
|
|
3095
|
-
className:
|
|
3099
|
+
className: N,
|
|
3096
3100
|
children: [
|
|
3097
|
-
u === "left" &&
|
|
3101
|
+
u === "left" && L(),
|
|
3098
3102
|
/* @__PURE__ */ _("input", {
|
|
3099
3103
|
role: s ? "switch" : "checkbox",
|
|
3100
|
-
ref:
|
|
3104
|
+
ref: A,
|
|
3101
3105
|
className: `pkt-input-check__input-checkbox ${a ? "pkt-input-check__input-checkbox--error" : ""}`,
|
|
3102
3106
|
type: "checkbox",
|
|
3103
|
-
id:
|
|
3107
|
+
id: k,
|
|
3104
3108
|
disabled: n,
|
|
3105
3109
|
"aria-labelledby": r ? F : void 0,
|
|
3106
|
-
"aria-describedby":
|
|
3107
|
-
...
|
|
3108
|
-
...
|
|
3110
|
+
"aria-describedby": ne,
|
|
3111
|
+
...m === void 0 ? { defaultChecked: f } : { checked: m },
|
|
3112
|
+
...E
|
|
3109
3113
|
}),
|
|
3110
|
-
u === "right" &&
|
|
3114
|
+
u === "right" && L()
|
|
3111
3115
|
]
|
|
3112
3116
|
})
|
|
3113
3117
|
});
|
|
@@ -3186,19 +3190,19 @@ var nr = (e) => {
|
|
|
3186
3190
|
sr.displayName = "PktHelptext";
|
|
3187
3191
|
//#endregion
|
|
3188
3192
|
//#region src/components/inputwrapper/InputWrapper.tsx
|
|
3189
|
-
var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDropdownButton: i, counter: a, counterCurrent: o = 0, counterMaxLength: s, optionalTag: c = !1, optionalText: l, requiredTag: u = !1, requiredText: d, tagText: p = null, hasError: m = !1, errorMessage: h, disabled: y = !1, inline: b = !1, ariaDescribedby: x, useWrapper: S = !0, children: C, className: w = "", hasFieldset: T = !1,
|
|
3190
|
-
let
|
|
3193
|
+
var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDropdownButton: i, counter: a, counterCurrent: o = 0, counterMaxLength: s, optionalTag: c = !1, optionalText: l, requiredTag: u = !1, requiredText: d, tagText: p = null, hasError: m = !1, errorMessage: h, disabled: y = !1, inline: b = !1, ariaDescribedby: x, useWrapper: S = !0, children: C, className: w = "", hasFieldset: T = !1, layout: E = "vertical", role: D, counterPosition: O = "bottom", size: k = "medium", strings: A }, j) => {
|
|
3194
|
+
let M = tr(j), N = Ce(["forms", "validation"], A), ee = f(() => Qn(), []), P = e || ee, te = [...new Set([x || (n ? `${P}-helptext` : ""), m && h ? `${P}-error` : ""].join(" ").split(" ").filter(Boolean))].join(" ") || void 0, F = !!a, I = F && O === "top", ne = F && O === "bottom", L = [
|
|
3191
3195
|
"pkt-inputwrapper",
|
|
3192
3196
|
w,
|
|
3193
3197
|
m ? "pkt-inputwrapper--error" : "",
|
|
3194
3198
|
y ? "pkt-inputwrapper--disabled" : "",
|
|
3195
3199
|
b ? "pkt-inputwrapper--inline" : "",
|
|
3196
|
-
|
|
3197
|
-
].filter(Boolean).join(" "),
|
|
3200
|
+
k ? `pkt-inputwrapper--${k}` : ""
|
|
3201
|
+
].filter(Boolean).join(" "), re = [
|
|
3198
3202
|
"pkt-tag",
|
|
3199
3203
|
"pkt-tag--small",
|
|
3200
3204
|
"pkt-tag--thin-text"
|
|
3201
|
-
].join(" "),
|
|
3205
|
+
].join(" "), ie = ir(o, s), ae = F ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
3202
3206
|
className: "pkt-input__counter",
|
|
3203
3207
|
"aria-hidden": "true",
|
|
3204
3208
|
children: [o, s ? `/${s}` : ""]
|
|
@@ -3206,28 +3210,28 @@ var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3206
3210
|
className: "pkt-sr-only",
|
|
3207
3211
|
id: rr(P),
|
|
3208
3212
|
"aria-live": "polite",
|
|
3209
|
-
children:
|
|
3213
|
+
children: ie ? G(N.validation.counterExceeded, {
|
|
3210
3214
|
current: o,
|
|
3211
3215
|
max: s ?? 0
|
|
3212
3216
|
}) : ""
|
|
3213
|
-
})] }) : null,
|
|
3217
|
+
})] }) : null, oe = () => /* @__PURE__ */ v(g, { children: [
|
|
3214
3218
|
p && /* @__PURE__ */ _("span", {
|
|
3215
|
-
className:
|
|
3219
|
+
className: re + " pkt-tag--gray",
|
|
3216
3220
|
children: p
|
|
3217
3221
|
}),
|
|
3218
3222
|
c && /* @__PURE__ */ _("span", {
|
|
3219
|
-
className:
|
|
3220
|
-
children: l ??
|
|
3223
|
+
className: re + " pkt-tag--blue-light",
|
|
3224
|
+
children: l ?? N.forms.optional
|
|
3221
3225
|
}),
|
|
3222
3226
|
u && /* @__PURE__ */ _("span", {
|
|
3223
|
-
className:
|
|
3224
|
-
children: d ??
|
|
3227
|
+
className: re + " pkt-tag--beige",
|
|
3228
|
+
children: d ?? N.forms.required
|
|
3225
3229
|
})
|
|
3226
|
-
] }),
|
|
3230
|
+
] }), R = () => {
|
|
3227
3231
|
let e = /* @__PURE__ */ v(g, { children: [
|
|
3228
3232
|
t,
|
|
3229
3233
|
" ",
|
|
3230
|
-
|
|
3234
|
+
oe()
|
|
3231
3235
|
] });
|
|
3232
3236
|
return !S && T ? /* @__PURE__ */ _("legend", {
|
|
3233
3237
|
className: "pkt-sr-only",
|
|
@@ -3248,25 +3252,28 @@ var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3248
3252
|
id: `${P}-label`,
|
|
3249
3253
|
children: t
|
|
3250
3254
|
});
|
|
3251
|
-
},
|
|
3255
|
+
}, z = () => {
|
|
3252
3256
|
let e = S ? n : void 0;
|
|
3253
3257
|
return !e && !r ? null : /* @__PURE__ */ _(sr, {
|
|
3254
3258
|
forId: P,
|
|
3255
3259
|
helptext: e,
|
|
3256
3260
|
helptextDropdown: r,
|
|
3257
|
-
helptextDropdownButton: i ??
|
|
3261
|
+
helptextDropdownButton: i ?? N.forms.readMore
|
|
3258
3262
|
});
|
|
3259
|
-
},
|
|
3260
|
-
oe(),
|
|
3263
|
+
}, se = k === "medium" ? "small" : "xsmall", B = /* @__PURE__ */ v(g, { children: [
|
|
3261
3264
|
R(),
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
+
z(),
|
|
3266
|
+
I && ae,
|
|
3267
|
+
T || E === "horizontal" ? /* @__PURE__ */ _("div", {
|
|
3268
|
+
className: E === "horizontal" ? "pkt-inputwrapper__options pkt-inputwrapper__options--horizontal" : "pkt-inputwrapper__options",
|
|
3269
|
+
children: C
|
|
3270
|
+
}) : C,
|
|
3271
|
+
ne && ae,
|
|
3265
3272
|
m && h && /* @__PURE__ */ _("div", {
|
|
3266
3273
|
className: "pkt-inputwrapper__alert-wrapper",
|
|
3267
3274
|
children: /* @__PURE__ */ _(we, {
|
|
3268
3275
|
skin: "error",
|
|
3269
|
-
size:
|
|
3276
|
+
size: se,
|
|
3270
3277
|
"aria-live": "assertive",
|
|
3271
3278
|
role: "alert",
|
|
3272
3279
|
id: `${P}-error`,
|
|
@@ -3275,17 +3282,17 @@ var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3275
3282
|
})
|
|
3276
3283
|
] });
|
|
3277
3284
|
return /* @__PURE__ */ _("div", {
|
|
3278
|
-
className:
|
|
3279
|
-
role:
|
|
3280
|
-
"aria-labelledby":
|
|
3281
|
-
...
|
|
3285
|
+
className: L,
|
|
3286
|
+
role: D,
|
|
3287
|
+
"aria-labelledby": D ? `${P}-label` : void 0,
|
|
3288
|
+
...M,
|
|
3282
3289
|
children: T ? /* @__PURE__ */ _("fieldset", {
|
|
3283
3290
|
className: "pkt-inputwrapper__fieldset",
|
|
3284
|
-
"aria-describedby":
|
|
3285
|
-
children:
|
|
3291
|
+
"aria-describedby": te,
|
|
3292
|
+
children: B
|
|
3286
3293
|
}) : /* @__PURE__ */ _("div", {
|
|
3287
3294
|
className: "pkt-inputwrapper__fieldset",
|
|
3288
|
-
children:
|
|
3295
|
+
children: B
|
|
3289
3296
|
})
|
|
3290
3297
|
});
|
|
3291
3298
|
});
|
|
@@ -3488,11 +3495,11 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3488
3495
|
o && "pkt-combobox__input--open",
|
|
3489
3496
|
m && "pkt-combobox__input--error",
|
|
3490
3497
|
f && "pkt-combobox__input--disabled"
|
|
3491
|
-
].filter(Boolean).join(" "), N = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "),
|
|
3492
|
-
id:
|
|
3498
|
+
].filter(Boolean).join(" "), N = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), ee = c || l, P = !ee && d && (!i.length || s && u === "outside") && !g, te = u !== "outside", F = o && i[0] && lr(a, i[0]) ? `${r}-${ur(a, i[0])}` : void 0, I = s && i.length > 0 ? `${i.length} valgt` : void 0, ne = nr({
|
|
3499
|
+
id: ee ? n : `${t}-combobox`,
|
|
3493
3500
|
hasHelptext: !!e.helptext,
|
|
3494
3501
|
ariaDescribedby: e.ariaDescribedby
|
|
3495
|
-
}), L =
|
|
3502
|
+
}), L = ee ? { tabIndex: -1 } : {
|
|
3496
3503
|
id: `${t}-combobox`,
|
|
3497
3504
|
"aria-describedby": ne,
|
|
3498
3505
|
role: "combobox",
|
|
@@ -3500,7 +3507,7 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3500
3507
|
"aria-controls": r,
|
|
3501
3508
|
"aria-haspopup": "listbox",
|
|
3502
3509
|
"aria-labelledby": `${t}-combobox-label`,
|
|
3503
|
-
"aria-activedescendant":
|
|
3510
|
+
"aria-activedescendant": F,
|
|
3504
3511
|
"aria-description": I,
|
|
3505
3512
|
tabIndex: f ? -1 : 0,
|
|
3506
3513
|
onKeyDown: k
|
|
@@ -3514,12 +3521,12 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3514
3521
|
},
|
|
3515
3522
|
...L,
|
|
3516
3523
|
children: [
|
|
3517
|
-
|
|
3524
|
+
P ? /* @__PURE__ */ _("span", {
|
|
3518
3525
|
className: "pkt-combobox__placeholder",
|
|
3519
3526
|
onClick: O,
|
|
3520
3527
|
children: d
|
|
3521
|
-
}) :
|
|
3522
|
-
|
|
3528
|
+
}) : te ? s ? /* @__PURE__ */ _(Or, { state: e }) : ee ? null : /* @__PURE__ */ _(kr, { state: e }) : null,
|
|
3529
|
+
ee ? /* @__PURE__ */ _("div", {
|
|
3523
3530
|
className: "pkt-combobox__input-div combobox__input",
|
|
3524
3531
|
children: /* @__PURE__ */ _("input", {
|
|
3525
3532
|
ref: x,
|
|
@@ -3538,7 +3545,7 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3538
3545
|
"aria-label": h,
|
|
3539
3546
|
"aria-autocomplete": c ? "both" : l ? "list" : "none",
|
|
3540
3547
|
"aria-controls": r,
|
|
3541
|
-
"aria-activedescendant":
|
|
3548
|
+
"aria-activedescendant": F,
|
|
3542
3549
|
"aria-description": I,
|
|
3543
3550
|
"aria-describedby": ne,
|
|
3544
3551
|
disabled: f
|
|
@@ -3705,7 +3712,7 @@ function Pr(e, t) {
|
|
|
3705
3712
|
}));
|
|
3706
3713
|
}
|
|
3707
3714
|
function Fr(t, n) {
|
|
3708
|
-
let { id: r = "", label: i, value: s, defaultValue: l, options: d, defaultOptions: h, 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: j, helptextDropdownButton: M, optionalTag: N = !1, optionalText:
|
|
3715
|
+
let { id: r = "", label: i, value: s, defaultValue: l, options: d, defaultOptions: h, 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: j, helptextDropdownButton: M, optionalTag: N = !1, optionalText: ee, requiredTag: P = !1, requiredText: te, tagText: F, useWrapper: I = !0, inline: ne = !1, counter: L, inputSize: re = "medium", name: ie, form: ae, ariaDescribedby: oe, className: R, onChange: z, onValueChange: se, children: B, strings: V } = t, ce = `${r}-input`, le = `${r}-listbox`, H = v || b, U = p(null), ue = p(null), W = p(null), K = p(null), q = p(null), de = Nr(q, ae), fe = o(() => {
|
|
3709
3716
|
H ? U.current?.focus() : W.current?.focus();
|
|
3710
3717
|
}, [H]), pe = o(() => {
|
|
3711
3718
|
Ie(!0);
|
|
@@ -4225,10 +4232,10 @@ function Fr(t, n) {
|
|
|
4225
4232
|
helptextDropdown: j,
|
|
4226
4233
|
helptextDropdownButton: M,
|
|
4227
4234
|
optionalTag: N,
|
|
4228
|
-
optionalText:
|
|
4229
|
-
requiredTag:
|
|
4230
|
-
requiredText:
|
|
4231
|
-
tagText:
|
|
4235
|
+
optionalText: ee,
|
|
4236
|
+
requiredTag: P,
|
|
4237
|
+
requiredText: te,
|
|
4238
|
+
tagText: F,
|
|
4232
4239
|
useWrapper: I,
|
|
4233
4240
|
inline: ne,
|
|
4234
4241
|
inputSize: re,
|
|
@@ -4335,7 +4342,7 @@ var Lr = null, Rr = () => Lr || (Lr = new Promise((e, t) => {
|
|
|
4335
4342
|
} catch {
|
|
4336
4343
|
return e;
|
|
4337
4344
|
}
|
|
4338
|
-
}, Br = (e) => zr(e.value).items.reduce((e, t) => (e[t.name] = t.consent, e), {}), Vr = i(function({ devMode: e =
|
|
4345
|
+
}, Br = (e) => zr(e.value).items.reduce((e, t) => (e[t.name] = t.consent, e), {}), Vr = i(function({ devMode: e = F.devMode, cookieDomain: t = null, cookieSecure: n = null, cookieExpiryDays: r = null, hotjarId: i = null, googleAnalyticsId: a = null, i18nLanguage: o = F.i18nLanguage, triggerType: s = F.triggerType, triggerText: l, onToggleConsent: u, ...d }, f) {
|
|
4339
4346
|
let m = p(u);
|
|
4340
4347
|
m.current = u;
|
|
4341
4348
|
let h = p({
|
|
@@ -4503,7 +4510,7 @@ var Hr = () => {
|
|
|
4503
4510
|
})
|
|
4504
4511
|
});
|
|
4505
4512
|
}, $r = ({ state: e }) => {
|
|
4506
|
-
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, inputToRef: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange:
|
|
4513
|
+
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, inputToRef: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange: ee, handleRangeFromChange: P, handleRangeToChange: te, handleRangeBlur: F, handleMultipleBlur: I, handleTagRemoved: ne, handleSingleKeydown: L, handleRangeFromKeydown: re, handleRangeToKeydown: ie, handleMultipleKeydown: ae, restProps: oe } = e, R = (e) => {
|
|
4507
4514
|
e.preventDefault(), M();
|
|
4508
4515
|
}, z = (e) => {
|
|
4509
4516
|
e.preventDefault(), M();
|
|
@@ -4579,8 +4586,8 @@ var Hr = () => {
|
|
|
4579
4586
|
onTouchEnd: z,
|
|
4580
4587
|
onKeyDown: re,
|
|
4581
4588
|
onFocus: N,
|
|
4582
|
-
onBlur:
|
|
4583
|
-
onChange:
|
|
4589
|
+
onBlur: F,
|
|
4590
|
+
onChange: P
|
|
4584
4591
|
}),
|
|
4585
4592
|
/* @__PURE__ */ _("div", {
|
|
4586
4593
|
className: E,
|
|
@@ -4608,8 +4615,8 @@ var Hr = () => {
|
|
|
4608
4615
|
onTouchEnd: z,
|
|
4609
4616
|
onKeyDown: ie,
|
|
4610
4617
|
onFocus: N,
|
|
4611
|
-
onBlur:
|
|
4612
|
-
onChange:
|
|
4618
|
+
onBlur: F,
|
|
4619
|
+
onChange: te
|
|
4613
4620
|
}),
|
|
4614
4621
|
se()
|
|
4615
4622
|
]
|
|
@@ -4640,7 +4647,7 @@ var Hr = () => {
|
|
|
4640
4647
|
onKeyDown: L,
|
|
4641
4648
|
onFocus: N,
|
|
4642
4649
|
onBlur: void 0,
|
|
4643
|
-
onChange:
|
|
4650
|
+
onChange: ee
|
|
4644
4651
|
}), se()]
|
|
4645
4652
|
})
|
|
4646
4653
|
});
|
|
@@ -4656,7 +4663,7 @@ var Hr = () => {
|
|
|
4656
4663
|
//#endregion
|
|
4657
4664
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4658
4665
|
function ti(e, t) {
|
|
4659
|
-
let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage:
|
|
4666
|
+
let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage: ee, optionalTag: P = !1, optionalText: te, requiredTag: F = !1, requiredText: I, tagText: ne, useWrapper: L = !0, strings: re, disabled: ie = !1, readOnly: ae = !1, required: oe = !1, name: R, min: z, max: se, placeholder: B, onChange: V, onValueChange: ce, className: le, ...H } = e, U = o((e) => e === void 0 ? [] : ei(e), []), ue = i !== void 0, W = typeof a == "number" ? void 0 : a, [G, K] = m(() => U(i ?? W)), q = ue ? U(i) : G, de = p(G), [fe, pe] = m(i);
|
|
4660
4667
|
ue && i !== fe && (pe(i), K(U(i)));
|
|
4661
4668
|
let [me, J] = m(C ?? !1), [Y, he] = m(C);
|
|
4662
4669
|
C !== Y && (he(C), C !== void 0 && J(C));
|
|
@@ -4842,10 +4849,10 @@ function ti(e, t) {
|
|
|
4842
4849
|
helptextDropdown: j,
|
|
4843
4850
|
helptextDropdownButton: M,
|
|
4844
4851
|
hasError: N,
|
|
4845
|
-
errorMessage:
|
|
4846
|
-
optionalTag:
|
|
4847
|
-
optionalText:
|
|
4848
|
-
requiredTag:
|
|
4852
|
+
errorMessage: ee,
|
|
4853
|
+
optionalTag: P,
|
|
4854
|
+
optionalText: te,
|
|
4855
|
+
requiredTag: F,
|
|
4849
4856
|
requiredText: I,
|
|
4850
4857
|
tagText: ne,
|
|
4851
4858
|
useWrapper: L,
|
|
@@ -5217,18 +5224,18 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5217
5224
|
if (e.preventDefault(), E(!1), d) return;
|
|
5218
5225
|
let t = e.dataTransfer.files, n = Array.from(t);
|
|
5219
5226
|
M(n);
|
|
5220
|
-
},
|
|
5227
|
+
}, ee = (e) => {
|
|
5221
5228
|
e.preventDefault(), !d && E(!0);
|
|
5222
|
-
},
|
|
5229
|
+
}, P = () => {
|
|
5223
5230
|
E(!1);
|
|
5224
|
-
},
|
|
5231
|
+
}, te = o((e) => {
|
|
5225
5232
|
d || e.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog") || S.current?.click();
|
|
5226
5233
|
}, [d]);
|
|
5227
5234
|
return /* @__PURE__ */ v("div", {
|
|
5228
5235
|
onDrop: N,
|
|
5229
|
-
onDragOver:
|
|
5230
|
-
onDragLeave:
|
|
5231
|
-
onClick:
|
|
5236
|
+
onDragOver: ee,
|
|
5237
|
+
onDragLeave: P,
|
|
5238
|
+
onClick: te,
|
|
5232
5239
|
className: (0, L.default)("pkt-fileupload__drop-zone", {
|
|
5233
5240
|
"pkt-fileupload__drop-zone--drag-active": T,
|
|
5234
5241
|
"pkt-fileupload__drop-zone--disabled": d
|
|
@@ -5291,7 +5298,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5291
5298
|
let t = new DataTransfer();
|
|
5292
5299
|
for (let n of e) t.items.add(n.file);
|
|
5293
5300
|
return t.files;
|
|
5294
|
-
}, Mi = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, counter: r, hasFieldset: i, counterMaxLength: a, className: o, disabled: s, errorMessage: c, hasError: l = !1, helptext: u, helptextDropdown: d, helptextDropdownButton: f, inline: p, fullwidth: h = !1, label: g, name: v, optionalTag: y = !1, optionalText: b, requiredTag: x = !1, requiredText: S, tagText: C = null, placeholder: w, rows: T, useWrapper: E = !0, onChange: D, value: O, autoComplete: k = "off", minLength: A, maxLength: j, readOnly: M, skipForwardTestid: N = !1, inputSize:
|
|
5301
|
+
}, Mi = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, counter: r, hasFieldset: i, counterMaxLength: a, className: o, disabled: s, errorMessage: c, hasError: l = !1, helptext: u, helptextDropdown: d, helptextDropdownButton: f, inline: p, fullwidth: h = !1, label: g, name: v, optionalTag: y = !1, optionalText: b, requiredTag: x = !1, requiredText: S, tagText: C = null, placeholder: w, rows: T, useWrapper: E = !0, onChange: D, value: O, autoComplete: k = "off", minLength: A, maxLength: j, readOnly: M, skipForwardTestid: N = !1, inputSize: ee = "medium", strings: P, ...te }, F) => {
|
|
5295
5302
|
let I = r ?? (a ?? 0) > 0, ne = [
|
|
5296
5303
|
o,
|
|
5297
5304
|
"pkt-textinput",
|
|
@@ -5302,7 +5309,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5302
5309
|
return /* @__PURE__ */ _("div", {
|
|
5303
5310
|
className: ne,
|
|
5304
5311
|
children: /* @__PURE__ */ _(cr, {
|
|
5305
|
-
strings:
|
|
5312
|
+
strings: P,
|
|
5306
5313
|
ariaDescribedby: t,
|
|
5307
5314
|
disabled: s,
|
|
5308
5315
|
errorMessage: c,
|
|
@@ -5323,12 +5330,12 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5323
5330
|
counterCurrent: z,
|
|
5324
5331
|
counterMaxLength: a,
|
|
5325
5332
|
hasFieldset: i ?? !1,
|
|
5326
|
-
size:
|
|
5333
|
+
size: ee,
|
|
5327
5334
|
children: /* @__PURE__ */ _("textarea", {
|
|
5328
5335
|
ref: (e) => {
|
|
5329
|
-
R(e?.value?.length || 0), typeof
|
|
5336
|
+
R(e?.value?.length || 0), typeof F == "function" ? F(e) : F && (F.current = e);
|
|
5330
5337
|
},
|
|
5331
|
-
className: `pkt-input pkt-input--${
|
|
5338
|
+
className: `pkt-input pkt-input--${ee} ${h ? "pkt-input--fullwidth" : ""} ${a && z > a ? "pkt-input--counter-error" : ""}`,
|
|
5332
5339
|
name: `${v || L}`,
|
|
5333
5340
|
id: re,
|
|
5334
5341
|
placeholder: w,
|
|
@@ -5343,7 +5350,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5343
5350
|
hasCounter: I,
|
|
5344
5351
|
ariaDescribedby: t
|
|
5345
5352
|
}),
|
|
5346
|
-
...
|
|
5353
|
+
...te,
|
|
5347
5354
|
onChange: se,
|
|
5348
5355
|
value: O,
|
|
5349
5356
|
autoComplete: k,
|
|
@@ -6159,7 +6166,7 @@ var ca = n({ tail: 5 }), la = ({ children: e, tail: t }) => {
|
|
|
6159
6166
|
}, Aa = {
|
|
6160
6167
|
filename: va,
|
|
6161
6168
|
thumbnail: ya
|
|
6162
|
-
}, ja = i(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: s = !1, truncateTail: d = 4, onFilesChanged: h, onFileUploadRequested: g, extraOperations: y = [], itemRenderer: b = Aa.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: j, helptext: M, helptextDropdown: N, helptextDropdownButton:
|
|
6169
|
+
}, ja = i(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: s = !1, truncateTail: d = 4, onFilesChanged: h, onFileUploadRequested: g, extraOperations: y = [], itemRenderer: b = Aa.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: j, helptext: M, helptextDropdown: N, helptextDropdownButton: ee, optionalTag: P, optionalText: te, requiredTag: F, requiredText: I, tagText: ne, required: re = !1, enableImagePreview: ie = !1, "aria-describedby": ae, "aria-invalid": oe, strings: R, ...z }, se) => {
|
|
6163
6170
|
let B = l(), V = n ?? `pkt-fileupload-${B}`, ce = p(null);
|
|
6164
6171
|
u(se, () => ce.current, []);
|
|
6165
6172
|
let le = "transfers" in z ? z.transfers : void 0, H = Ce(["fileupload"], R).fileupload, [U, ue] = m(null), [W, q] = m("");
|
|
@@ -6342,12 +6349,12 @@ var ca = n({ tail: 5 }), la = ({ children: e, tail: t }) => {
|
|
|
6342
6349
|
label: j ?? "",
|
|
6343
6350
|
helptext: M,
|
|
6344
6351
|
helptextDropdown: N,
|
|
6345
|
-
helptextDropdownButton:
|
|
6352
|
+
helptextDropdownButton: ee,
|
|
6346
6353
|
disabled: A,
|
|
6347
6354
|
hasError: fe,
|
|
6348
|
-
optionalTag:
|
|
6349
|
-
optionalText:
|
|
6350
|
-
requiredTag:
|
|
6355
|
+
optionalTag: P,
|
|
6356
|
+
optionalText: te,
|
|
6357
|
+
requiredTag: F,
|
|
6351
6358
|
requiredText: I,
|
|
6352
6359
|
tagText: ne,
|
|
6353
6360
|
className: (0, L.default)("pkt-fileupload-wrapper", { "pkt-fileupload-wrapper--full-width": x }),
|
|
@@ -6872,31 +6879,31 @@ var lo = ({ dataUrl: e = N, data: t, locale: n = "nb-NO", open: r = !1, mobileBr
|
|
|
6872
6879
|
children: y.menuLoadError
|
|
6873
6880
|
})
|
|
6874
6881
|
});
|
|
6875
|
-
let { megamenu:
|
|
6882
|
+
let { megamenu: ee, i18n: P } = j, te = P?.navAriaLabel || "Hovedmeny";
|
|
6876
6883
|
return /* @__PURE__ */ v("nav", {
|
|
6877
6884
|
...h,
|
|
6878
6885
|
ref: O,
|
|
6879
6886
|
className: M,
|
|
6880
|
-
"aria-label":
|
|
6887
|
+
"aria-label": te,
|
|
6881
6888
|
children: [
|
|
6882
6889
|
k ? /* @__PURE__ */ _(fo, {
|
|
6883
|
-
services:
|
|
6884
|
-
sections:
|
|
6890
|
+
services: ee.services,
|
|
6891
|
+
sections: ee.sections
|
|
6885
6892
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
6886
|
-
/* @__PURE__ */ _(po, { services:
|
|
6893
|
+
/* @__PURE__ */ _(po, { services: ee.services }),
|
|
6887
6894
|
/* @__PURE__ */ _(mo, {
|
|
6888
|
-
buttons:
|
|
6895
|
+
buttons: ee.buttons,
|
|
6889
6896
|
mobile: !1
|
|
6890
6897
|
}),
|
|
6891
|
-
/* @__PURE__ */ _(ho, { sections:
|
|
6898
|
+
/* @__PURE__ */ _(ho, { sections: ee.sections })
|
|
6892
6899
|
] }),
|
|
6893
6900
|
/* @__PURE__ */ _(mo, {
|
|
6894
|
-
buttons:
|
|
6901
|
+
buttons: ee.buttons,
|
|
6895
6902
|
mobile: !0
|
|
6896
6903
|
}),
|
|
6897
6904
|
/* @__PURE__ */ _(_o, {
|
|
6898
|
-
links:
|
|
6899
|
-
some:
|
|
6905
|
+
links: ee.links,
|
|
6906
|
+
some: ee.some
|
|
6900
6907
|
})
|
|
6901
6908
|
]
|
|
6902
6909
|
});
|
|
@@ -7254,15 +7261,15 @@ wo.displayName = "PktSearchInput";
|
|
|
7254
7261
|
//#region src/components/header/HeaderGlobal.tsx
|
|
7255
7262
|
var To = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7256
7263
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || To);
|
|
7257
|
-
var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "pkt-header-global-search-panel", ko = "pkt-header-global-search-toggle", Ao = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a =
|
|
7258
|
-
let
|
|
7264
|
+
var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "pkt-header-global-search-panel", ko = "pkt-header-global-search-toggle", Ao = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a = ee, logoClick: s, logoPath: l = typeof window < "u" ? window.pktLogoPath : To, showSearch: u = !0, searchPlaceholder: h, onSearch: y, showContact: b = !0, user: x, userMenu: S, representing: C, canChangeRepresentation: w = !1, changeRepresentation: T, logOutButtonPlacement: E = "none", logOut: D, position: O = "fixed", scrollBehavior: k = "hide", mobileBreakpoint: A = 768, tabletBreakpoint: j = 1024, onDataLoaded: M, onDataError: N, strings: P }, te) => {
|
|
7265
|
+
let F = k === "hide", [I, ne] = m("none"), [re, ie] = m(void 0), [ae, oe] = m(!1), R = p(M), z = p(N);
|
|
7259
7266
|
c(() => {
|
|
7260
7267
|
R.current = M;
|
|
7261
7268
|
}, [M]), c(() => {
|
|
7262
7269
|
z.current = N;
|
|
7263
7270
|
}, [N]);
|
|
7264
7271
|
let { setRef: se, isMobile: B, isTablet: V, isFixed: ce, isSticky: le, hidden: U, captureFocus: ue, flagRestoreFocus: W, restoreFocus: G } = so({
|
|
7265
|
-
forwardedRef:
|
|
7272
|
+
forwardedRef: te,
|
|
7266
7273
|
mobileBreakpoint: A,
|
|
7267
7274
|
tabletBreakpoint: j,
|
|
7268
7275
|
position: O,
|
|
@@ -7344,8 +7351,8 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7344
7351
|
});
|
|
7345
7352
|
}, [x?.lastLoggedIn]), me = o((e) => {
|
|
7346
7353
|
ne((t) => t === e ? "none" : (ue(), e));
|
|
7347
|
-
}, [ue]), J = E === "userMenu" || E === "both", Y = Ce(["header"],
|
|
7348
|
-
className: (0, L.default)("pkt-header-global", B && "pkt-header-global--mobile", V && "pkt-header-global--tablet", ce && "pkt-header-global--fixed", le && "pkt-header-global--sticky",
|
|
7354
|
+
}, [ue]), J = E === "userMenu" || E === "both", Y = Ce(["header"], P).header, he = fe?.search, ge = fe?.header?.contact, _e = fe?.i18n?.menu || Y.menu, X = fe?.i18n?.search || Y.search, ve = I === "menu", Z = I === "user", ye = I === "search", be = B, xe = !!(u && he), Se = he?.input.id || "pkt-header-global-search", we = !fe && !ae, Te = /* @__PURE__ */ v("header", {
|
|
7355
|
+
className: (0, L.default)("pkt-header-global", B && "pkt-header-global--mobile", V && "pkt-header-global--tablet", ce && "pkt-header-global--fixed", le && "pkt-header-global--sticky", F && "pkt-header-global--scroll-to-hide", U && "pkt-header-global--hidden", e),
|
|
7349
7356
|
"data-mode": t,
|
|
7350
7357
|
ref: q,
|
|
7351
7358
|
children: [
|
|
@@ -7454,7 +7461,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7454
7461
|
}), Z && /* @__PURE__ */ _("div", {
|
|
7455
7462
|
className: "pkt-header-global__user-menu is-open",
|
|
7456
7463
|
children: /* @__PURE__ */ _(Co, {
|
|
7457
|
-
strings:
|
|
7464
|
+
strings: P,
|
|
7458
7465
|
user: x,
|
|
7459
7466
|
formattedLastLoggedIn: pe,
|
|
7460
7467
|
representing: C,
|
|
@@ -7475,7 +7482,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7475
7482
|
locale: i,
|
|
7476
7483
|
open: !0,
|
|
7477
7484
|
mobileBreakpoint: A,
|
|
7478
|
-
strings:
|
|
7485
|
+
strings: P
|
|
7479
7486
|
}) : /* @__PURE__ */ _("nav", {
|
|
7480
7487
|
className: "pkt-header-menu pkt-header-menu--open",
|
|
7481
7488
|
children: /* @__PURE__ */ _("p", {
|
|
@@ -7520,7 +7527,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7520
7527
|
Ao.displayName = "PktHeaderGlobal";
|
|
7521
7528
|
//#endregion
|
|
7522
7529
|
//#region src/components/textinput/Textinput.tsx
|
|
7523
|
-
var jo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: c = !1, errorMessage: l, hasError: u = !1, helptext: d, helptextDropdown: f, helptextDropdownButton: p, iconNameRight: h, 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: j = !0, omitSearchIcon: M = !1, value: N, minLength:
|
|
7530
|
+
var jo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: c = !1, errorMessage: l, hasError: u = !1, helptext: d, helptextDropdown: f, helptextDropdownButton: p, iconNameRight: h, 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: j = !0, omitSearchIcon: M = !1, value: N, minLength: ee, maxLength: P, min: te, max: F, step: I, size: ne, readonly: L, required: re, dataTestid: ie, onChange: ae, skipForwardTestid: oe = !1, inputSize: R = "medium", strings: z, ...se }, B) => {
|
|
7524
7531
|
let V = i ?? (o ?? 0) > 0, ce = [s, "pkt-textinput"].filter(Boolean).join(" "), le = A === "search" && !h && !M, U = A === "date" && N ? N.slice(0, 10) : N, [ue, W] = m(0), G = N === void 0 ? ue : N?.length || 0, K = $n(e), q = `${K}`, de = `${q}-label`, fe = n || de, pe = (e) => {
|
|
7525
7532
|
V && W(e.currentTarget?.value?.length || 0), ae && ae(e);
|
|
7526
7533
|
};
|
|
@@ -7578,12 +7585,12 @@ var jo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7578
7585
|
ariaDescribedby: t
|
|
7579
7586
|
}),
|
|
7580
7587
|
"aria-labelledby": fe,
|
|
7581
|
-
min:
|
|
7582
|
-
max:
|
|
7588
|
+
min: te,
|
|
7589
|
+
max: F,
|
|
7583
7590
|
onChange: pe,
|
|
7584
7591
|
step: I,
|
|
7585
|
-
minLength:
|
|
7586
|
-
maxLength:
|
|
7592
|
+
minLength: ee,
|
|
7593
|
+
maxLength: P,
|
|
7587
7594
|
size: ne,
|
|
7588
7595
|
readOnly: L,
|
|
7589
7596
|
required: re
|
|
@@ -7620,7 +7627,7 @@ jo.displayName = "PktTextinput";
|
|
|
7620
7627
|
//#region src/components/header/HeaderService.tsx
|
|
7621
7628
|
var Mo = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7622
7629
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || Mo);
|
|
7623
|
-
var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: s = "none", logOut: l, openedMenu: u, showSearch: d = !1, onSearch: h, onSearchChange: y, searchValue: b, searchPlaceholder: x, representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: j, hideLogo: M = !1, logoLink: N =
|
|
7630
|
+
var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: s = "none", logOut: l, openedMenu: u, showSearch: d = !1, onSearch: h, onSearchChange: y, searchValue: b, searchPlaceholder: x, representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: j, hideLogo: M = !1, logoLink: N = ee, logoClick: P, logoPath: te = typeof window < "u" ? window.pktLogoPath : Mo, position: F = "fixed", scrollBehavior: I = "hide", slotMenuVariant: ne = "icon-only", slotMenuText: re, strings: ie }, ae) => {
|
|
7624
7631
|
let oe = I === "hide";
|
|
7625
7632
|
c(() => {
|
|
7626
7633
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
@@ -7643,7 +7650,7 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7643
7650
|
forwardedRef: ae,
|
|
7644
7651
|
mobileBreakpoint: e,
|
|
7645
7652
|
tabletBreakpoint: t,
|
|
7646
|
-
position:
|
|
7653
|
+
position: F,
|
|
7647
7654
|
scrollBehavior: I
|
|
7648
7655
|
});
|
|
7649
7656
|
co((he || ge) && J && B !== "none");
|
|
@@ -7709,11 +7716,11 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7709
7716
|
children: /* @__PURE__ */ _("a", {
|
|
7710
7717
|
href: N,
|
|
7711
7718
|
"aria-label": R.logoLabel,
|
|
7712
|
-
onClick:
|
|
7719
|
+
onClick: P,
|
|
7713
7720
|
children: /* @__PURE__ */ _(H, {
|
|
7714
7721
|
name: "oslologo",
|
|
7715
7722
|
"aria-hidden": "true",
|
|
7716
|
-
path:
|
|
7723
|
+
path: te
|
|
7717
7724
|
})
|
|
7718
7725
|
})
|
|
7719
7726
|
}) : /* @__PURE__ */ _("span", {
|
|
@@ -7723,7 +7730,7 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7723
7730
|
children: /* @__PURE__ */ _(H, {
|
|
7724
7731
|
name: "oslologo",
|
|
7725
7732
|
"aria-hidden": "true",
|
|
7726
|
-
path:
|
|
7733
|
+
path: te
|
|
7727
7734
|
})
|
|
7728
7735
|
})), T && /* @__PURE__ */ _("span", {
|
|
7729
7736
|
className: "pkt-header-service__service-name",
|
|
@@ -8023,58 +8030,62 @@ var zo = ({ children: e, className: t, skin: n, title: i, compact: a, closable:
|
|
|
8023
8030
|
zo.displayName = "PktMessagebox";
|
|
8024
8031
|
//#endregion
|
|
8025
8032
|
//#region src/components/radio/RadioButton.tsx
|
|
8026
|
-
var Bo = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1,
|
|
8027
|
-
let
|
|
8033
|
+
var Bo = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1, inputSize: a, disabled: o = !1, checkHelptext: s, hasError: c = !1, defaultChecked: l, checked: u, optionalTag: d, optionalText: f, requiredTag: p, requiredText: m, strings: h, tagText: y, "aria-describedby": b, ...x }, S) => {
|
|
8034
|
+
let C = Ce(["forms"], h), w = $n(e), T = [
|
|
8035
|
+
r,
|
|
8036
|
+
"pkt-input-check",
|
|
8037
|
+
a ? `pkt-input-check--${a}` : ""
|
|
8038
|
+
].filter(Boolean).join(" "), E = [
|
|
8028
8039
|
"pkt-input-check__input",
|
|
8029
8040
|
i ? "pkt-input-check__input--tile" : "",
|
|
8030
|
-
|
|
8031
|
-
].filter(Boolean).join(" "),
|
|
8041
|
+
o && i ? "pkt-input-check__input--tile-disabled" : ""
|
|
8042
|
+
].filter(Boolean).join(" "), D = ["pkt-input-check__input-checkbox", c ? "pkt-input-check__input-checkbox--error" : ""].filter(Boolean).join(" "), O = ["pkt-input-check__input-label", o ? "pkt-input-check__input-label--disabled" : ""].filter(Boolean).join(" "), k = [
|
|
8032
8043
|
"pkt-tag",
|
|
8033
8044
|
"pkt-tag--small",
|
|
8034
8045
|
"pkt-tag--thin-text"
|
|
8035
|
-
].join(" "),
|
|
8036
|
-
|
|
8037
|
-
className:
|
|
8038
|
-
children:
|
|
8046
|
+
].join(" "), A = () => /* @__PURE__ */ v(g, { children: [
|
|
8047
|
+
y && /* @__PURE__ */ _("span", {
|
|
8048
|
+
className: k + " pkt-tag--gray",
|
|
8049
|
+
children: y
|
|
8039
8050
|
}),
|
|
8040
|
-
|
|
8041
|
-
className:
|
|
8042
|
-
children:
|
|
8051
|
+
d && /* @__PURE__ */ _("span", {
|
|
8052
|
+
className: k + " pkt-tag--blue-light",
|
|
8053
|
+
children: f ?? C.forms.optional
|
|
8043
8054
|
}),
|
|
8044
|
-
|
|
8045
|
-
className:
|
|
8046
|
-
children:
|
|
8055
|
+
p && /* @__PURE__ */ _("span", {
|
|
8056
|
+
className: k + " pkt-tag--beige",
|
|
8057
|
+
children: m ?? C.forms.required
|
|
8047
8058
|
})
|
|
8048
|
-
] }),
|
|
8059
|
+
] }), j = `${w}-check-label`, M = `${w}-check-helptext`, N = [s ? M : void 0, b].filter(Boolean).join(" ") || void 0;
|
|
8049
8060
|
return /* @__PURE__ */ _("div", {
|
|
8050
|
-
className:
|
|
8061
|
+
className: T,
|
|
8051
8062
|
children: /* @__PURE__ */ v("div", {
|
|
8052
|
-
className:
|
|
8063
|
+
className: E,
|
|
8053
8064
|
children: [/* @__PURE__ */ _("input", {
|
|
8054
|
-
ref:
|
|
8055
|
-
id:
|
|
8065
|
+
ref: S,
|
|
8066
|
+
id: w,
|
|
8056
8067
|
type: "radio",
|
|
8057
8068
|
name: t,
|
|
8058
|
-
disabled:
|
|
8059
|
-
className: E,
|
|
8060
|
-
"aria-labelledby": n ? A : void 0,
|
|
8061
|
-
"aria-describedby": M,
|
|
8062
|
-
...l === void 0 ? { defaultChecked: c } : { checked: l },
|
|
8063
|
-
...b
|
|
8064
|
-
}), /* @__PURE__ */ v("label", {
|
|
8069
|
+
disabled: o,
|
|
8065
8070
|
className: D,
|
|
8066
|
-
|
|
8071
|
+
"aria-labelledby": n ? j : void 0,
|
|
8072
|
+
"aria-describedby": N,
|
|
8073
|
+
...u === void 0 ? { defaultChecked: l } : { checked: u },
|
|
8074
|
+
...x
|
|
8075
|
+
}), /* @__PURE__ */ v("label", {
|
|
8076
|
+
className: O,
|
|
8077
|
+
htmlFor: w,
|
|
8067
8078
|
children: [/* @__PURE__ */ v("span", {
|
|
8068
|
-
id:
|
|
8079
|
+
id: j,
|
|
8069
8080
|
children: [
|
|
8070
8081
|
n,
|
|
8071
8082
|
" ",
|
|
8072
|
-
|
|
8083
|
+
A()
|
|
8073
8084
|
]
|
|
8074
|
-
}),
|
|
8075
|
-
id:
|
|
8085
|
+
}), s && /* @__PURE__ */ _("div", {
|
|
8086
|
+
id: M,
|
|
8076
8087
|
className: "pkt-input-check__input-helptext",
|
|
8077
|
-
children:
|
|
8088
|
+
children: s
|
|
8078
8089
|
})]
|
|
8079
8090
|
})]
|
|
8080
8091
|
})
|
|
@@ -8448,7 +8459,7 @@ function fs(e) {
|
|
|
8448
8459
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
8449
8460
|
}
|
|
8450
8461
|
function ps(e, t) {
|
|
8451
|
-
let { id: n, label: r, value: i, defaultValue: a, min: s, max: l, step: h = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, form: b, disabled: x = !1, required: S = !1, helptext: C, helptextDropdown: w, helptextDropdownButton: T, hasError: E = !1, errorMessage: D, optionalTag: O = !1, optionalText: k, requiredTag: A = !1, requiredText: j, tagText: M, inline: N = !1, useWrapper:
|
|
8462
|
+
let { id: n, label: r, value: i, defaultValue: a, min: s, max: l, step: h = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, form: b, disabled: x = !1, required: S = !1, helptext: C, helptextDropdown: w, helptextDropdownButton: T, hasError: E = !1, errorMessage: D, optionalTag: O = !1, optionalText: k, requiredTag: A = !1, requiredText: j, tagText: M, inline: N = !1, useWrapper: ee = !0, ariaDescribedby: P, strings: te, className: F, inputSize: I = "medium", onValueChange: ne, onFocus: L, onBlur: re } = e, ie = Ce(["timepicker", "validation"], te), ae = ie.timepicker, oe = te, R = i !== void 0, z = i === void 0 ? a ?? "" : i ?? "", se = p(z), [B, V] = m(() => z), ce = R ? i ?? "" : B, [le, H] = m(() => ls(i === void 0 ? a : i)[0]), [U, ue] = m(() => ls(i === void 0 ? a : i)[1]), W = p(le), G = p(U), K = o((e) => {
|
|
8452
8463
|
W.current = e, H(e);
|
|
8453
8464
|
}, []), q = o((e) => {
|
|
8454
8465
|
G.current = e, ue(e);
|
|
@@ -8829,7 +8840,7 @@ function ps(e, t) {
|
|
|
8829
8840
|
`pkt-timepicker--${I}`,
|
|
8830
8841
|
v ? "pkt-timepicker--fullwidth" : "",
|
|
8831
8842
|
_ ? "pkt-timepicker--stepper" : "",
|
|
8832
|
-
|
|
8843
|
+
F ?? ""
|
|
8833
8844
|
].filter(Boolean).join(" "),
|
|
8834
8845
|
inputSize: I,
|
|
8835
8846
|
strings: ae,
|
|
@@ -8849,8 +8860,8 @@ function ps(e, t) {
|
|
|
8849
8860
|
requiredText: j,
|
|
8850
8861
|
tagText: M,
|
|
8851
8862
|
inline: N,
|
|
8852
|
-
useWrapper:
|
|
8853
|
-
ariaDescribedby:
|
|
8863
|
+
useWrapper: ee,
|
|
8864
|
+
ariaDescribedby: P,
|
|
8854
8865
|
hidePicker: g,
|
|
8855
8866
|
stepArrows: _,
|
|
8856
8867
|
min: s,
|