@oslokommune/punkt-react 19.5.0 → 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 +28 -0
- package/dist/components/inputwrapper/InputWrapper.d.ts +2 -0
- package/dist/components/inputwrapper/InputWrapper.test.d.ts +0 -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 +201 -186
- 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/combobox/Combobox.core.test.tsx +6 -3
- package/src/components/inputwrapper/InputWrapper.test.tsx +92 -0
- package/src/components/inputwrapper/InputWrapper.tsx +33 -2
- 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,30 +3210,34 @@ 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
|
-
return S
|
|
3236
|
+
return !S && T ? /* @__PURE__ */ _("legend", {
|
|
3237
|
+
className: "pkt-sr-only",
|
|
3238
|
+
id: `${P}-label`,
|
|
3239
|
+
children: t
|
|
3240
|
+
}) : S ? T ? /* @__PURE__ */ _("legend", {
|
|
3233
3241
|
className: "pkt-inputwrapper__legend",
|
|
3234
3242
|
id: `${P}-label`,
|
|
3235
3243
|
children: e
|
|
@@ -3244,25 +3252,28 @@ var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3244
3252
|
id: `${P}-label`,
|
|
3245
3253
|
children: t
|
|
3246
3254
|
});
|
|
3247
|
-
},
|
|
3255
|
+
}, z = () => {
|
|
3248
3256
|
let e = S ? n : void 0;
|
|
3249
3257
|
return !e && !r ? null : /* @__PURE__ */ _(sr, {
|
|
3250
3258
|
forId: P,
|
|
3251
3259
|
helptext: e,
|
|
3252
3260
|
helptextDropdown: r,
|
|
3253
|
-
helptextDropdownButton: i ??
|
|
3261
|
+
helptextDropdownButton: i ?? N.forms.readMore
|
|
3254
3262
|
});
|
|
3255
|
-
},
|
|
3256
|
-
oe(),
|
|
3263
|
+
}, se = k === "medium" ? "small" : "xsmall", B = /* @__PURE__ */ v(g, { children: [
|
|
3257
3264
|
R(),
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
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,
|
|
3261
3272
|
m && h && /* @__PURE__ */ _("div", {
|
|
3262
3273
|
className: "pkt-inputwrapper__alert-wrapper",
|
|
3263
3274
|
children: /* @__PURE__ */ _(we, {
|
|
3264
3275
|
skin: "error",
|
|
3265
|
-
size:
|
|
3276
|
+
size: se,
|
|
3266
3277
|
"aria-live": "assertive",
|
|
3267
3278
|
role: "alert",
|
|
3268
3279
|
id: `${P}-error`,
|
|
@@ -3271,17 +3282,17 @@ var cr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3271
3282
|
})
|
|
3272
3283
|
] });
|
|
3273
3284
|
return /* @__PURE__ */ _("div", {
|
|
3274
|
-
className:
|
|
3275
|
-
role:
|
|
3276
|
-
"aria-labelledby":
|
|
3277
|
-
...
|
|
3285
|
+
className: L,
|
|
3286
|
+
role: D,
|
|
3287
|
+
"aria-labelledby": D ? `${P}-label` : void 0,
|
|
3288
|
+
...M,
|
|
3278
3289
|
children: T ? /* @__PURE__ */ _("fieldset", {
|
|
3279
3290
|
className: "pkt-inputwrapper__fieldset",
|
|
3280
|
-
"aria-describedby":
|
|
3281
|
-
children:
|
|
3291
|
+
"aria-describedby": te,
|
|
3292
|
+
children: B
|
|
3282
3293
|
}) : /* @__PURE__ */ _("div", {
|
|
3283
3294
|
className: "pkt-inputwrapper__fieldset",
|
|
3284
|
-
children:
|
|
3295
|
+
children: B
|
|
3285
3296
|
})
|
|
3286
3297
|
});
|
|
3287
3298
|
});
|
|
@@ -3484,11 +3495,11 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3484
3495
|
o && "pkt-combobox__input--open",
|
|
3485
3496
|
m && "pkt-combobox__input--error",
|
|
3486
3497
|
f && "pkt-combobox__input--disabled"
|
|
3487
|
-
].filter(Boolean).join(" "), N = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "),
|
|
3488
|
-
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`,
|
|
3489
3500
|
hasHelptext: !!e.helptext,
|
|
3490
3501
|
ariaDescribedby: e.ariaDescribedby
|
|
3491
|
-
}), L =
|
|
3502
|
+
}), L = ee ? { tabIndex: -1 } : {
|
|
3492
3503
|
id: `${t}-combobox`,
|
|
3493
3504
|
"aria-describedby": ne,
|
|
3494
3505
|
role: "combobox",
|
|
@@ -3496,7 +3507,7 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3496
3507
|
"aria-controls": r,
|
|
3497
3508
|
"aria-haspopup": "listbox",
|
|
3498
3509
|
"aria-labelledby": `${t}-combobox-label`,
|
|
3499
|
-
"aria-activedescendant":
|
|
3510
|
+
"aria-activedescendant": F,
|
|
3500
3511
|
"aria-description": I,
|
|
3501
3512
|
tabIndex: f ? -1 : 0,
|
|
3502
3513
|
onKeyDown: k
|
|
@@ -3510,12 +3521,12 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3510
3521
|
},
|
|
3511
3522
|
...L,
|
|
3512
3523
|
children: [
|
|
3513
|
-
|
|
3524
|
+
P ? /* @__PURE__ */ _("span", {
|
|
3514
3525
|
className: "pkt-combobox__placeholder",
|
|
3515
3526
|
onClick: O,
|
|
3516
3527
|
children: d
|
|
3517
|
-
}) :
|
|
3518
|
-
|
|
3528
|
+
}) : te ? s ? /* @__PURE__ */ _(Or, { state: e }) : ee ? null : /* @__PURE__ */ _(kr, { state: e }) : null,
|
|
3529
|
+
ee ? /* @__PURE__ */ _("div", {
|
|
3519
3530
|
className: "pkt-combobox__input-div combobox__input",
|
|
3520
3531
|
children: /* @__PURE__ */ _("input", {
|
|
3521
3532
|
ref: x,
|
|
@@ -3534,7 +3545,7 @@ var lr = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3534
3545
|
"aria-label": h,
|
|
3535
3546
|
"aria-autocomplete": c ? "both" : l ? "list" : "none",
|
|
3536
3547
|
"aria-controls": r,
|
|
3537
|
-
"aria-activedescendant":
|
|
3548
|
+
"aria-activedescendant": F,
|
|
3538
3549
|
"aria-description": I,
|
|
3539
3550
|
"aria-describedby": ne,
|
|
3540
3551
|
disabled: f
|
|
@@ -3701,7 +3712,7 @@ function Pr(e, t) {
|
|
|
3701
3712
|
}));
|
|
3702
3713
|
}
|
|
3703
3714
|
function Fr(t, n) {
|
|
3704
|
-
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(() => {
|
|
3705
3716
|
H ? U.current?.focus() : W.current?.focus();
|
|
3706
3717
|
}, [H]), pe = o(() => {
|
|
3707
3718
|
Ie(!0);
|
|
@@ -4221,10 +4232,10 @@ function Fr(t, n) {
|
|
|
4221
4232
|
helptextDropdown: j,
|
|
4222
4233
|
helptextDropdownButton: M,
|
|
4223
4234
|
optionalTag: N,
|
|
4224
|
-
optionalText:
|
|
4225
|
-
requiredTag:
|
|
4226
|
-
requiredText:
|
|
4227
|
-
tagText:
|
|
4235
|
+
optionalText: ee,
|
|
4236
|
+
requiredTag: P,
|
|
4237
|
+
requiredText: te,
|
|
4238
|
+
tagText: F,
|
|
4228
4239
|
useWrapper: I,
|
|
4229
4240
|
inline: ne,
|
|
4230
4241
|
inputSize: re,
|
|
@@ -4331,7 +4342,7 @@ var Lr = null, Rr = () => Lr || (Lr = new Promise((e, t) => {
|
|
|
4331
4342
|
} catch {
|
|
4332
4343
|
return e;
|
|
4333
4344
|
}
|
|
4334
|
-
}, 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) {
|
|
4335
4346
|
let m = p(u);
|
|
4336
4347
|
m.current = u;
|
|
4337
4348
|
let h = p({
|
|
@@ -4499,7 +4510,7 @@ var Hr = () => {
|
|
|
4499
4510
|
})
|
|
4500
4511
|
});
|
|
4501
4512
|
}, $r = ({ state: e }) => {
|
|
4502
|
-
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) => {
|
|
4503
4514
|
e.preventDefault(), M();
|
|
4504
4515
|
}, z = (e) => {
|
|
4505
4516
|
e.preventDefault(), M();
|
|
@@ -4575,8 +4586,8 @@ var Hr = () => {
|
|
|
4575
4586
|
onTouchEnd: z,
|
|
4576
4587
|
onKeyDown: re,
|
|
4577
4588
|
onFocus: N,
|
|
4578
|
-
onBlur:
|
|
4579
|
-
onChange:
|
|
4589
|
+
onBlur: F,
|
|
4590
|
+
onChange: P
|
|
4580
4591
|
}),
|
|
4581
4592
|
/* @__PURE__ */ _("div", {
|
|
4582
4593
|
className: E,
|
|
@@ -4604,8 +4615,8 @@ var Hr = () => {
|
|
|
4604
4615
|
onTouchEnd: z,
|
|
4605
4616
|
onKeyDown: ie,
|
|
4606
4617
|
onFocus: N,
|
|
4607
|
-
onBlur:
|
|
4608
|
-
onChange:
|
|
4618
|
+
onBlur: F,
|
|
4619
|
+
onChange: te
|
|
4609
4620
|
}),
|
|
4610
4621
|
se()
|
|
4611
4622
|
]
|
|
@@ -4636,7 +4647,7 @@ var Hr = () => {
|
|
|
4636
4647
|
onKeyDown: L,
|
|
4637
4648
|
onFocus: N,
|
|
4638
4649
|
onBlur: void 0,
|
|
4639
|
-
onChange:
|
|
4650
|
+
onChange: ee
|
|
4640
4651
|
}), se()]
|
|
4641
4652
|
})
|
|
4642
4653
|
});
|
|
@@ -4652,7 +4663,7 @@ var Hr = () => {
|
|
|
4652
4663
|
//#endregion
|
|
4653
4664
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4654
4665
|
function ti(e, t) {
|
|
4655
|
-
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);
|
|
4656
4667
|
ue && i !== fe && (pe(i), K(U(i)));
|
|
4657
4668
|
let [me, J] = m(C ?? !1), [Y, he] = m(C);
|
|
4658
4669
|
C !== Y && (he(C), C !== void 0 && J(C));
|
|
@@ -4838,10 +4849,10 @@ function ti(e, t) {
|
|
|
4838
4849
|
helptextDropdown: j,
|
|
4839
4850
|
helptextDropdownButton: M,
|
|
4840
4851
|
hasError: N,
|
|
4841
|
-
errorMessage:
|
|
4842
|
-
optionalTag:
|
|
4843
|
-
optionalText:
|
|
4844
|
-
requiredTag:
|
|
4852
|
+
errorMessage: ee,
|
|
4853
|
+
optionalTag: P,
|
|
4854
|
+
optionalText: te,
|
|
4855
|
+
requiredTag: F,
|
|
4845
4856
|
requiredText: I,
|
|
4846
4857
|
tagText: ne,
|
|
4847
4858
|
useWrapper: L,
|
|
@@ -5213,18 +5224,18 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5213
5224
|
if (e.preventDefault(), E(!1), d) return;
|
|
5214
5225
|
let t = e.dataTransfer.files, n = Array.from(t);
|
|
5215
5226
|
M(n);
|
|
5216
|
-
},
|
|
5227
|
+
}, ee = (e) => {
|
|
5217
5228
|
e.preventDefault(), !d && E(!0);
|
|
5218
|
-
},
|
|
5229
|
+
}, P = () => {
|
|
5219
5230
|
E(!1);
|
|
5220
|
-
},
|
|
5231
|
+
}, te = o((e) => {
|
|
5221
5232
|
d || e.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog") || S.current?.click();
|
|
5222
5233
|
}, [d]);
|
|
5223
5234
|
return /* @__PURE__ */ v("div", {
|
|
5224
5235
|
onDrop: N,
|
|
5225
|
-
onDragOver:
|
|
5226
|
-
onDragLeave:
|
|
5227
|
-
onClick:
|
|
5236
|
+
onDragOver: ee,
|
|
5237
|
+
onDragLeave: P,
|
|
5238
|
+
onClick: te,
|
|
5228
5239
|
className: (0, L.default)("pkt-fileupload__drop-zone", {
|
|
5229
5240
|
"pkt-fileupload__drop-zone--drag-active": T,
|
|
5230
5241
|
"pkt-fileupload__drop-zone--disabled": d
|
|
@@ -5287,7 +5298,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5287
5298
|
let t = new DataTransfer();
|
|
5288
5299
|
for (let n of e) t.items.add(n.file);
|
|
5289
5300
|
return t.files;
|
|
5290
|
-
}, 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) => {
|
|
5291
5302
|
let I = r ?? (a ?? 0) > 0, ne = [
|
|
5292
5303
|
o,
|
|
5293
5304
|
"pkt-textinput",
|
|
@@ -5298,7 +5309,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5298
5309
|
return /* @__PURE__ */ _("div", {
|
|
5299
5310
|
className: ne,
|
|
5300
5311
|
children: /* @__PURE__ */ _(cr, {
|
|
5301
|
-
strings:
|
|
5312
|
+
strings: P,
|
|
5302
5313
|
ariaDescribedby: t,
|
|
5303
5314
|
disabled: s,
|
|
5304
5315
|
errorMessage: c,
|
|
@@ -5319,12 +5330,12 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5319
5330
|
counterCurrent: z,
|
|
5320
5331
|
counterMaxLength: a,
|
|
5321
5332
|
hasFieldset: i ?? !1,
|
|
5322
|
-
size:
|
|
5333
|
+
size: ee,
|
|
5323
5334
|
children: /* @__PURE__ */ _("textarea", {
|
|
5324
5335
|
ref: (e) => {
|
|
5325
|
-
R(e?.value?.length || 0), typeof
|
|
5336
|
+
R(e?.value?.length || 0), typeof F == "function" ? F(e) : F && (F.current = e);
|
|
5326
5337
|
},
|
|
5327
|
-
className: `pkt-input pkt-input--${
|
|
5338
|
+
className: `pkt-input pkt-input--${ee} ${h ? "pkt-input--fullwidth" : ""} ${a && z > a ? "pkt-input--counter-error" : ""}`,
|
|
5328
5339
|
name: `${v || L}`,
|
|
5329
5340
|
id: re,
|
|
5330
5341
|
placeholder: w,
|
|
@@ -5339,7 +5350,7 @@ var Ei = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5339
5350
|
hasCounter: I,
|
|
5340
5351
|
ariaDescribedby: t
|
|
5341
5352
|
}),
|
|
5342
|
-
...
|
|
5353
|
+
...te,
|
|
5343
5354
|
onChange: se,
|
|
5344
5355
|
value: O,
|
|
5345
5356
|
autoComplete: k,
|
|
@@ -6155,7 +6166,7 @@ var ca = n({ tail: 5 }), la = ({ children: e, tail: t }) => {
|
|
|
6155
6166
|
}, Aa = {
|
|
6156
6167
|
filename: va,
|
|
6157
6168
|
thumbnail: ya
|
|
6158
|
-
}, 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) => {
|
|
6159
6170
|
let B = l(), V = n ?? `pkt-fileupload-${B}`, ce = p(null);
|
|
6160
6171
|
u(se, () => ce.current, []);
|
|
6161
6172
|
let le = "transfers" in z ? z.transfers : void 0, H = Ce(["fileupload"], R).fileupload, [U, ue] = m(null), [W, q] = m("");
|
|
@@ -6338,12 +6349,12 @@ var ca = n({ tail: 5 }), la = ({ children: e, tail: t }) => {
|
|
|
6338
6349
|
label: j ?? "",
|
|
6339
6350
|
helptext: M,
|
|
6340
6351
|
helptextDropdown: N,
|
|
6341
|
-
helptextDropdownButton:
|
|
6352
|
+
helptextDropdownButton: ee,
|
|
6342
6353
|
disabled: A,
|
|
6343
6354
|
hasError: fe,
|
|
6344
|
-
optionalTag:
|
|
6345
|
-
optionalText:
|
|
6346
|
-
requiredTag:
|
|
6355
|
+
optionalTag: P,
|
|
6356
|
+
optionalText: te,
|
|
6357
|
+
requiredTag: F,
|
|
6347
6358
|
requiredText: I,
|
|
6348
6359
|
tagText: ne,
|
|
6349
6360
|
className: (0, L.default)("pkt-fileupload-wrapper", { "pkt-fileupload-wrapper--full-width": x }),
|
|
@@ -6868,31 +6879,31 @@ var lo = ({ dataUrl: e = N, data: t, locale: n = "nb-NO", open: r = !1, mobileBr
|
|
|
6868
6879
|
children: y.menuLoadError
|
|
6869
6880
|
})
|
|
6870
6881
|
});
|
|
6871
|
-
let { megamenu:
|
|
6882
|
+
let { megamenu: ee, i18n: P } = j, te = P?.navAriaLabel || "Hovedmeny";
|
|
6872
6883
|
return /* @__PURE__ */ v("nav", {
|
|
6873
6884
|
...h,
|
|
6874
6885
|
ref: O,
|
|
6875
6886
|
className: M,
|
|
6876
|
-
"aria-label":
|
|
6887
|
+
"aria-label": te,
|
|
6877
6888
|
children: [
|
|
6878
6889
|
k ? /* @__PURE__ */ _(fo, {
|
|
6879
|
-
services:
|
|
6880
|
-
sections:
|
|
6890
|
+
services: ee.services,
|
|
6891
|
+
sections: ee.sections
|
|
6881
6892
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
6882
|
-
/* @__PURE__ */ _(po, { services:
|
|
6893
|
+
/* @__PURE__ */ _(po, { services: ee.services }),
|
|
6883
6894
|
/* @__PURE__ */ _(mo, {
|
|
6884
|
-
buttons:
|
|
6895
|
+
buttons: ee.buttons,
|
|
6885
6896
|
mobile: !1
|
|
6886
6897
|
}),
|
|
6887
|
-
/* @__PURE__ */ _(ho, { sections:
|
|
6898
|
+
/* @__PURE__ */ _(ho, { sections: ee.sections })
|
|
6888
6899
|
] }),
|
|
6889
6900
|
/* @__PURE__ */ _(mo, {
|
|
6890
|
-
buttons:
|
|
6901
|
+
buttons: ee.buttons,
|
|
6891
6902
|
mobile: !0
|
|
6892
6903
|
}),
|
|
6893
6904
|
/* @__PURE__ */ _(_o, {
|
|
6894
|
-
links:
|
|
6895
|
-
some:
|
|
6905
|
+
links: ee.links,
|
|
6906
|
+
some: ee.some
|
|
6896
6907
|
})
|
|
6897
6908
|
]
|
|
6898
6909
|
});
|
|
@@ -7250,15 +7261,15 @@ wo.displayName = "PktSearchInput";
|
|
|
7250
7261
|
//#region src/components/header/HeaderGlobal.tsx
|
|
7251
7262
|
var To = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7252
7263
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || To);
|
|
7253
|
-
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 =
|
|
7254
|
-
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);
|
|
7255
7266
|
c(() => {
|
|
7256
7267
|
R.current = M;
|
|
7257
7268
|
}, [M]), c(() => {
|
|
7258
7269
|
z.current = N;
|
|
7259
7270
|
}, [N]);
|
|
7260
7271
|
let { setRef: se, isMobile: B, isTablet: V, isFixed: ce, isSticky: le, hidden: U, captureFocus: ue, flagRestoreFocus: W, restoreFocus: G } = so({
|
|
7261
|
-
forwardedRef:
|
|
7272
|
+
forwardedRef: te,
|
|
7262
7273
|
mobileBreakpoint: A,
|
|
7263
7274
|
tabletBreakpoint: j,
|
|
7264
7275
|
position: O,
|
|
@@ -7340,8 +7351,8 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7340
7351
|
});
|
|
7341
7352
|
}, [x?.lastLoggedIn]), me = o((e) => {
|
|
7342
7353
|
ne((t) => t === e ? "none" : (ue(), e));
|
|
7343
|
-
}, [ue]), J = E === "userMenu" || E === "both", Y = Ce(["header"],
|
|
7344
|
-
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),
|
|
7345
7356
|
"data-mode": t,
|
|
7346
7357
|
ref: q,
|
|
7347
7358
|
children: [
|
|
@@ -7450,7 +7461,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7450
7461
|
}), Z && /* @__PURE__ */ _("div", {
|
|
7451
7462
|
className: "pkt-header-global__user-menu is-open",
|
|
7452
7463
|
children: /* @__PURE__ */ _(Co, {
|
|
7453
|
-
strings:
|
|
7464
|
+
strings: P,
|
|
7454
7465
|
user: x,
|
|
7455
7466
|
formattedLastLoggedIn: pe,
|
|
7456
7467
|
representing: C,
|
|
@@ -7471,7 +7482,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7471
7482
|
locale: i,
|
|
7472
7483
|
open: !0,
|
|
7473
7484
|
mobileBreakpoint: A,
|
|
7474
|
-
strings:
|
|
7485
|
+
strings: P
|
|
7475
7486
|
}) : /* @__PURE__ */ _("nav", {
|
|
7476
7487
|
className: "pkt-header-menu pkt-header-menu--open",
|
|
7477
7488
|
children: /* @__PURE__ */ _("p", {
|
|
@@ -7516,7 +7527,7 @@ var Eo = "pkt-header-global-menu", Do = "pkt-header-global-menu-toggle", Oo = "p
|
|
|
7516
7527
|
Ao.displayName = "PktHeaderGlobal";
|
|
7517
7528
|
//#endregion
|
|
7518
7529
|
//#region src/components/textinput/Textinput.tsx
|
|
7519
|
-
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) => {
|
|
7520
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) => {
|
|
7521
7532
|
V && W(e.currentTarget?.value?.length || 0), ae && ae(e);
|
|
7522
7533
|
};
|
|
@@ -7574,12 +7585,12 @@ var jo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7574
7585
|
ariaDescribedby: t
|
|
7575
7586
|
}),
|
|
7576
7587
|
"aria-labelledby": fe,
|
|
7577
|
-
min:
|
|
7578
|
-
max:
|
|
7588
|
+
min: te,
|
|
7589
|
+
max: F,
|
|
7579
7590
|
onChange: pe,
|
|
7580
7591
|
step: I,
|
|
7581
|
-
minLength:
|
|
7582
|
-
maxLength:
|
|
7592
|
+
minLength: ee,
|
|
7593
|
+
maxLength: P,
|
|
7583
7594
|
size: ne,
|
|
7584
7595
|
readOnly: L,
|
|
7585
7596
|
required: re
|
|
@@ -7616,7 +7627,7 @@ jo.displayName = "PktTextinput";
|
|
|
7616
7627
|
//#region src/components/header/HeaderService.tsx
|
|
7617
7628
|
var Mo = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7618
7629
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || Mo);
|
|
7619
|
-
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) => {
|
|
7620
7631
|
let oe = I === "hide";
|
|
7621
7632
|
c(() => {
|
|
7622
7633
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
@@ -7639,7 +7650,7 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7639
7650
|
forwardedRef: ae,
|
|
7640
7651
|
mobileBreakpoint: e,
|
|
7641
7652
|
tabletBreakpoint: t,
|
|
7642
|
-
position:
|
|
7653
|
+
position: F,
|
|
7643
7654
|
scrollBehavior: I
|
|
7644
7655
|
});
|
|
7645
7656
|
co((he || ge) && J && B !== "none");
|
|
@@ -7705,11 +7716,11 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7705
7716
|
children: /* @__PURE__ */ _("a", {
|
|
7706
7717
|
href: N,
|
|
7707
7718
|
"aria-label": R.logoLabel,
|
|
7708
|
-
onClick:
|
|
7719
|
+
onClick: P,
|
|
7709
7720
|
children: /* @__PURE__ */ _(H, {
|
|
7710
7721
|
name: "oslologo",
|
|
7711
7722
|
"aria-hidden": "true",
|
|
7712
|
-
path:
|
|
7723
|
+
path: te
|
|
7713
7724
|
})
|
|
7714
7725
|
})
|
|
7715
7726
|
}) : /* @__PURE__ */ _("span", {
|
|
@@ -7719,7 +7730,7 @@ var No = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7719
7730
|
children: /* @__PURE__ */ _(H, {
|
|
7720
7731
|
name: "oslologo",
|
|
7721
7732
|
"aria-hidden": "true",
|
|
7722
|
-
path:
|
|
7733
|
+
path: te
|
|
7723
7734
|
})
|
|
7724
7735
|
})), T && /* @__PURE__ */ _("span", {
|
|
7725
7736
|
className: "pkt-header-service__service-name",
|
|
@@ -8019,58 +8030,62 @@ var zo = ({ children: e, className: t, skin: n, title: i, compact: a, closable:
|
|
|
8019
8030
|
zo.displayName = "PktMessagebox";
|
|
8020
8031
|
//#endregion
|
|
8021
8032
|
//#region src/components/radio/RadioButton.tsx
|
|
8022
|
-
var Bo = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1,
|
|
8023
|
-
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 = [
|
|
8024
8039
|
"pkt-input-check__input",
|
|
8025
8040
|
i ? "pkt-input-check__input--tile" : "",
|
|
8026
|
-
|
|
8027
|
-
].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 = [
|
|
8028
8043
|
"pkt-tag",
|
|
8029
8044
|
"pkt-tag--small",
|
|
8030
8045
|
"pkt-tag--thin-text"
|
|
8031
|
-
].join(" "),
|
|
8032
|
-
|
|
8033
|
-
className:
|
|
8034
|
-
children:
|
|
8046
|
+
].join(" "), A = () => /* @__PURE__ */ v(g, { children: [
|
|
8047
|
+
y && /* @__PURE__ */ _("span", {
|
|
8048
|
+
className: k + " pkt-tag--gray",
|
|
8049
|
+
children: y
|
|
8035
8050
|
}),
|
|
8036
|
-
|
|
8037
|
-
className:
|
|
8038
|
-
children:
|
|
8051
|
+
d && /* @__PURE__ */ _("span", {
|
|
8052
|
+
className: k + " pkt-tag--blue-light",
|
|
8053
|
+
children: f ?? C.forms.optional
|
|
8039
8054
|
}),
|
|
8040
|
-
|
|
8041
|
-
className:
|
|
8042
|
-
children:
|
|
8055
|
+
p && /* @__PURE__ */ _("span", {
|
|
8056
|
+
className: k + " pkt-tag--beige",
|
|
8057
|
+
children: m ?? C.forms.required
|
|
8043
8058
|
})
|
|
8044
|
-
] }),
|
|
8059
|
+
] }), j = `${w}-check-label`, M = `${w}-check-helptext`, N = [s ? M : void 0, b].filter(Boolean).join(" ") || void 0;
|
|
8045
8060
|
return /* @__PURE__ */ _("div", {
|
|
8046
|
-
className:
|
|
8061
|
+
className: T,
|
|
8047
8062
|
children: /* @__PURE__ */ v("div", {
|
|
8048
|
-
className:
|
|
8063
|
+
className: E,
|
|
8049
8064
|
children: [/* @__PURE__ */ _("input", {
|
|
8050
|
-
ref:
|
|
8051
|
-
id:
|
|
8065
|
+
ref: S,
|
|
8066
|
+
id: w,
|
|
8052
8067
|
type: "radio",
|
|
8053
8068
|
name: t,
|
|
8054
|
-
disabled:
|
|
8055
|
-
className: E,
|
|
8056
|
-
"aria-labelledby": n ? A : void 0,
|
|
8057
|
-
"aria-describedby": M,
|
|
8058
|
-
...l === void 0 ? { defaultChecked: c } : { checked: l },
|
|
8059
|
-
...b
|
|
8060
|
-
}), /* @__PURE__ */ v("label", {
|
|
8069
|
+
disabled: o,
|
|
8061
8070
|
className: D,
|
|
8062
|
-
|
|
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,
|
|
8063
8078
|
children: [/* @__PURE__ */ v("span", {
|
|
8064
|
-
id:
|
|
8079
|
+
id: j,
|
|
8065
8080
|
children: [
|
|
8066
8081
|
n,
|
|
8067
8082
|
" ",
|
|
8068
|
-
|
|
8083
|
+
A()
|
|
8069
8084
|
]
|
|
8070
|
-
}),
|
|
8071
|
-
id:
|
|
8085
|
+
}), s && /* @__PURE__ */ _("div", {
|
|
8086
|
+
id: M,
|
|
8072
8087
|
className: "pkt-input-check__input-helptext",
|
|
8073
|
-
children:
|
|
8088
|
+
children: s
|
|
8074
8089
|
})]
|
|
8075
8090
|
})]
|
|
8076
8091
|
})
|
|
@@ -8444,7 +8459,7 @@ function fs(e) {
|
|
|
8444
8459
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
8445
8460
|
}
|
|
8446
8461
|
function ps(e, t) {
|
|
8447
|
-
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) => {
|
|
8448
8463
|
W.current = e, H(e);
|
|
8449
8464
|
}, []), q = o((e) => {
|
|
8450
8465
|
G.current = e, ue(e);
|
|
@@ -8825,7 +8840,7 @@ function ps(e, t) {
|
|
|
8825
8840
|
`pkt-timepicker--${I}`,
|
|
8826
8841
|
v ? "pkt-timepicker--fullwidth" : "",
|
|
8827
8842
|
_ ? "pkt-timepicker--stepper" : "",
|
|
8828
|
-
|
|
8843
|
+
F ?? ""
|
|
8829
8844
|
].filter(Boolean).join(" "),
|
|
8830
8845
|
inputSize: I,
|
|
8831
8846
|
strings: ae,
|
|
@@ -8845,8 +8860,8 @@ function ps(e, t) {
|
|
|
8845
8860
|
requiredText: j,
|
|
8846
8861
|
tagText: M,
|
|
8847
8862
|
inline: N,
|
|
8848
|
-
useWrapper:
|
|
8849
|
-
ariaDescribedby:
|
|
8863
|
+
useWrapper: ee,
|
|
8864
|
+
ariaDescribedby: P,
|
|
8850
8865
|
hidePicker: g,
|
|
8851
8866
|
stepArrows: _,
|
|
8852
8867
|
min: s,
|