@oslokommune/punkt-react 19.2.0 → 19.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/components/checkbox/Checkbox.d.ts +2 -20
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +546 -535
- package/dist/shared-types/checkbox.d.ts +52 -0
- package/dist/shared-types/index.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/checkbox/Checkbox.tsx +11 -26
package/dist/punkt-react.js
CHANGED
|
@@ -2780,7 +2780,18 @@ var Rn = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", zn
|
|
|
2780
2780
|
zoom: !1,
|
|
2781
2781
|
imageShape: "square",
|
|
2782
2782
|
restrictImageHeight: !1
|
|
2783
|
-
}, Vn =
|
|
2783
|
+
}, Vn = {
|
|
2784
|
+
defaultChecked: !1,
|
|
2785
|
+
indeterminate: !1,
|
|
2786
|
+
hasTile: !1,
|
|
2787
|
+
disabled: !1,
|
|
2788
|
+
hasError: !1,
|
|
2789
|
+
isSwitch: !1,
|
|
2790
|
+
hideLabel: !1,
|
|
2791
|
+
labelPosition: "right",
|
|
2792
|
+
requiredTag: !1,
|
|
2793
|
+
optionalTag: !1
|
|
2794
|
+
}, Hn = (e) => {
|
|
2784
2795
|
switch (e) {
|
|
2785
2796
|
case 1: return "xlarge";
|
|
2786
2797
|
case 2: return "large";
|
|
@@ -2790,7 +2801,7 @@ var Rn = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", zn
|
|
|
2790
2801
|
case 6: return "xsmall";
|
|
2791
2802
|
default: return "medium";
|
|
2792
2803
|
}
|
|
2793
|
-
},
|
|
2804
|
+
}, Un = (e) => {
|
|
2794
2805
|
switch (e) {
|
|
2795
2806
|
case 1:
|
|
2796
2807
|
case 2: return "regular";
|
|
@@ -2800,8 +2811,8 @@ var Rn = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", zn
|
|
|
2800
2811
|
case 6: return "medium";
|
|
2801
2812
|
default: return "medium";
|
|
2802
2813
|
}
|
|
2803
|
-
},
|
|
2804
|
-
let l = t ??
|
|
2814
|
+
}, Wn = i(function({ level: e = 2, size: t, weight: n, visuallyHidden: r, align: i, className: a, children: o, ...s }, c) {
|
|
2815
|
+
let l = t ?? Hn(e), u = n ?? Un(e), d = (0, M.default)("pkt-heading", `pkt-heading--${l}`, `pkt-heading--fw-${u}`, i && `pkt-heading--${i}`, r && "pkt-sr-only", a), f = `h${e}`;
|
|
2805
2816
|
return /* @__PURE__ */ _(f, {
|
|
2806
2817
|
...s,
|
|
2807
2818
|
ref: c,
|
|
@@ -2809,10 +2820,10 @@ var Rn = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", zn
|
|
|
2809
2820
|
children: o
|
|
2810
2821
|
});
|
|
2811
2822
|
});
|
|
2812
|
-
|
|
2823
|
+
Wn.displayName = "PktHeading";
|
|
2813
2824
|
//#endregion
|
|
2814
2825
|
//#region src/components/tag/Tag.tsx
|
|
2815
|
-
var
|
|
2826
|
+
var Gn = i(({ children: e, skin: t = "blue", textStyle: n, size: r = "medium", closeTag: i, className: a, iconName: s, ariaLabel: l, onClose: u, type: d = "button", "aria-description": h, strings: g, ...y }, b) => {
|
|
2816
2827
|
let [x, S] = m(!1), C = o(() => {
|
|
2817
2828
|
S(!0), u && u();
|
|
2818
2829
|
}, [u]), w = p(null), [T, E] = m("");
|
|
@@ -2876,10 +2887,10 @@ var Wn = i(({ children: e, skin: t = "blue", textStyle: n, size: r = "medium", c
|
|
|
2876
2887
|
})]
|
|
2877
2888
|
});
|
|
2878
2889
|
});
|
|
2879
|
-
|
|
2890
|
+
Gn.displayName = "PktTag";
|
|
2880
2891
|
//#endregion
|
|
2881
2892
|
//#region src/components/card/Card.tsx
|
|
2882
|
-
var
|
|
2893
|
+
var Kn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHover: i = Bn.borderOnHover, metaTrail: a, layout: o = Bn.layout, heading: s = "", headingLevel: c = Bn.headingLevel, image: l, imageShape: u = Bn.imageShape, imageAspect: d, restrictImageHeight: f = Bn.restrictImageHeight, clickCardLink: p, padding: m = Bn.padding, openLinkInNewTab: h = Bn.openLinkInNewTab, skin: g = Bn.skin, subheading: y = "", tagPosition: b = Bn.tagPosition, zoom: x = Bn.zoom, tags: S = [], ...C }, w) => {
|
|
2883
2894
|
let T = (0, M.default)({
|
|
2884
2895
|
"pkt-card": !0,
|
|
2885
2896
|
[`pkt-card--${g}`]: g,
|
|
@@ -2897,7 +2908,7 @@ var Gn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHove
|
|
|
2897
2908
|
className: (0, M.default)("pkt-card__tags", `pkt-card__tags-${b}`),
|
|
2898
2909
|
role: "list",
|
|
2899
2910
|
"aria-label": S.length > 1 ? "merkelapper" : "merkelapp",
|
|
2900
|
-
children: S.map((e, t) => /* @__PURE__ */ _(
|
|
2911
|
+
children: S.map((e, t) => /* @__PURE__ */ _(Gn, {
|
|
2901
2912
|
role: "listitem",
|
|
2902
2913
|
textStyle: "normal-text",
|
|
2903
2914
|
size: "medium",
|
|
@@ -2905,13 +2916,13 @@ var Gn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHove
|
|
|
2905
2916
|
iconName: e.iconName,
|
|
2906
2917
|
children: /* @__PURE__ */ _("span", { children: e.text })
|
|
2907
2918
|
}, t))
|
|
2908
|
-
}), A = () => !s || p ? null : /* @__PURE__ */ _(
|
|
2919
|
+
}), A = () => !s || p ? null : /* @__PURE__ */ _(Wn, {
|
|
2909
2920
|
className: "pkt-card__heading",
|
|
2910
2921
|
level: c,
|
|
2911
2922
|
size: "medium",
|
|
2912
2923
|
weight: "regular",
|
|
2913
2924
|
children: s
|
|
2914
|
-
}), j = () => p ? /* @__PURE__ */ _(
|
|
2925
|
+
}), j = () => p ? /* @__PURE__ */ _(Wn, {
|
|
2915
2926
|
className: "pkt-card__link-heading pkt-card__heading",
|
|
2916
2927
|
level: c,
|
|
2917
2928
|
size: "medium",
|
|
@@ -2963,23 +2974,23 @@ var Gn = i(({ children: e, className: t, ariaLabel: n, metaLead: r, borderOnHove
|
|
|
2963
2974
|
})]
|
|
2964
2975
|
});
|
|
2965
2976
|
});
|
|
2966
|
-
|
|
2977
|
+
Kn.displayName = "PktCard";
|
|
2967
2978
|
//#endregion
|
|
2968
2979
|
//#region ../../shared-utils/utils.ts
|
|
2969
|
-
var
|
|
2970
|
-
let e =
|
|
2980
|
+
var qn = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toString(16)).slice(-16), Jn = () => {
|
|
2981
|
+
let e = qn(), t = qn();
|
|
2971
2982
|
return e.slice(0, 8) + "-" + e.slice(8, 12) + "-4" + e.slice(13) + "-a" + t.slice(1, 4) + "-" + t.slice(4);
|
|
2972
2983
|
};
|
|
2973
2984
|
//#endregion
|
|
2974
2985
|
//#region src/hooks/useGeneratedId.ts
|
|
2975
|
-
function
|
|
2976
|
-
let t = f(() =>
|
|
2986
|
+
function Yn(e) {
|
|
2987
|
+
let t = f(() => Jn(), []);
|
|
2977
2988
|
return e || t;
|
|
2978
2989
|
}
|
|
2979
2990
|
//#endregion
|
|
2980
2991
|
//#region src/components/checkbox/Checkbox.tsx
|
|
2981
|
-
var
|
|
2982
|
-
let D = ve(["forms"], S), O =
|
|
2992
|
+
var Xn = i(({ id: e, hasTile: t = Vn.hasTile, disabled: n = Vn.disabled, label: r, checkHelptext: i, hasError: a = Vn.hasError, className: o, isSwitch: s = Vn.isSwitch, hideLabel: l = Vn.hideLabel, labelPosition: u = Vn.labelPosition, defaultChecked: d, checked: f, indeterminate: m, optionalTag: h, optionalText: y, requiredTag: b, requiredText: x, strings: S, tagText: C, "aria-describedby": w, ...T }, E) => {
|
|
2993
|
+
let D = ve(["forms"], S), O = Yn(e), k = p(null);
|
|
2983
2994
|
c(() => {
|
|
2984
2995
|
k.current && m !== void 0 && (k.current.indeterminate = m);
|
|
2985
2996
|
}, [m]), c(() => {
|
|
@@ -3051,10 +3062,10 @@ var Yn = i(({ id: e, hasTile: t = !1, disabled: n = !1, label: r, checkHelptext:
|
|
|
3051
3062
|
})
|
|
3052
3063
|
});
|
|
3053
3064
|
});
|
|
3054
|
-
|
|
3065
|
+
Xn.displayName = "PktCheckbox";
|
|
3055
3066
|
//#endregion
|
|
3056
3067
|
//#region src/hooks/useFocusModality.ts
|
|
3057
|
-
function
|
|
3068
|
+
function Zn(e) {
|
|
3058
3069
|
let t = p(null), n = p(!1), r = p(void 0), i = (e) => {
|
|
3059
3070
|
let n = t.current;
|
|
3060
3071
|
n && (e === void 0 ? delete n.dataset.navtype : n.dataset.navtype = e);
|
|
@@ -3080,11 +3091,11 @@ function Xn(e) {
|
|
|
3080
3091
|
}
|
|
3081
3092
|
//#endregion
|
|
3082
3093
|
//#region ../../shared-utils/forms/described-by.ts
|
|
3083
|
-
var
|
|
3094
|
+
var Qn = (e) => {
|
|
3084
3095
|
let t = [];
|
|
3085
3096
|
return e.hasHelptext && t.push(`${e.id}-helptext`), e.hasCounter && t.push(`${e.id}-counter-status`), e.ariaDescribedby && t.push(e.ariaDescribedby), t.length ? t.join(" ") : void 0;
|
|
3086
|
-
},
|
|
3087
|
-
let [l, u] = m(!1), d = f(() =>
|
|
3097
|
+
}, $n = (e) => `${e}-counter-status`, er = (e, t) => !!t && t > 0 && (e ?? 0) > t, tr = "Les mer <span class='pkt-sr-only'>om feltet</span>", nr = (e) => e == null || e === "" ? null : typeof e == "string" ? /* @__PURE__ */ _("span", { dangerouslySetInnerHTML: { __html: e } }) : e, rr = i(function({ helptext: e, helptextDropdown: t, helptextDropdownButton: n, forId: r, onToggleHelpText: i, className: a, children: o, ...s }, c) {
|
|
3098
|
+
let [l, u] = m(!1), d = f(() => Jn(), []), p = r || d, h = () => {
|
|
3088
3099
|
let e = !l;
|
|
3089
3100
|
u(e), i?.(e);
|
|
3090
3101
|
}, g = (0, M.default)("pkt-inputwrapper__helptext-container", !!(e || t || o) && "pkt-inputwrapper__has-helptext", a);
|
|
@@ -3098,7 +3109,7 @@ var Zn = (e) => {
|
|
|
3098
3109
|
children: [o && /* @__PURE__ */ _("div", {
|
|
3099
3110
|
className: "pkt-contents",
|
|
3100
3111
|
children: o
|
|
3101
|
-
}),
|
|
3112
|
+
}), nr(e)]
|
|
3102
3113
|
}), t && /* @__PURE__ */ v("div", {
|
|
3103
3114
|
className: "pkt-inputwrapper__helptext-expandable",
|
|
3104
3115
|
children: [/* @__PURE__ */ v("button", {
|
|
@@ -3112,21 +3123,21 @@ var Zn = (e) => {
|
|
|
3112
3123
|
name: l ? "chevron-thin-up" : "chevron-thin-down"
|
|
3113
3124
|
}), /* @__PURE__ */ _("span", {
|
|
3114
3125
|
className: "pkt-btn__text",
|
|
3115
|
-
dangerouslySetInnerHTML: { __html: n ??
|
|
3126
|
+
dangerouslySetInnerHTML: { __html: n ?? tr }
|
|
3116
3127
|
})]
|
|
3117
3128
|
}), /* @__PURE__ */ _("div", {
|
|
3118
3129
|
id: `${p}-helptext-expandable`,
|
|
3119
3130
|
className: (0, M.default)("pkt-inputwrapper__helptext", l ? "pkt-inputwrapper__helptext-expandable-open" : "pkt-inputwrapper__helptext-expandable-closed"),
|
|
3120
|
-
children:
|
|
3131
|
+
children: nr(t)
|
|
3121
3132
|
})]
|
|
3122
3133
|
})]
|
|
3123
3134
|
});
|
|
3124
3135
|
});
|
|
3125
|
-
|
|
3136
|
+
rr.displayName = "PktHelptext";
|
|
3126
3137
|
//#endregion
|
|
3127
3138
|
//#region src/components/inputwrapper/InputWrapper.tsx
|
|
3128
|
-
var
|
|
3129
|
-
let j =
|
|
3139
|
+
var ir = 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, role: E, counterPosition: D = "bottom", size: O = "medium", strings: k }, A) => {
|
|
3140
|
+
let j = Zn(A), M = ve(["forms", "validation"], k), N = f(() => Jn(), []), P = e || N, ee = x || (n ? `${P}-helptext` : void 0), te = !!a, ne = te && D === "top", F = te && D === "bottom", re = [
|
|
3130
3141
|
"pkt-inputwrapper",
|
|
3131
3142
|
w,
|
|
3132
3143
|
m ? "pkt-inputwrapper--error" : "",
|
|
@@ -3137,13 +3148,13 @@ var rr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3137
3148
|
"pkt-tag",
|
|
3138
3149
|
"pkt-tag--small",
|
|
3139
3150
|
"pkt-tag--thin-text"
|
|
3140
|
-
].join(" "), ae =
|
|
3151
|
+
].join(" "), ae = er(o, s), oe = () => te ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
3141
3152
|
className: "pkt-input__counter",
|
|
3142
3153
|
"aria-hidden": "true",
|
|
3143
3154
|
children: [o, s ? `/${s}` : ""]
|
|
3144
3155
|
}), /* @__PURE__ */ _("div", {
|
|
3145
3156
|
className: "pkt-sr-only",
|
|
3146
|
-
id:
|
|
3157
|
+
id: $n(P),
|
|
3147
3158
|
"aria-live": "polite",
|
|
3148
3159
|
children: ae ? B(M.validation.counterExceeded, {
|
|
3149
3160
|
current: o,
|
|
@@ -3185,7 +3196,7 @@ var rr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3185
3196
|
});
|
|
3186
3197
|
}, L = () => {
|
|
3187
3198
|
let e = S ? n : void 0;
|
|
3188
|
-
return !e && !r ? null : /* @__PURE__ */ _(
|
|
3199
|
+
return !e && !r ? null : /* @__PURE__ */ _(rr, {
|
|
3189
3200
|
forId: P,
|
|
3190
3201
|
helptext: e,
|
|
3191
3202
|
helptextDropdown: r,
|
|
@@ -3224,35 +3235,35 @@ var rr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3224
3235
|
})
|
|
3225
3236
|
});
|
|
3226
3237
|
});
|
|
3227
|
-
|
|
3238
|
+
ir.displayName = "PktInputWrapper";
|
|
3228
3239
|
//#endregion
|
|
3229
3240
|
//#region ../../shared-utils/combobox/option-utils.ts
|
|
3230
|
-
var
|
|
3241
|
+
var ar = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label === t)) || null, or = (e, t) => {
|
|
3231
3242
|
if (!t) return -1;
|
|
3232
3243
|
let n = e.findIndex((e) => e.value === t);
|
|
3233
3244
|
return n >= 0 ? n : e.findIndex((e) => e.label === t);
|
|
3234
|
-
},
|
|
3245
|
+
}, sr = (e) => e.value + (e.label || "") + (e.prefix || ""), cr = (e, t) => (e.fulltext || sr(e)).toLowerCase().includes(t), lr = (e, t) => {
|
|
3235
3246
|
if (!t) return [...e];
|
|
3236
3247
|
let n = t.toLowerCase();
|
|
3237
|
-
return e.filter((e) =>
|
|
3238
|
-
},
|
|
3248
|
+
return e.filter((e) => cr(e, n));
|
|
3249
|
+
}, ur = (e, t) => t !== null && e >= t, dr = (e, t) => {
|
|
3239
3250
|
if (!e) return "";
|
|
3240
3251
|
switch (t) {
|
|
3241
3252
|
case "prefixAndValue": return `${e.prefix || ""} ${e.value}`.trim();
|
|
3242
3253
|
case "value": return e.value;
|
|
3243
3254
|
default: return e.label || e.value;
|
|
3244
3255
|
}
|
|
3245
|
-
},
|
|
3256
|
+
}, fr = (e, t) => e ? Array.isArray(e) ? t ? e : e.length > 0 ? [e[0]] : [] : t ? e.split(",").filter(Boolean) : [e] : [], pr = (e, t) => {
|
|
3246
3257
|
if (!t) return {
|
|
3247
3258
|
filtered: [...e],
|
|
3248
3259
|
suggestion: null
|
|
3249
3260
|
};
|
|
3250
|
-
let n = t.toLowerCase(), r = e.filter((e) =>
|
|
3261
|
+
let n = t.toLowerCase(), r = e.filter((e) => cr(e, n));
|
|
3251
3262
|
return {
|
|
3252
3263
|
filtered: r,
|
|
3253
3264
|
suggestion: r.find((e) => !e.selected && e.label?.toLowerCase().startsWith(n)) || null
|
|
3254
3265
|
};
|
|
3255
|
-
},
|
|
3266
|
+
}, mr = (e, t, n, r) => {
|
|
3256
3267
|
if (!e.trim()) return {
|
|
3257
3268
|
addValueText: null,
|
|
3258
3269
|
userInfoMessage: ""
|
|
@@ -3271,7 +3282,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3271
3282
|
addValueText: null,
|
|
3272
3283
|
userInfoMessage: ""
|
|
3273
3284
|
};
|
|
3274
|
-
},
|
|
3285
|
+
}, hr = (e, t, n) => {
|
|
3275
3286
|
switch (e) {
|
|
3276
3287
|
case ",": return n ? "addValue" : null;
|
|
3277
3288
|
case "Enter": return "addValue";
|
|
@@ -3280,12 +3291,12 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3280
3291
|
case "Escape": return "closeOptions";
|
|
3281
3292
|
default: return null;
|
|
3282
3293
|
}
|
|
3283
|
-
},
|
|
3294
|
+
}, gr = (e, t, n, r, i) => {
|
|
3284
3295
|
if (!e) return {
|
|
3285
3296
|
action: "none",
|
|
3286
3297
|
value: null
|
|
3287
3298
|
};
|
|
3288
|
-
let a =
|
|
3299
|
+
let a = ar(n, e);
|
|
3289
3300
|
return !t.includes(e) && !a ? r ? {
|
|
3290
3301
|
action: "addUserValue",
|
|
3291
3302
|
value: e
|
|
@@ -3302,36 +3313,36 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3302
3313
|
action: "none",
|
|
3303
3314
|
value: null
|
|
3304
3315
|
};
|
|
3305
|
-
},
|
|
3306
|
-
let r =
|
|
3316
|
+
}, _r = (e, t, n) => {
|
|
3317
|
+
let r = ar(t, e);
|
|
3307
3318
|
return n === "label" && r?.label ? r.label : e;
|
|
3308
|
-
},
|
|
3319
|
+
}, vr = (e) => {
|
|
3309
3320
|
e.scrollIntoView({ block: "nearest" }), window.setTimeout(() => e.focus(), 0);
|
|
3310
|
-
},
|
|
3321
|
+
}, yr = (e) => Array.from(e.querySelectorAll("[role=\"option\"]:not([data-disabled])") || []), br = (e) => {
|
|
3311
3322
|
let t = e.nextElementSibling;
|
|
3312
|
-
t &&
|
|
3313
|
-
},
|
|
3323
|
+
t && vr(t);
|
|
3324
|
+
}, xr = (e, t, n) => {
|
|
3314
3325
|
let r = e.previousElementSibling;
|
|
3315
3326
|
if (e.dataset.index === "0" && n) {
|
|
3316
3327
|
let e = t.querySelector("[role=\"searchbox\"]");
|
|
3317
|
-
e &&
|
|
3318
|
-
} else r &&
|
|
3319
|
-
},
|
|
3320
|
-
let t =
|
|
3321
|
-
t[0] &&
|
|
3322
|
-
},
|
|
3328
|
+
e && vr(e);
|
|
3329
|
+
} else r && vr(r);
|
|
3330
|
+
}, Sr = (e) => {
|
|
3331
|
+
let t = yr(e);
|
|
3332
|
+
t[0] && vr(t[0]);
|
|
3333
|
+
}, Cr = (e, t) => {
|
|
3323
3334
|
if (t.disabled) return;
|
|
3324
|
-
let n =
|
|
3335
|
+
let n = yr(e);
|
|
3325
3336
|
if (t.allowUserInput && t.customUserInput) {
|
|
3326
3337
|
let t = e.querySelector("[data-type=\"new-option\"]");
|
|
3327
3338
|
if (t) {
|
|
3328
|
-
|
|
3339
|
+
vr(t);
|
|
3329
3340
|
return;
|
|
3330
3341
|
}
|
|
3331
3342
|
}
|
|
3332
3343
|
let r = n.find((e) => e.dataset.selected === "true");
|
|
3333
3344
|
if (r) {
|
|
3334
|
-
|
|
3345
|
+
vr(r);
|
|
3335
3346
|
return;
|
|
3336
3347
|
}
|
|
3337
3348
|
if (t.includeSearch && !(document.activeElement instanceof HTMLInputElement)) {
|
|
@@ -3341,8 +3352,8 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3341
3352
|
return;
|
|
3342
3353
|
}
|
|
3343
3354
|
}
|
|
3344
|
-
n[0] &&
|
|
3345
|
-
},
|
|
3355
|
+
n[0] && vr(n[0]);
|
|
3356
|
+
}, wr = ({ state: e, outside: t = !1 }) => {
|
|
3346
3357
|
let { values: n, options: r, disabled: i, displayValueAs: a, handleTagRemove: o, handleTagKeydown: s, focusedTagIndex: l } = e, u = p([]);
|
|
3347
3358
|
if (c(() => {
|
|
3348
3359
|
!t && l >= 0 && l < n.length && u.current[l]?.focus();
|
|
@@ -3352,10 +3363,10 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3352
3363
|
n.length
|
|
3353
3364
|
]), n.length === 0) return null;
|
|
3354
3365
|
let d = n.map((e, n) => {
|
|
3355
|
-
let c =
|
|
3366
|
+
let c = ar(r, e), d = c?.tagSkinColor, f = c ? dr(c, a) : e;
|
|
3356
3367
|
return i ? /* @__PURE__ */ _("li", {
|
|
3357
3368
|
role: "listitem",
|
|
3358
|
-
children: /* @__PURE__ */ _(
|
|
3369
|
+
children: /* @__PURE__ */ _(Gn, {
|
|
3359
3370
|
skin: d || "blue-dark",
|
|
3360
3371
|
children: /* @__PURE__ */ _("span", {
|
|
3361
3372
|
className: "pkt-combobox__value",
|
|
@@ -3364,7 +3375,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3364
3375
|
})
|
|
3365
3376
|
}, e) : t ? /* @__PURE__ */ _("li", {
|
|
3366
3377
|
role: "listitem",
|
|
3367
|
-
children: /* @__PURE__ */ _(
|
|
3378
|
+
children: /* @__PURE__ */ _(Gn, {
|
|
3368
3379
|
skin: d || "blue-dark",
|
|
3369
3380
|
closeTag: !0,
|
|
3370
3381
|
onClose: () => o(e),
|
|
@@ -3377,7 +3388,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3377
3388
|
role: "listitem",
|
|
3378
3389
|
onClick: (e) => e.stopPropagation(),
|
|
3379
3390
|
onMouseDown: (e) => e.preventDefault(),
|
|
3380
|
-
children: /* @__PURE__ */ _(
|
|
3391
|
+
children: /* @__PURE__ */ _(Gn, {
|
|
3381
3392
|
ref: (e) => {
|
|
3382
3393
|
u.current[n] = e;
|
|
3383
3394
|
},
|
|
@@ -3405,17 +3416,17 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3405
3416
|
className: "pkt-combobox__tag-list",
|
|
3406
3417
|
children: d
|
|
3407
3418
|
});
|
|
3408
|
-
},
|
|
3419
|
+
}, Tr = ({ state: e }) => {
|
|
3409
3420
|
let { values: t, options: n, editingSingleValue: r, displayValueAs: i } = e;
|
|
3410
3421
|
if (r || t.length === 0) return null;
|
|
3411
|
-
let a =
|
|
3422
|
+
let a = ar(n, t[0]);
|
|
3412
3423
|
if (!a) return null;
|
|
3413
|
-
let o =
|
|
3424
|
+
let o = dr(a, i);
|
|
3414
3425
|
return /* @__PURE__ */ _("span", {
|
|
3415
3426
|
className: "pkt-combobox__value",
|
|
3416
3427
|
children: o
|
|
3417
3428
|
});
|
|
3418
|
-
},
|
|
3429
|
+
}, Er = ({ state: e }) => {
|
|
3419
3430
|
let { id: t, inputId: n, listboxId: r, values: i, options: a, isOpen: o, multiple: s, typeahead: c, allowUserInput: l, tagPlacement: u, placeholder: d, disabled: f, fullwidth: p, hasError: m, label: h, inputFocus: g, skipInputTab: y, restoreInputTab: b, inputRef: x, triggerRef: S, handleInputChange: C, handleInputKeydown: w, handleInputFocus: T, handleInputBlur: E, handleInputClick: D, handlePlaceholderClick: O, handleSelectOnlyKeydown: k, name: A, inputSize: j } = e, M = [
|
|
3420
3431
|
"pkt-combobox__input",
|
|
3421
3432
|
`pkt-combobox__input--${j}`,
|
|
@@ -3423,7 +3434,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3423
3434
|
o && "pkt-combobox__input--open",
|
|
3424
3435
|
m && "pkt-combobox__input--error",
|
|
3425
3436
|
f && "pkt-combobox__input--disabled"
|
|
3426
|
-
].filter(Boolean).join(" "), N = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), P = c || l, ee = !P && d && (!i.length || s && u === "outside") && !g, te = u !== "outside", ne = o && i[0] &&
|
|
3437
|
+
].filter(Boolean).join(" "), N = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), P = c || l, ee = !P && d && (!i.length || s && u === "outside") && !g, te = u !== "outside", ne = o && i[0] && ar(a, i[0]) ? `${r}-${or(a, i[0])}` : void 0, F = s && i.length > 0 ? `${i.length} valgt` : void 0, re = Qn({
|
|
3427
3438
|
id: P ? n : `${t}-combobox`,
|
|
3428
3439
|
hasHelptext: !!e.helptext,
|
|
3429
3440
|
ariaDescribedby: e.ariaDescribedby
|
|
@@ -3453,7 +3464,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3453
3464
|
className: "pkt-combobox__placeholder",
|
|
3454
3465
|
onClick: O,
|
|
3455
3466
|
children: d
|
|
3456
|
-
}) : te ? s ? /* @__PURE__ */ _(
|
|
3467
|
+
}) : te ? s ? /* @__PURE__ */ _(wr, { state: e }) : P ? null : /* @__PURE__ */ _(Tr, { state: e }) : null,
|
|
3457
3468
|
P ? /* @__PURE__ */ _("div", {
|
|
3458
3469
|
className: "pkt-combobox__input-div combobox__input",
|
|
3459
3470
|
children: /* @__PURE__ */ _("input", {
|
|
@@ -3492,7 +3503,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3492
3503
|
})
|
|
3493
3504
|
]
|
|
3494
3505
|
});
|
|
3495
|
-
},
|
|
3506
|
+
}, Dr = ({ state: e }) => {
|
|
3496
3507
|
let t = ve(["listbox"], e.strings), { listboxId: n, label: r, isOpen: i, options: a, filteredOptions: o, multiple: s, disabled: c, maxIsReached: l, maxlength: u, includeSearch: d, allowUserInput: f, addValueText: p, userInfoMessage: m, searchPlaceholder: h, searchValue: y, handleOptionClick: b, handleOptionKeydown: x, handleSearchInput: S, handleSearchKeydown: C, handleNewOptionClick: w, handleNewOptionKeydown: T, listboxRef: E } = e, D = o.filter((e) => e.selected).length, O = s && D > 0 && u != null && u > 0, k = f && p && !l, A = !!m, j = [
|
|
3497
3508
|
"pkt-listbox",
|
|
3498
3509
|
i && "pkt-listbox__open",
|
|
@@ -3625,7 +3636,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3625
3636
|
className: "pkt-visually-hidden",
|
|
3626
3637
|
children: m
|
|
3627
3638
|
})] });
|
|
3628
|
-
},
|
|
3639
|
+
}, Or = (e, t) => {
|
|
3629
3640
|
let [n, r] = m(null);
|
|
3630
3641
|
return c(() => {
|
|
3631
3642
|
let n = e.current;
|
|
@@ -3643,16 +3654,16 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3643
3654
|
};
|
|
3644
3655
|
//#endregion
|
|
3645
3656
|
//#region src/components/combobox/useComboboxState.ts
|
|
3646
|
-
function
|
|
3657
|
+
function kr(e, t) {
|
|
3647
3658
|
return e.map((e) => ({
|
|
3648
3659
|
...e,
|
|
3649
3660
|
label: e.label || e.value,
|
|
3650
|
-
fulltext:
|
|
3661
|
+
fulltext: sr(e),
|
|
3651
3662
|
selected: t.includes(e.value)
|
|
3652
3663
|
}));
|
|
3653
3664
|
}
|
|
3654
|
-
function
|
|
3655
|
-
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: P, requiredTag: ee = !1, requiredText: te, tagText: ne, useWrapper: F = !0, inline: re = !1, counter: ie, inputSize: ae = "medium", name: oe, form: se, ariaDescribedby: I, className: L, onChange: R, onValueChange: ce, children: z, strings: le } = t, ue = `${r}-input`, de = `${r}-listbox`, V = v || b, H = p(null), U = p(null), W = p(null), G = p(null), K = p(null), fe =
|
|
3665
|
+
function Ar(t, n) {
|
|
3666
|
+
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: P, requiredTag: ee = !1, requiredText: te, tagText: ne, useWrapper: F = !0, inline: re = !1, counter: ie, inputSize: ae = "medium", name: oe, form: se, ariaDescribedby: I, className: L, onChange: R, onValueChange: ce, children: z, strings: le } = t, ue = `${r}-input`, de = `${r}-listbox`, V = v || b, H = p(null), U = p(null), W = p(null), G = p(null), K = p(null), fe = Or(K, se), q = o(() => {
|
|
3656
3667
|
V ? H.current?.focus() : W.current?.focus();
|
|
3657
3668
|
}, [V]), pe = o(() => {
|
|
3658
3669
|
Pe(!0);
|
|
@@ -3673,33 +3684,33 @@ function kr(t, n) {
|
|
|
3673
3684
|
}), t;
|
|
3674
3685
|
}, [z]), he = f(() => h && h.length > 0 ? h.map((e) => ({
|
|
3675
3686
|
...e,
|
|
3676
|
-
fulltext:
|
|
3687
|
+
fulltext: sr(e)
|
|
3677
3688
|
})) : d && d.length > 0 ? d.map((e) => ({
|
|
3678
3689
|
...e,
|
|
3679
|
-
fulltext:
|
|
3690
|
+
fulltext: sr(e)
|
|
3680
3691
|
})) : me.length > 0 ? me.map((e) => ({
|
|
3681
3692
|
...e,
|
|
3682
|
-
fulltext:
|
|
3693
|
+
fulltext: sr(e)
|
|
3683
3694
|
})) : [], [
|
|
3684
3695
|
h,
|
|
3685
3696
|
d,
|
|
3686
3697
|
me
|
|
3687
3698
|
]), J = s !== void 0, [ge, Y] = m(() => {
|
|
3688
|
-
let e =
|
|
3699
|
+
let e = fr(s ?? l, g), t = he.filter((t) => t.selected && !e.includes(t.value)).map((e) => e.value);
|
|
3689
3700
|
return t.length ? g ? [...e, ...t] : e.length ? e : [t[0]] : e;
|
|
3690
3701
|
}), _e = p(ge);
|
|
3691
3702
|
c(() => {
|
|
3692
|
-
J && Y(
|
|
3703
|
+
J && Y(fr(s, g));
|
|
3693
3704
|
}, [
|
|
3694
3705
|
s,
|
|
3695
3706
|
J,
|
|
3696
3707
|
g
|
|
3697
3708
|
]);
|
|
3698
|
-
let X = J ?
|
|
3709
|
+
let X = J ? fr(s, g) : ge, [ye, be] = m([]), Z = f(() => kr([...ye.filter((e) => !he.some((t) => t.value === e.value)), ...he], X), [
|
|
3699
3710
|
he,
|
|
3700
3711
|
ye,
|
|
3701
3712
|
X
|
|
3702
|
-
]), [Q, xe] = m(!1), [Se, Ce] = m(""), [we, Te] = m(""), [Ee, De] = m(""), [Oe, ke] = m(null), [Ae, je] = m(null), [Me, $] = m(!1), [Ne, Pe] = m(!1), Fe = p(!1), [Ie, Le] = m(!1), [Re, ze] = m(-1), Be = ve(["combobox"], le), Ve = Ee ? B(Be.combobox[Ee], { value: Oe ?? "" }) : "", He =
|
|
3713
|
+
]), [Q, xe] = m(!1), [Se, Ce] = m(""), [we, Te] = m(""), [Ee, De] = m(""), [Oe, ke] = m(null), [Ae, je] = m(null), [Me, $] = m(!1), [Ne, Pe] = m(!1), Fe = p(!1), [Ie, Le] = m(!1), [Re, ze] = m(-1), Be = ve(["combobox"], le), Ve = Ee ? B(Be.combobox[Ee], { value: Oe ?? "" }) : "", He = ur(X.length, _ ?? null), Ue = ie ?? (g && _ != null), We = f(() => Se ? v ? pr(Z, Se).filtered : lr(Z, Se) : Z, [
|
|
3703
3714
|
Z,
|
|
3704
3715
|
Se,
|
|
3705
3716
|
v
|
|
@@ -3713,7 +3724,7 @@ function kr(t, n) {
|
|
|
3713
3724
|
U.current && (U.current.value = qe);
|
|
3714
3725
|
}, [qe]), c(() => {
|
|
3715
3726
|
if (Q || !H.current) return;
|
|
3716
|
-
let e = !g && X[0] ?
|
|
3727
|
+
let e = !g && X[0] ? _r(X[0], Z, x) : "";
|
|
3717
3728
|
H.current.value !== e && (H.current.value = e);
|
|
3718
3729
|
}, [
|
|
3719
3730
|
X,
|
|
@@ -3730,7 +3741,7 @@ function kr(t, n) {
|
|
|
3730
3741
|
Ke
|
|
3731
3742
|
]), Ye = o((e) => {
|
|
3732
3743
|
if (!e || X.includes(e)) return;
|
|
3733
|
-
if (g &&
|
|
3744
|
+
if (g && ur(X.length, _ ?? null)) {
|
|
3734
3745
|
De("maxSelected");
|
|
3735
3746
|
return;
|
|
3736
3747
|
}
|
|
@@ -3744,7 +3755,7 @@ function kr(t, n) {
|
|
|
3744
3755
|
]), Xe = o((e) => {
|
|
3745
3756
|
if (!e) return;
|
|
3746
3757
|
let t = X.filter((t) => t !== e);
|
|
3747
|
-
|
|
3758
|
+
ar(Z, e)?.userAdded && be((t) => t.filter((t) => t.value !== e)), Je(t);
|
|
3748
3759
|
}, [
|
|
3749
3760
|
X,
|
|
3750
3761
|
Z,
|
|
@@ -3756,7 +3767,7 @@ function kr(t, n) {
|
|
|
3756
3767
|
let t;
|
|
3757
3768
|
if (!g) t = [e];
|
|
3758
3769
|
else {
|
|
3759
|
-
if (
|
|
3770
|
+
if (ar(Z, e) || ur(X.length, _ ?? null)) return;
|
|
3760
3771
|
t = [...X, e];
|
|
3761
3772
|
}
|
|
3762
3773
|
let n = {
|
|
@@ -3776,7 +3787,7 @@ function kr(t, n) {
|
|
|
3776
3787
|
if (je(null), e && H.current && H.current.type !== "hidden") {
|
|
3777
3788
|
Ce(""), Te("");
|
|
3778
3789
|
let e = t === void 0 ? X[0] : t;
|
|
3779
|
-
!g && e ? H.current.value =
|
|
3790
|
+
!g && e ? H.current.value = _r(e, Z, x) : H.current.value = "", g || (Le(!1), De(""));
|
|
3780
3791
|
}
|
|
3781
3792
|
}, [
|
|
3782
3793
|
g,
|
|
@@ -3786,8 +3797,8 @@ function kr(t, n) {
|
|
|
3786
3797
|
]), et = o((e) => {
|
|
3787
3798
|
if (T) return;
|
|
3788
3799
|
De(""), je(null);
|
|
3789
|
-
let t =
|
|
3790
|
-
i || (!r && b && !a ? (Qe(e), d = "valueAdded", l = s, o && (m = e || "")) : !r && !b ? (o && X[0] && Xe(X[0]), u = !1, l = !0, d = "noResults") : n ? (Xe(t), l = !0, m = "", o && V && H.current && H.current.type !== "hidden" && (H.current.value = "")) : a && o ? (Ze(), l = !0, m = "") : o ? (X[0] && Xe(X[0]), Ye(t), l = !1, m = t || "", d = "valueSelected", f = V ?
|
|
3800
|
+
let t = ar(Z, e)?.value || null, n = X.includes(e || t || ""), r = !!t, i = Z.find((t) => t.value === e)?.disabled || !1, a = !e?.trim(), o = !g, s = g, c = ur(X.length, _ ?? null), l = !1, u = !0, d = "", f = null, p = "", m;
|
|
3801
|
+
i || (!r && b && !a ? (Qe(e), d = "valueAdded", l = s, o && (m = e || "")) : !r && !b ? (o && X[0] && Xe(X[0]), u = !1, l = !0, d = "noResults") : n ? (Xe(t), l = !0, m = "", o && V && H.current && H.current.type !== "hidden" && (H.current.value = "")) : a && o ? (Ze(), l = !0, m = "") : o ? (X[0] && Xe(X[0]), Ye(t), l = !1, m = t || "", d = "valueSelected", f = V ? _r(t || "", Z, x) : dr(ar(Z, t), x)) : s && !c ? (Ye(t), l = !0) : s && c ? (d = "maxSelected", u = !1, p = e || "") : (o && Ze(), d = "noValidValue", u = !1, l = !0, p = e || "", m = ""), xe(l), Ce(p), $e(u, m), De(d), ke(f), l || window.setTimeout(() => {
|
|
3791
3802
|
pe();
|
|
3792
3803
|
}, 0));
|
|
3793
3804
|
}, [
|
|
@@ -3811,11 +3822,11 @@ function kr(t, n) {
|
|
|
3811
3822
|
if (!g) {
|
|
3812
3823
|
if (!e) X[0] && Xe(X[0]), t = void 0;
|
|
3813
3824
|
else {
|
|
3814
|
-
let n =
|
|
3825
|
+
let n = ar(Z, e);
|
|
3815
3826
|
n && n.value !== X[0] ? (X[0] && Xe(X[0]), Ye(n.value), t = n.value) : !n && b && (X[0] && Xe(X[0]), Qe(e), t = e);
|
|
3816
3827
|
}
|
|
3817
3828
|
} else if (e !== "") {
|
|
3818
|
-
let { action: t, value: n } =
|
|
3829
|
+
let { action: t, value: n } = gr(e, X, Z, b, g);
|
|
3819
3830
|
switch (t) {
|
|
3820
3831
|
case "addUserValue":
|
|
3821
3832
|
Qe(n);
|
|
@@ -3826,7 +3837,7 @@ function kr(t, n) {
|
|
|
3826
3837
|
case "removeValue": Xe(n);
|
|
3827
3838
|
}
|
|
3828
3839
|
}
|
|
3829
|
-
!g && t ? H.current.value =
|
|
3840
|
+
!g && t ? H.current.value = _r(t, Z, x) : H.current.value = "";
|
|
3830
3841
|
}
|
|
3831
3842
|
xe(!1), Le(!1);
|
|
3832
3843
|
}, [
|
|
@@ -3843,7 +3854,7 @@ function kr(t, n) {
|
|
|
3843
3854
|
je(null), De(""), !g && X[0] && Xe(X[0]);
|
|
3844
3855
|
return;
|
|
3845
3856
|
}
|
|
3846
|
-
let t =
|
|
3857
|
+
let t = mr(e, X, Z, b);
|
|
3847
3858
|
je(t.addValueText), De(t.userInfoMessage);
|
|
3848
3859
|
}, [
|
|
3849
3860
|
X,
|
|
@@ -3855,7 +3866,7 @@ function kr(t, n) {
|
|
|
3855
3866
|
if (T) return;
|
|
3856
3867
|
let t = e.target.value;
|
|
3857
3868
|
if (Te(t), Ce(t), nt(t), v && t) {
|
|
3858
|
-
let { suggestion: n } =
|
|
3869
|
+
let { suggestion: n } = pr(Z, t);
|
|
3859
3870
|
n?.label && H.current && !e.nativeEvent.inputType?.includes("deleteContent") && (H.current.value = n.label, window.setTimeout(() => H.current?.setSelectionRange(t.length, n.label.length), 0));
|
|
3860
3871
|
}
|
|
3861
3872
|
}, [
|
|
@@ -3877,7 +3888,7 @@ function kr(t, n) {
|
|
|
3877
3888
|
e.preventDefault(), ze(X.length - 1);
|
|
3878
3889
|
return;
|
|
3879
3890
|
}
|
|
3880
|
-
let t =
|
|
3891
|
+
let t = hr(e.key, e.shiftKey, g);
|
|
3881
3892
|
if (t && !(e.key === "Tab" && !Q)) {
|
|
3882
3893
|
if (t === "focusListbox" && e.key === "Tab" && !G.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
|
|
3883
3894
|
tt();
|
|
@@ -3894,7 +3905,7 @@ function kr(t, n) {
|
|
|
3894
3905
|
break;
|
|
3895
3906
|
}
|
|
3896
3907
|
case "focusListbox":
|
|
3897
|
-
G.current && (Q || xe(!0),
|
|
3908
|
+
G.current && (Q || xe(!0), Cr(G.current, {
|
|
3898
3909
|
disabled: T,
|
|
3899
3910
|
allowUserInput: b,
|
|
3900
3911
|
customUserInput: Ae,
|
|
@@ -3922,7 +3933,7 @@ function kr(t, n) {
|
|
|
3922
3933
|
Fe.current = !1, $(!0);
|
|
3923
3934
|
return;
|
|
3924
3935
|
}
|
|
3925
|
-
!g && X[0] && H.current && H.current.type !== "hidden" && (Le(!0), H.current.value =
|
|
3936
|
+
!g && X[0] && H.current && H.current.type !== "hidden" && (Le(!0), H.current.value = _r(X[0], Z, x)), $(!0), Ce(""), xe(!0);
|
|
3926
3937
|
}
|
|
3927
3938
|
}, [
|
|
3928
3939
|
T,
|
|
@@ -3949,7 +3960,7 @@ function kr(t, n) {
|
|
|
3949
3960
|
else {
|
|
3950
3961
|
e.stopPropagation(), e.preventDefault();
|
|
3951
3962
|
let t = !Q;
|
|
3952
|
-
xe(t), t && G.current &&
|
|
3963
|
+
xe(t), t && G.current && Cr(G.current, {
|
|
3953
3964
|
disabled: T,
|
|
3954
3965
|
allowUserInput: b,
|
|
3955
3966
|
customUserInput: Ae,
|
|
@@ -3972,7 +3983,7 @@ function kr(t, n) {
|
|
|
3972
3983
|
case "ArrowDown":
|
|
3973
3984
|
case "ArrowUp":
|
|
3974
3985
|
e.preventDefault(), Q ? xe(!1) : (xe(!0), G.current && window.setTimeout(() => {
|
|
3975
|
-
G.current &&
|
|
3986
|
+
G.current && Cr(G.current, {
|
|
3976
3987
|
disabled: T,
|
|
3977
3988
|
allowUserInput: b && !He,
|
|
3978
3989
|
customUserInput: Ae,
|
|
@@ -3986,7 +3997,7 @@ function kr(t, n) {
|
|
|
3986
3997
|
case "Home":
|
|
3987
3998
|
case "End":
|
|
3988
3999
|
e.preventDefault(), Q || xe(!0), G.current && window.setTimeout(() => {
|
|
3989
|
-
G.current &&
|
|
4000
|
+
G.current && Cr(G.current, {
|
|
3990
4001
|
disabled: T,
|
|
3991
4002
|
allowUserInput: b && !He,
|
|
3992
4003
|
customUserInput: Ae,
|
|
@@ -4023,10 +4034,10 @@ function kr(t, n) {
|
|
|
4023
4034
|
e.preventDefault(), et(t);
|
|
4024
4035
|
break;
|
|
4025
4036
|
case "ArrowDown":
|
|
4026
|
-
e.preventDefault(),
|
|
4037
|
+
e.preventDefault(), br(e.currentTarget);
|
|
4027
4038
|
break;
|
|
4028
4039
|
case "ArrowUp":
|
|
4029
|
-
e.preventDefault(), G.current &&
|
|
4040
|
+
e.preventDefault(), G.current && xr(e.currentTarget, G.current, y);
|
|
4030
4041
|
break;
|
|
4031
4042
|
case "Escape":
|
|
4032
4043
|
e.preventDefault(), xe(!1), V && (Fe.current = !0), q();
|
|
@@ -4091,10 +4102,10 @@ function kr(t, n) {
|
|
|
4091
4102
|
e.preventDefault(), et(e.currentTarget.dataset.value || "");
|
|
4092
4103
|
break;
|
|
4093
4104
|
case "ArrowDown":
|
|
4094
|
-
e.preventDefault(), G.current &&
|
|
4105
|
+
e.preventDefault(), G.current && Sr(G.current);
|
|
4095
4106
|
break;
|
|
4096
4107
|
case "ArrowUp":
|
|
4097
|
-
e.preventDefault(), G.current &&
|
|
4108
|
+
e.preventDefault(), G.current && xr(e.currentTarget, G.current, y);
|
|
4098
4109
|
break;
|
|
4099
4110
|
case "Escape": e.preventDefault(), xe(!1), V && (Fe.current = !0), q();
|
|
4100
4111
|
}
|
|
@@ -4214,8 +4225,8 @@ function kr(t, n) {
|
|
|
4214
4225
|
}
|
|
4215
4226
|
//#endregion
|
|
4216
4227
|
//#region src/components/combobox/Combobox.tsx
|
|
4217
|
-
var
|
|
4218
|
-
let n =
|
|
4228
|
+
var jr = i((e, t) => {
|
|
4229
|
+
let n = Ar(e, t), r = [
|
|
4219
4230
|
"pkt-combobox-component",
|
|
4220
4231
|
n.fullwidth && "pkt-combobox-component--fullwidth",
|
|
4221
4232
|
n.className
|
|
@@ -4224,7 +4235,7 @@ var Ar = i((e, t) => {
|
|
|
4224
4235
|
className: r,
|
|
4225
4236
|
ref: n.wrapperRef,
|
|
4226
4237
|
id: n.id || void 0,
|
|
4227
|
-
children: [/* @__PURE__ */ v(
|
|
4238
|
+
children: [/* @__PURE__ */ v(ir, {
|
|
4228
4239
|
strings: n.strings,
|
|
4229
4240
|
forId: a,
|
|
4230
4241
|
hasFieldset: e.hasFieldset ?? !i,
|
|
@@ -4250,8 +4261,8 @@ var Ar = i((e, t) => {
|
|
|
4250
4261
|
children: [/* @__PURE__ */ v("div", {
|
|
4251
4262
|
className: "pkt-combobox",
|
|
4252
4263
|
onBlur: n.handleFocusOut,
|
|
4253
|
-
children: [/* @__PURE__ */ _(
|
|
4254
|
-
}), n.tagPlacement === "outside" && n.multiple && /* @__PURE__ */ _(
|
|
4264
|
+
children: [/* @__PURE__ */ _(Er, { state: n }), /* @__PURE__ */ _(Dr, { state: n })]
|
|
4265
|
+
}), n.tagPlacement === "outside" && n.multiple && /* @__PURE__ */ _(wr, {
|
|
4255
4266
|
state: n,
|
|
4256
4267
|
outside: !0
|
|
4257
4268
|
})]
|
|
@@ -4267,10 +4278,10 @@ var Ar = i((e, t) => {
|
|
|
4267
4278
|
})]
|
|
4268
4279
|
});
|
|
4269
4280
|
});
|
|
4270
|
-
|
|
4281
|
+
jr.displayName = "PktCombobox";
|
|
4271
4282
|
//#endregion
|
|
4272
4283
|
//#region src/components/consent/Consent.tsx
|
|
4273
|
-
var
|
|
4284
|
+
var Mr = null, Nr = () => Mr || (Mr = new Promise((e, t) => {
|
|
4274
4285
|
if (document.querySelector("#oslo-consent-script")) {
|
|
4275
4286
|
e();
|
|
4276
4287
|
return;
|
|
@@ -4279,14 +4290,14 @@ var jr = null, Mr = () => jr || (jr = new Promise((e, t) => {
|
|
|
4279
4290
|
n.src = "https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js", n.id = "oslo-consent-script", n.onload = () => e(), n.onerror = t, document.head.appendChild(n);
|
|
4280
4291
|
let r = document.createElement("link");
|
|
4281
4292
|
r.href = "https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css", r.type = "text/css", r.rel = "stylesheet", r.id = "oslo-consent-styles", document.head.appendChild(r);
|
|
4282
|
-
}),
|
|
4293
|
+
}), Mr), Pr = (e) => {
|
|
4283
4294
|
if (typeof e != "string") return e;
|
|
4284
4295
|
try {
|
|
4285
4296
|
return JSON.parse(e);
|
|
4286
4297
|
} catch {
|
|
4287
4298
|
return e;
|
|
4288
4299
|
}
|
|
4289
|
-
},
|
|
4300
|
+
}, Fr = (e) => Pr(e.value).items.reduce((e, t) => (e[t.name] = t.consent, e), {}), Ir = i(function({ devMode: e = !1, cookieDomain: t = null, cookieSecure: n = null, cookieExpiryDays: r = null, hotjarId: i = null, googleAnalyticsId: a = null, i18nLanguage: o = "nb", triggerType: s = "button", triggerText: l, onToggleConsent: u, ...d }, f) {
|
|
4290
4301
|
let m = p(u);
|
|
4291
4302
|
m.current = u;
|
|
4292
4303
|
let h = p({
|
|
@@ -4312,7 +4323,7 @@ var jr = null, Mr = () => jr || (jr = new Promise((e, t) => {
|
|
|
4312
4323
|
let r = (e) => {
|
|
4313
4324
|
let t = m.current;
|
|
4314
4325
|
t && t(new CustomEvent("toggle-consent", {
|
|
4315
|
-
detail:
|
|
4326
|
+
detail: Fr(e),
|
|
4316
4327
|
bubbles: !0,
|
|
4317
4328
|
cancelable: !1
|
|
4318
4329
|
}));
|
|
@@ -4330,7 +4341,7 @@ var jr = null, Mr = () => jr || (jr = new Promise((e, t) => {
|
|
|
4330
4341
|
e || r({ value: o });
|
|
4331
4342
|
}, 0), t && i.off("CookieManager.setCookie", t), t = (e) => r(e), i.on("CookieManager.setCookie", t);
|
|
4332
4343
|
});
|
|
4333
|
-
},
|
|
4344
|
+
}, Nr().then(() => {
|
|
4334
4345
|
e || g.current();
|
|
4335
4346
|
}), () => {
|
|
4336
4347
|
e = !0, t && window.__cookieEvents?.off("CookieManager.setCookie", t);
|
|
@@ -4370,13 +4381,13 @@ var jr = null, Mr = () => jr || (jr = new Promise((e, t) => {
|
|
|
4370
4381
|
children: y
|
|
4371
4382
|
});
|
|
4372
4383
|
});
|
|
4373
|
-
|
|
4384
|
+
Ir.displayName = "PktConsent";
|
|
4374
4385
|
//#endregion
|
|
4375
4386
|
//#region ../../shared-utils/device-utils.ts
|
|
4376
|
-
var
|
|
4387
|
+
var Lr = () => {
|
|
4377
4388
|
let e = navigator.userAgent;
|
|
4378
4389
|
return !!(/iP(hone|od|ad)/.test(e) || /Macintosh/.test(e) && "ontouchend" in document);
|
|
4379
|
-
},
|
|
4390
|
+
}, Rr = () => Lr() ? "text" : "date", zr = (e) => !e || e.length !== 2 || dn(e[0], e[1]), Br = (e, t, n, r, i, a, o = "medium") => ({
|
|
4380
4391
|
"pkt-input": !0,
|
|
4381
4392
|
"pkt-datepicker__input": !0,
|
|
4382
4393
|
[`pkt-input--${o}`]: !0,
|
|
@@ -4385,27 +4396,27 @@ var Ir = () => {
|
|
|
4385
4396
|
"pkt-datepicker--multiple": n,
|
|
4386
4397
|
"pkt-datepicker--range": r,
|
|
4387
4398
|
"ios-readonly-hack": i === !1 && a === "text"
|
|
4388
|
-
}),
|
|
4399
|
+
}), Vr = (e = "medium") => ({
|
|
4389
4400
|
"pkt-input-icon": !0,
|
|
4390
4401
|
"pkt-btn": !0,
|
|
4391
4402
|
"pkt-btn--icon-only": !0,
|
|
4392
4403
|
"pkt-btn--tertiary": !0,
|
|
4393
4404
|
[`pkt-btn--${e}`]: !0,
|
|
4394
4405
|
"pkt-datepicker__calendar-button": !0
|
|
4395
|
-
}),
|
|
4406
|
+
}), Hr = (e) => ({
|
|
4396
4407
|
"pkt-input-prefix": e,
|
|
4397
4408
|
"pkt-hide": !e
|
|
4398
|
-
}),
|
|
4409
|
+
}), Ur = (e, t, n) => !t && !n ? Array.isArray(e) ? e[0] || "" : e : Array.isArray(e) ? e.join(",") : e, Wr = (e, t, n = !1) => {
|
|
4399
4410
|
if (!e || !t) return;
|
|
4400
4411
|
let r = t.parentElement?.getBoundingClientRect() || t.getBoundingClientRect(), i = n ? r.height + 30 : r.height, a = e.getBoundingClientRect().height, o = n ? "calc(100% - 30px)" : "100%";
|
|
4401
4412
|
r && typeof window < "u" && r.top + a > window.innerHeight && r.top - a > 0 && (o = `calc(100% - ${i}px - ${a}px)`), e.style.top = o;
|
|
4402
|
-
},
|
|
4413
|
+
}, Gr = (e, t, n, r, i, a) => {
|
|
4403
4414
|
let { key: o } = e;
|
|
4404
4415
|
o === "," && (e.preventDefault(), a ? a(e) : i && i()), (o === "Space" || o === " ") && (e.preventDefault(), t(e)), o === "Enter" && (e.preventDefault(), n ? n() : r ? r() : i && i());
|
|
4405
|
-
},
|
|
4416
|
+
}, Kr = ({ open: e, multiple: t = !1, range: n = !1, weeknumbers: r = !1, withcontrols: i = !1, selected: a = [], earliest: o, latest: s, excludedates: l, excludeweekdays: u, maxMultiple: d, currentmonth: f, today: m, inputRef: h, hasCounter: g = !1, onDateSelected: v, onClose: y }) => {
|
|
4406
4417
|
let b = p(null), x = p(!1);
|
|
4407
4418
|
e && (x.current = !0), c(() => {
|
|
4408
|
-
e &&
|
|
4419
|
+
e && Wr(b.current, h?.current ?? null, g);
|
|
4409
4420
|
}, [
|
|
4410
4421
|
e,
|
|
4411
4422
|
h,
|
|
@@ -4434,14 +4445,14 @@ var Ir = () => {
|
|
|
4434
4445
|
onClose: y
|
|
4435
4446
|
})
|
|
4436
4447
|
});
|
|
4437
|
-
},
|
|
4448
|
+
}, qr = ({ dates: e, dateformat: t, idBase: n, strings: r, onDateRemoved: i }) => {
|
|
4438
4449
|
let a = un(e), o = ve(["datepicker"], r).datepicker.deleteDate;
|
|
4439
4450
|
return /* @__PURE__ */ _("div", {
|
|
4440
4451
|
className: "pkt-date-tags pkt-datepicker__tags",
|
|
4441
4452
|
"aria-live": "polite",
|
|
4442
4453
|
children: a.map((e) => {
|
|
4443
4454
|
let r = Zt(e, t);
|
|
4444
|
-
return /* @__PURE__ */ _(
|
|
4455
|
+
return /* @__PURE__ */ _(Gn, {
|
|
4445
4456
|
id: `${n}${e}-tag`,
|
|
4446
4457
|
closeTag: !0,
|
|
4447
4458
|
ariaLabel: `${o} ${r}`,
|
|
@@ -4453,7 +4464,7 @@ var Ir = () => {
|
|
|
4453
4464
|
}, e);
|
|
4454
4465
|
})
|
|
4455
4466
|
});
|
|
4456
|
-
},
|
|
4467
|
+
}, Jr = ({ state: e }) => {
|
|
4457
4468
|
let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: h, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange: P, handleRangeFromChange: ee, handleRangeToChange: te, handleRangeBlur: ne, handleMultipleBlur: F, handleTagRemoved: re, handleSingleKeydown: ie, handleRangeFromKeydown: ae, handleRangeToKeydown: oe, handleMultipleKeydown: se, restProps: I } = e, R = (e) => {
|
|
4458
4469
|
e.preventDefault(), M();
|
|
4459
4470
|
}, ce = (e) => {
|
|
@@ -4469,7 +4480,7 @@ var Ir = () => {
|
|
|
4469
4480
|
children: C.datepicker.openPicker
|
|
4470
4481
|
})]
|
|
4471
4482
|
});
|
|
4472
|
-
return a ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
4483
|
+
return a ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(qr, {
|
|
4473
4484
|
dates: r,
|
|
4474
4485
|
dateformat: i,
|
|
4475
4486
|
idBase: t,
|
|
@@ -4595,7 +4606,7 @@ var Ir = () => {
|
|
|
4595
4606
|
}), z()]
|
|
4596
4607
|
})
|
|
4597
4608
|
});
|
|
4598
|
-
},
|
|
4609
|
+
}, Yr = (e) => {
|
|
4599
4610
|
if (!e) return [];
|
|
4600
4611
|
if (Array.isArray(e)) return e.filter(Boolean);
|
|
4601
4612
|
if (typeof e == "string" && e.trimStart().startsWith("[")) try {
|
|
@@ -4606,8 +4617,8 @@ var Ir = () => {
|
|
|
4606
4617
|
};
|
|
4607
4618
|
//#endregion
|
|
4608
4619
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4609
|
-
function
|
|
4610
|
-
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: P, optionalTag: ee = !1, optionalText: te, requiredTag: ne = !1, requiredText: F, tagText: re, useWrapper: ie = !0, strings: ae, disabled: oe = !1, readOnly: se = !1, required: I = !1, name: L, min: R, max: ce, placeholder: z, onChange: B, onValueChange: le, className: ue, ...de } = e, V = o((e) => e === void 0 ? [] :
|
|
4620
|
+
function Xr(e, t) {
|
|
4621
|
+
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: P, optionalTag: ee = !1, optionalText: te, requiredTag: ne = !1, requiredText: F, tagText: re, useWrapper: ie = !0, strings: ae, disabled: oe = !1, readOnly: se = !1, required: I = !1, name: L, min: R, max: ce, placeholder: z, onChange: B, onValueChange: le, className: ue, ...de } = e, V = o((e) => e === void 0 ? [] : Yr(e), []), H = i !== void 0, U = typeof a == "number" ? void 0 : a, [W, G] = m(() => V(i ?? U)), K = H ? V(i) : W, fe = p(W);
|
|
4611
4622
|
c(() => {
|
|
4612
4623
|
H && G(V(i));
|
|
4613
4624
|
}, [
|
|
@@ -4619,12 +4630,12 @@ function Yr(e, t) {
|
|
|
4619
4630
|
c(() => {
|
|
4620
4631
|
C !== void 0 && pe(C);
|
|
4621
4632
|
}, [C]);
|
|
4622
|
-
let me = p(null), he = p(null), J = p(null), ge = p(null), Y = p(null), _e = f(() =>
|
|
4633
|
+
let me = p(null), he = p(null), J = p(null), ge = p(null), Y = p(null), _e = f(() => Rr(), []), X = f(() => Lr(), []), ye = ve([
|
|
4623
4634
|
"generic",
|
|
4624
4635
|
"datepicker",
|
|
4625
4636
|
"validation"
|
|
4626
4637
|
], ae), be = ae, Z = typeof R == "string" ? R : R === void 0 ? void 0 : String(R), Q = typeof ce == "string" ? ce : ce === void 0 ? void 0 : String(ce), xe = f(() => {
|
|
4627
|
-
let e =
|
|
4638
|
+
let e = Br(T, g, l, h, se, _e, E);
|
|
4628
4639
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4629
4640
|
}, [
|
|
4630
4641
|
T,
|
|
@@ -4634,8 +4645,8 @@ function Yr(e, t) {
|
|
|
4634
4645
|
se,
|
|
4635
4646
|
_e,
|
|
4636
4647
|
E
|
|
4637
|
-
]), Se = Object.entries(
|
|
4638
|
-
let e =
|
|
4648
|
+
]), Se = Object.entries(Vr(E)).filter(([, e]) => e).map(([e]) => e).join(" "), Ce = f(() => {
|
|
4649
|
+
let e = Hr(g);
|
|
4639
4650
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4640
4651
|
}, [g]), we = f(() => ["pkt-datepicker__inputs", h && "pkt-input__range-inputs"].filter(Boolean).join(" "), [h, g]), Te = f(() => {
|
|
4641
4652
|
if (x) return x;
|
|
@@ -4672,7 +4683,7 @@ function Yr(e, t) {
|
|
|
4672
4683
|
let Pe = o(() => {
|
|
4673
4684
|
X && !q && pe(!0);
|
|
4674
4685
|
}, [X, q]), Fe = o((e) => {
|
|
4675
|
-
let t =
|
|
4686
|
+
let t = Yr(Ur(e, l, h));
|
|
4676
4687
|
Ae(t), Me(t), !l && !h && (Ne(), me.current?.focus());
|
|
4677
4688
|
}, [
|
|
4678
4689
|
l,
|
|
@@ -4700,7 +4711,7 @@ function Yr(e, t) {
|
|
|
4700
4711
|
Ae,
|
|
4701
4712
|
Me
|
|
4702
4713
|
]), Be = o(() => {
|
|
4703
|
-
K.length === 2 && !
|
|
4714
|
+
K.length === 2 && !zr(K) && (Ae([K[0]]), Me([K[0]]));
|
|
4704
4715
|
}, [
|
|
4705
4716
|
K,
|
|
4706
4717
|
Ae,
|
|
@@ -4736,13 +4747,13 @@ function Yr(e, t) {
|
|
|
4736
4747
|
let t = e?.closest("form");
|
|
4737
4748
|
t ? t.requestSubmit() : e?.blur();
|
|
4738
4749
|
}, []), Ke = o((e) => {
|
|
4739
|
-
|
|
4750
|
+
Gr(e.nativeEvent, () => $(), () => Ge(me.current), void 0, () => me.current?.blur());
|
|
4740
4751
|
}, [$, Ge]), qe = o((e) => {
|
|
4741
|
-
|
|
4752
|
+
Gr(e.nativeEvent, () => $(), () => Ge(me.current), () => he.current?.focus(), () => me.current?.blur());
|
|
4742
4753
|
}, [$, Ge]), Je = o((e) => {
|
|
4743
|
-
|
|
4754
|
+
Gr(e.nativeEvent, () => $(), () => Ge(he.current), void 0, () => he.current?.blur());
|
|
4744
4755
|
}, [$, Ge]), Ye = o((e) => {
|
|
4745
|
-
|
|
4756
|
+
Gr(e.nativeEvent, () => $(), () => Ge(me.current), void 0, () => me.current?.blur(), Ue);
|
|
4746
4757
|
}, [
|
|
4747
4758
|
$,
|
|
4748
4759
|
Ge,
|
|
@@ -4847,8 +4858,8 @@ function Yr(e, t) {
|
|
|
4847
4858
|
}
|
|
4848
4859
|
//#endregion
|
|
4849
4860
|
//#region src/components/datepicker/Datepicker.tsx
|
|
4850
|
-
var
|
|
4851
|
-
let n =
|
|
4861
|
+
var Zr = i((e, t) => {
|
|
4862
|
+
let n = Xr(e, t), r = [
|
|
4852
4863
|
"pkt-datepicker",
|
|
4853
4864
|
`pkt-datepicker--${n.inputSize}`,
|
|
4854
4865
|
n.fullwidth ? "pkt-datepicker--fullwidth" : "",
|
|
@@ -4858,7 +4869,7 @@ var Xr = i((e, t) => {
|
|
|
4858
4869
|
className: r,
|
|
4859
4870
|
id: n.id || void 0,
|
|
4860
4871
|
children: [
|
|
4861
|
-
/* @__PURE__ */ _(
|
|
4872
|
+
/* @__PURE__ */ _(ir, {
|
|
4862
4873
|
strings: n.stringsOverride,
|
|
4863
4874
|
ref: n.wrapperRef,
|
|
4864
4875
|
ariaDescribedby: e.ariaDescribedby,
|
|
@@ -4882,9 +4893,9 @@ var Xr = i((e, t) => {
|
|
|
4882
4893
|
counter: n.hasCounter,
|
|
4883
4894
|
counterCurrent: n.values.length,
|
|
4884
4895
|
counterMaxLength: n.maxlength,
|
|
4885
|
-
children: /* @__PURE__ */ _(
|
|
4896
|
+
children: /* @__PURE__ */ _(Jr, { state: n })
|
|
4886
4897
|
}),
|
|
4887
|
-
/* @__PURE__ */ _(
|
|
4898
|
+
/* @__PURE__ */ _(Kr, {
|
|
4888
4899
|
open: n.calendarOpen,
|
|
4889
4900
|
multiple: n.multiple,
|
|
4890
4901
|
range: n.range,
|
|
@@ -4915,10 +4926,10 @@ var Xr = i((e, t) => {
|
|
|
4915
4926
|
]
|
|
4916
4927
|
});
|
|
4917
4928
|
});
|
|
4918
|
-
|
|
4929
|
+
Zr.displayName = "PktDatepicker";
|
|
4919
4930
|
//#endregion
|
|
4920
4931
|
//#region ../../shared-utils/fileupload/size.ts
|
|
4921
|
-
function
|
|
4932
|
+
function Qr(e) {
|
|
4922
4933
|
if (e == null || e === "") return;
|
|
4923
4934
|
if (typeof e == "number") return Number.isFinite(e) && e > 0 ? e : void 0;
|
|
4924
4935
|
let t = String(e).trim(), n = Number(t);
|
|
@@ -4937,15 +4948,15 @@ function Zr(e) {
|
|
|
4937
4948
|
default: return;
|
|
4938
4949
|
}
|
|
4939
4950
|
}
|
|
4940
|
-
function
|
|
4951
|
+
function $r(e) {
|
|
4941
4952
|
return e < 1024 ? `${Math.round(e)} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : e < 1073741824 ? `${Math.round(e / 1048576)} MB` : `${Math.round(e / 1073741824)} GB`;
|
|
4942
4953
|
}
|
|
4943
4954
|
//#endregion
|
|
4944
4955
|
//#region ../../shared-utils/fileupload/formats.ts
|
|
4945
|
-
function
|
|
4956
|
+
function ei(e) {
|
|
4946
4957
|
return Array.isArray(e) ? e.map((e) => String(e).trim().toLowerCase()).filter(Boolean) : [];
|
|
4947
4958
|
}
|
|
4948
|
-
function
|
|
4959
|
+
function ti(e, t, n) {
|
|
4949
4960
|
let r = e.toLowerCase().replace(/^\./, "");
|
|
4950
4961
|
if (r.includes("/")) {
|
|
4951
4962
|
if (r.endsWith("/*")) {
|
|
@@ -4956,33 +4967,33 @@ function ei(e, t, n) {
|
|
|
4956
4967
|
}
|
|
4957
4968
|
return t === r;
|
|
4958
4969
|
}
|
|
4959
|
-
function
|
|
4960
|
-
let n =
|
|
4970
|
+
function ni(e, t) {
|
|
4971
|
+
let n = ei(t);
|
|
4961
4972
|
if (n.length === 0) return !0;
|
|
4962
4973
|
let r = e.name.split(".").pop()?.toLowerCase() ?? "", i = e.type.toLowerCase();
|
|
4963
|
-
return n.some((e) =>
|
|
4974
|
+
return n.some((e) => ti(e, r, i));
|
|
4964
4975
|
}
|
|
4965
|
-
function
|
|
4976
|
+
function ri(e, t) {
|
|
4966
4977
|
let n = (e ?? "").trim();
|
|
4967
4978
|
if (n) return n;
|
|
4968
|
-
let r =
|
|
4979
|
+
let r = ei(t);
|
|
4969
4980
|
return r.length === 0 ? "" : r.map((e) => e.includes("/") || e.startsWith(".") ? e : `.${e}`).join(", ");
|
|
4970
4981
|
}
|
|
4971
4982
|
//#endregion
|
|
4972
4983
|
//#region ../../shared-utils/fileupload/validation.ts
|
|
4973
|
-
function
|
|
4984
|
+
function ii(e, t, n) {
|
|
4974
4985
|
return ((e ?? "").trim() || t).replace(/\{(\w+)\}/g, (e, t) => n[t] ?? `{${t}}`);
|
|
4975
4986
|
}
|
|
4976
|
-
function
|
|
4977
|
-
let n =
|
|
4978
|
-
if (n.length > 0 && !
|
|
4987
|
+
function ai(e, t) {
|
|
4988
|
+
let n = ei(t.allowedFormats);
|
|
4989
|
+
if (n.length > 0 && !ni(e, n)) {
|
|
4979
4990
|
let e = n.join(", "), r = ce.fileupload.invalidFormat;
|
|
4980
|
-
return
|
|
4991
|
+
return ii(t.formatErrorMessage, r, { formats: e });
|
|
4981
4992
|
}
|
|
4982
|
-
let r =
|
|
4993
|
+
let r = Qr(t.maxFileSize);
|
|
4983
4994
|
if (r !== void 0 && e.size > r) {
|
|
4984
|
-
let e =
|
|
4985
|
-
return
|
|
4995
|
+
let e = $r(r), n = ce.fileupload.sizeTooLarge;
|
|
4996
|
+
return ii(t.sizeErrorMessage, n, { maxSize: e });
|
|
4986
4997
|
}
|
|
4987
4998
|
if (t.onFileValidation) {
|
|
4988
4999
|
let n = t.onFileValidation(e);
|
|
@@ -4990,7 +5001,7 @@ function ii(e, t) {
|
|
|
4990
5001
|
}
|
|
4991
5002
|
return null;
|
|
4992
5003
|
}
|
|
4993
|
-
function
|
|
5004
|
+
function oi(e) {
|
|
4994
5005
|
let t = e.file;
|
|
4995
5006
|
if (t?.type?.startsWith("image/")) return !0;
|
|
4996
5007
|
let n = e.attributes?.targetFilename || t?.name || "";
|
|
@@ -4998,10 +5009,10 @@ function ai(e) {
|
|
|
4998
5009
|
}
|
|
4999
5010
|
//#endregion
|
|
5000
5011
|
//#region ../../shared-utils/fileupload/transfers.ts
|
|
5001
|
-
function
|
|
5012
|
+
function si(e) {
|
|
5002
5013
|
return typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle";
|
|
5003
5014
|
}
|
|
5004
|
-
function
|
|
5015
|
+
function ci(e, t, n) {
|
|
5005
5016
|
let r = {
|
|
5006
5017
|
"in-progress": 0,
|
|
5007
5018
|
error: 1,
|
|
@@ -5016,11 +5027,11 @@ function si(e, t, n) {
|
|
|
5016
5027
|
showProgress: r?.showProgress,
|
|
5017
5028
|
lastProgress: r?.lastProgress
|
|
5018
5029
|
};
|
|
5019
|
-
}).sort((e, t) => r[
|
|
5030
|
+
}).sort((e, t) => r[si(e.progress)] - r[si(t.progress)]);
|
|
5020
5031
|
}
|
|
5021
5032
|
//#endregion
|
|
5022
5033
|
//#region ../../shared-utils/focus-trap/index.ts
|
|
5023
|
-
function
|
|
5034
|
+
function li(e) {
|
|
5024
5035
|
if (!e) return [];
|
|
5025
5036
|
let t = [
|
|
5026
5037
|
"a[href]:not([tabindex=\"-1\"])",
|
|
@@ -5032,7 +5043,7 @@ function ci(e) {
|
|
|
5032
5043
|
].join(", ");
|
|
5033
5044
|
return Array.from(e.querySelectorAll(t)).filter((e) => !e.hasAttribute("inert"));
|
|
5034
5045
|
}
|
|
5035
|
-
var
|
|
5046
|
+
var ui = [
|
|
5036
5047
|
"a[href]",
|
|
5037
5048
|
"button:not([disabled])",
|
|
5038
5049
|
"input:not([disabled]):not([type=\"hidden\"])",
|
|
@@ -5040,7 +5051,7 @@ var li = [
|
|
|
5040
5051
|
"textarea:not([disabled])",
|
|
5041
5052
|
"summary",
|
|
5042
5053
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
5043
|
-
].join(", "),
|
|
5054
|
+
].join(", "), di = (e) => {
|
|
5044
5055
|
if (e.hasAttribute("inert") || e.closest("[inert]") || e.hidden || e.closest("[hidden]")) return !0;
|
|
5045
5056
|
let t = e;
|
|
5046
5057
|
for (; t;) {
|
|
@@ -5053,33 +5064,33 @@ var li = [
|
|
|
5053
5064
|
t = n.parentElement;
|
|
5054
5065
|
}
|
|
5055
5066
|
return !1;
|
|
5056
|
-
},
|
|
5057
|
-
e.matches(
|
|
5067
|
+
}, fi = (e, t) => {
|
|
5068
|
+
e.matches(ui) && !di(e) && t.push(e);
|
|
5058
5069
|
let n = e.shadowRoot;
|
|
5059
|
-
if (n) for (let e of Array.from(n.children))
|
|
5060
|
-
for (let n of Array.from(e.children))
|
|
5070
|
+
if (n) for (let e of Array.from(n.children)) fi(e, t);
|
|
5071
|
+
for (let n of Array.from(e.children)) fi(n, t);
|
|
5061
5072
|
};
|
|
5062
|
-
function
|
|
5073
|
+
function pi(e) {
|
|
5063
5074
|
if (!e) return [];
|
|
5064
5075
|
let t = [];
|
|
5065
|
-
for (let n of Array.from(e.children))
|
|
5076
|
+
for (let n of Array.from(e.children)) fi(n, t);
|
|
5066
5077
|
return t;
|
|
5067
5078
|
}
|
|
5068
|
-
function
|
|
5079
|
+
function mi(e = document) {
|
|
5069
5080
|
let t = e.activeElement;
|
|
5070
5081
|
for (; t?.shadowRoot?.activeElement;) t = t.shadowRoot.activeElement;
|
|
5071
5082
|
return t;
|
|
5072
5083
|
}
|
|
5073
|
-
function
|
|
5084
|
+
function hi(e, t) {
|
|
5074
5085
|
if (e.key !== "Tab") return !1;
|
|
5075
|
-
let n =
|
|
5086
|
+
let n = li(t);
|
|
5076
5087
|
if (n.length === 0) return e.preventDefault(), !0;
|
|
5077
5088
|
let r = n[0], i = n[n.length - 1], a = (t?.ownerDocument ?? document).activeElement, o = !!a && n.includes(a);
|
|
5078
5089
|
return e.shiftKey ? !o || a === r ? (e.preventDefault(), i.focus(), !0) : !1 : !o || a === i ? (e.preventDefault(), r.focus(), !0) : !1;
|
|
5079
5090
|
}
|
|
5080
5091
|
//#endregion
|
|
5081
5092
|
//#region ../../shared-utils/fileupload/truncate.ts
|
|
5082
|
-
function
|
|
5093
|
+
function gi(e, t) {
|
|
5083
5094
|
return !t || t <= 0 || e.length <= t + 3 ? null : {
|
|
5084
5095
|
head: e.slice(0, e.length - t),
|
|
5085
5096
|
tail: e.slice(-t)
|
|
@@ -5087,12 +5098,12 @@ function hi(e, t) {
|
|
|
5087
5098
|
}
|
|
5088
5099
|
//#endregion
|
|
5089
5100
|
//#region ../../shared-utils/fileupload/navigation.ts
|
|
5090
|
-
function
|
|
5101
|
+
function _i(e, t, n) {
|
|
5091
5102
|
return n <= 0 ? 0 : t === "prev" ? e <= 0 ? n - 1 : e - 1 : e >= n - 1 ? 0 : e + 1;
|
|
5092
5103
|
}
|
|
5093
5104
|
//#endregion
|
|
5094
5105
|
//#region ../../shared-utils/fileupload/announcements.ts
|
|
5095
|
-
function
|
|
5106
|
+
function vi(e, t) {
|
|
5096
5107
|
let n = e.length;
|
|
5097
5108
|
if (n === 0 || !t || t.length === 0) return {
|
|
5098
5109
|
totalCount: n,
|
|
@@ -5112,23 +5123,23 @@ function _i(e, t) {
|
|
|
5112
5123
|
}
|
|
5113
5124
|
//#endregion
|
|
5114
5125
|
//#region ../../shared-utils/fileupload/filename.ts
|
|
5115
|
-
var
|
|
5116
|
-
function
|
|
5126
|
+
var yi = ".jpeg, .jpg, .png, .gif, .webp, .heic";
|
|
5127
|
+
function bi(e, t = ce.fileupload.unknownFilename) {
|
|
5117
5128
|
return e.attributes?.targetFilename || e.file?.name || t;
|
|
5118
5129
|
}
|
|
5119
5130
|
//#endregion
|
|
5120
5131
|
//#region src/utils/stringutils.ts
|
|
5121
|
-
var
|
|
5122
|
-
let e =
|
|
5132
|
+
var xi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toString(16)).slice(-16), Si = () => {
|
|
5133
|
+
let e = xi(), t = xi();
|
|
5123
5134
|
return e.slice(0, 8) + "-" + e.slice(8, 12) + "-4" + e.slice(13) + "-a" + t.slice(1, 4) + "-" + t.slice(4);
|
|
5124
|
-
},
|
|
5135
|
+
}, Ci = class {
|
|
5125
5136
|
fileId;
|
|
5126
5137
|
file;
|
|
5127
5138
|
attributes;
|
|
5128
5139
|
constructor(e, t) {
|
|
5129
|
-
this.fileId = t ||
|
|
5140
|
+
this.fileId = t || Si(), this.file = e, this.attributes = { targetFilename: e.name };
|
|
5130
5141
|
}
|
|
5131
|
-
},
|
|
5142
|
+
}, wi = n({}), Ti = i(({ id: e, multiple: t, value: n, onFilesAdded: r = () => {}, name: i, uploadStrategy: a, accept: s, isThumbnailView: l = !1, disabled: d = !1, hasVisibleLabel: h = !1, strings: y, ...b }, x) => {
|
|
5132
5143
|
let S = p(null), C = typeof s == "string" && s.trim().length > 0 ? s : void 0, w = f(() => C ? C.split(/\s*,\s*/).map((e) => e.trim()).filter(Boolean).join(", ").toUpperCase() : "", [C]);
|
|
5133
5144
|
u(x, () => S.current);
|
|
5134
5145
|
let [T, E] = m(!1), D = ve(["fileupload"], y), O = f(() => l ? t ? {
|
|
@@ -5153,14 +5164,14 @@ var bi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5153
5164
|
D
|
|
5154
5165
|
]), k = o((e) => {
|
|
5155
5166
|
if (S.current) try {
|
|
5156
|
-
S.current.files =
|
|
5167
|
+
S.current.files = Ei(e);
|
|
5157
5168
|
} catch {}
|
|
5158
5169
|
}, [S.current, n]);
|
|
5159
5170
|
c(() => {
|
|
5160
5171
|
k(n);
|
|
5161
5172
|
}, [S, n]);
|
|
5162
5173
|
let A = o((e) => {
|
|
5163
|
-
r(e.map((e) => new
|
|
5174
|
+
r(e.map((e) => new Ci(e))), S.current && (S.current.value = "");
|
|
5164
5175
|
}, [r]), j = (e) => {
|
|
5165
5176
|
let t = e.target.files;
|
|
5166
5177
|
if (t.length === 0) {
|
|
@@ -5244,23 +5255,23 @@ var bi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5244
5255
|
})
|
|
5245
5256
|
]
|
|
5246
5257
|
});
|
|
5247
|
-
}),
|
|
5258
|
+
}), Ei = (e) => {
|
|
5248
5259
|
let t = new DataTransfer();
|
|
5249
5260
|
for (let n of e) t.items.add(n.file);
|
|
5250
5261
|
return t.files;
|
|
5251
|
-
},
|
|
5262
|
+
}, Di = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, counter: r, hasFieldset: i, counterMaxLength: a, className: o, disabled: s, errorMessage: l, hasError: u = !1, helptext: d, helptextDropdown: f, helptextDropdownButton: p, inline: h, fullwidth: g = !1, label: v, name: y, optionalTag: b = !1, optionalText: x, requiredTag: S = !1, requiredText: C, tagText: w = null, placeholder: T, rows: E, useWrapper: D = !0, onChange: O, value: k, autoComplete: A = "off", minLength: j, maxLength: M, readOnly: N, skipForwardTestid: P = !1, inputSize: ee = "medium", strings: te, ...ne }, F) => {
|
|
5252
5263
|
let re = r ?? (a ?? 0) > 0, ie = [
|
|
5253
5264
|
o,
|
|
5254
5265
|
"pkt-textinput",
|
|
5255
5266
|
"pkt-textarea"
|
|
5256
|
-
].filter(Boolean).join(" "), ae =
|
|
5267
|
+
].filter(Boolean).join(" "), ae = Yn(e), oe = `${ae}-input`, se = `${oe}-label`, I = n || se, [L, R] = m(0), ce = (e) => {
|
|
5257
5268
|
re && R(e.currentTarget?.value?.length || 0), O && O(e);
|
|
5258
5269
|
};
|
|
5259
5270
|
return c(() => {
|
|
5260
5271
|
k !== void 0 && R(k?.length || 0);
|
|
5261
5272
|
}, [k]), /* @__PURE__ */ _("div", {
|
|
5262
5273
|
className: ie,
|
|
5263
|
-
children: /* @__PURE__ */ _(
|
|
5274
|
+
children: /* @__PURE__ */ _(ir, {
|
|
5264
5275
|
strings: te,
|
|
5265
5276
|
ariaDescribedby: t,
|
|
5266
5277
|
disabled: s,
|
|
@@ -5296,7 +5307,7 @@ var bi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5296
5307
|
"aria-labelledby": I,
|
|
5297
5308
|
"aria-invalid": u,
|
|
5298
5309
|
"aria-errormessage": u ? `${ae}-error` : void 0,
|
|
5299
|
-
"aria-describedby":
|
|
5310
|
+
"aria-describedby": Qn({
|
|
5300
5311
|
id: oe,
|
|
5301
5312
|
hasHelptext: !!d,
|
|
5302
5313
|
hasCounter: re,
|
|
@@ -5314,19 +5325,19 @@ var bi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5314
5325
|
})
|
|
5315
5326
|
});
|
|
5316
5327
|
});
|
|
5317
|
-
|
|
5328
|
+
Di.displayName = "PktTextarea";
|
|
5318
5329
|
//#endregion
|
|
5319
5330
|
//#region src/components/fileupload/extensions/Comments.tsx
|
|
5320
|
-
var
|
|
5331
|
+
var Oi = "comments", ki = (e) => {
|
|
5321
5332
|
let t = new Date(e);
|
|
5322
5333
|
return Number.isNaN(t.getTime()) ? e : `${String(t.getDate()).padStart(2, "0")}.${String(t.getMonth() + 1).padStart(2, "0")}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
5323
|
-
},
|
|
5334
|
+
}, Ai = ({ fileItem: e, disabled: t, closeOperationUi: n, onAddComment: r, existingComment: i }) => {
|
|
5324
5335
|
let a = p(null), o = !!i;
|
|
5325
5336
|
return d(() => {
|
|
5326
5337
|
let e = setTimeout(() => a.current?.focus({ preventScroll: !0 }), 0);
|
|
5327
5338
|
return () => clearTimeout(e);
|
|
5328
5339
|
}, [e.fileId]), /* @__PURE__ */ v(g, { children: [
|
|
5329
|
-
/* @__PURE__ */ _(
|
|
5340
|
+
/* @__PURE__ */ _(Di, {
|
|
5330
5341
|
autoFocus: !0,
|
|
5331
5342
|
label: o ? "Rediger kommentar" : "Legg til kommentar",
|
|
5332
5343
|
name: `comment-${e.fileId}`,
|
|
@@ -5359,7 +5370,7 @@ var Di = "comments", Oi = (e) => {
|
|
|
5359
5370
|
children: "Avbryt"
|
|
5360
5371
|
})
|
|
5361
5372
|
] });
|
|
5362
|
-
},
|
|
5373
|
+
}, ji = ({ comment: e, disabled: t, onDeleteComment: n, onEditComment: r }) => /* @__PURE__ */ _("div", {
|
|
5363
5374
|
className: "pkt-fileupload__queue-display__item__comments",
|
|
5364
5375
|
children: /* @__PURE__ */ v("div", {
|
|
5365
5376
|
className: "pkt-fileupload__queue-display__item__comment",
|
|
@@ -5371,7 +5382,7 @@ var Di = "comments", Oi = (e) => {
|
|
|
5371
5382
|
children: e.text
|
|
5372
5383
|
}), /* @__PURE__ */ _("time", {
|
|
5373
5384
|
className: "pkt-fileupload__queue-display__item__comment__time",
|
|
5374
|
-
children:
|
|
5385
|
+
children: ki(e.timestamp)
|
|
5375
5386
|
})]
|
|
5376
5387
|
}), /* @__PURE__ */ v("div", {
|
|
5377
5388
|
className: "pkt-fileupload__queue-display__item__comment__actions",
|
|
@@ -5392,46 +5403,46 @@ var Di = "comments", Oi = (e) => {
|
|
|
5392
5403
|
})]
|
|
5393
5404
|
})]
|
|
5394
5405
|
})
|
|
5395
|
-
}),
|
|
5396
|
-
let t = s(
|
|
5406
|
+
}), Mi = ({ comments: e }) => {
|
|
5407
|
+
let t = s(wi);
|
|
5397
5408
|
return /* @__PURE__ */ _("input", {
|
|
5398
5409
|
type: "hidden",
|
|
5399
5410
|
name: `${t.name}-comments`,
|
|
5400
5411
|
value: e ? JSON.stringify(e) : ""
|
|
5401
5412
|
});
|
|
5402
|
-
},
|
|
5413
|
+
}, Ni = (e) => e.getAttribute(Oi) ?? [], Pi = {
|
|
5403
5414
|
id: "comment",
|
|
5404
|
-
title: (e) => (e.attributes?.[
|
|
5415
|
+
title: (e) => (e.attributes?.[Oi] ?? []).length > 0 ? "" : "Legg til kommentar",
|
|
5405
5416
|
ariaLabel: "Legg til kommentar",
|
|
5406
5417
|
renderExtendedUI: (e) => {
|
|
5407
|
-
let t =
|
|
5408
|
-
return /* @__PURE__ */ _(
|
|
5418
|
+
let t = Ni(e)[0];
|
|
5419
|
+
return /* @__PURE__ */ _(Ai, {
|
|
5409
5420
|
fileItem: e.file,
|
|
5410
5421
|
disabled: e.disabled,
|
|
5411
5422
|
closeOperationUi: e.close,
|
|
5412
5423
|
onAddComment: (t) => {
|
|
5413
|
-
e.setAttribute(
|
|
5424
|
+
e.setAttribute(Oi, [t]);
|
|
5414
5425
|
},
|
|
5415
5426
|
existingComment: t
|
|
5416
5427
|
});
|
|
5417
5428
|
},
|
|
5418
5429
|
renderContent: (e) => {
|
|
5419
5430
|
if (e.isActive) return null;
|
|
5420
|
-
let t =
|
|
5421
|
-
return t ? /* @__PURE__ */ _(
|
|
5431
|
+
let t = Ni(e)[0];
|
|
5432
|
+
return t ? /* @__PURE__ */ _(ji, {
|
|
5422
5433
|
comment: t,
|
|
5423
5434
|
disabled: e.disabled,
|
|
5424
5435
|
onEditComment: e.activate,
|
|
5425
|
-
onDeleteComment: () => e.setAttribute(
|
|
5436
|
+
onDeleteComment: () => e.setAttribute(Oi, void 0)
|
|
5426
5437
|
}) : null;
|
|
5427
5438
|
},
|
|
5428
|
-
renderHidden: (e) => /* @__PURE__ */ _(
|
|
5429
|
-
},
|
|
5439
|
+
renderHidden: (e) => /* @__PURE__ */ _(Mi, { comments: e.getAttribute(Oi) }, `comments${e.file.fileId}`)
|
|
5440
|
+
}, Fi = (e) => ({
|
|
5430
5441
|
id: "remove",
|
|
5431
5442
|
title: "Slett",
|
|
5432
5443
|
ariaLabel: "Slett fil",
|
|
5433
5444
|
onClick: ({ file: t }) => e(t.fileId)
|
|
5434
|
-
}),
|
|
5445
|
+
}), Ii = ({ initialValue: e, disabled: t, onSave: n, onCancel: r }) => {
|
|
5435
5446
|
let i = p(null), a = l(), o = () => n(i.current?.value ?? "");
|
|
5436
5447
|
return /* @__PURE__ */ v(g, { children: [
|
|
5437
5448
|
/* @__PURE__ */ _("label", {
|
|
@@ -5466,19 +5477,19 @@ var Di = "comments", Oi = (e) => {
|
|
|
5466
5477
|
children: "Avbryt"
|
|
5467
5478
|
})
|
|
5468
5479
|
] });
|
|
5469
|
-
},
|
|
5470
|
-
let t = s(
|
|
5480
|
+
}, Li = ({ targetFilename: e }) => {
|
|
5481
|
+
let t = s(wi);
|
|
5471
5482
|
return /* @__PURE__ */ _("input", {
|
|
5472
5483
|
type: "hidden",
|
|
5473
5484
|
name: `${t.name}-targetFilename`,
|
|
5474
5485
|
value: e
|
|
5475
5486
|
});
|
|
5476
|
-
},
|
|
5487
|
+
}, Ri = (e) => e.getAttribute("targetFilename") || bi(e.file, ""), zi = {
|
|
5477
5488
|
id: "rename",
|
|
5478
5489
|
title: "Rediger",
|
|
5479
5490
|
ariaLabel: "Rediger filnavn",
|
|
5480
|
-
renderInlineUI: (e) => /* @__PURE__ */ _(
|
|
5481
|
-
initialValue:
|
|
5491
|
+
renderInlineUI: (e) => /* @__PURE__ */ _(Ii, {
|
|
5492
|
+
initialValue: Ri(e),
|
|
5482
5493
|
disabled: e.disabled,
|
|
5483
5494
|
onSave: (t) => {
|
|
5484
5495
|
let n = t.trim();
|
|
@@ -5486,8 +5497,8 @@ var Di = "comments", Oi = (e) => {
|
|
|
5486
5497
|
},
|
|
5487
5498
|
onCancel: e.close
|
|
5488
5499
|
}),
|
|
5489
|
-
renderHidden: (e) => /* @__PURE__ */ _(
|
|
5490
|
-
},
|
|
5500
|
+
renderHidden: (e) => /* @__PURE__ */ _(Li, { targetFilename: Ri(e) }, `rename${e.file.fileId}`)
|
|
5501
|
+
}, Bi = (e, t) => {
|
|
5491
5502
|
let n = o((t, n) => e.find((e) => e.fileId === t)?.attributes?.[n], [e]), r = o((n, r, i) => {
|
|
5492
5503
|
let a = e.find((e) => e.fileId === n);
|
|
5493
5504
|
if (!a) return;
|
|
@@ -5507,7 +5518,7 @@ var Di = "comments", Oi = (e) => {
|
|
|
5507
5518
|
setAttribute: (t, n) => r(e, t, n)
|
|
5508
5519
|
}), [n, r])
|
|
5509
5520
|
};
|
|
5510
|
-
},
|
|
5521
|
+
}, Vi = (e) => {
|
|
5511
5522
|
let [t, n] = m(!1), [r, i] = m(0), a = p(null);
|
|
5512
5523
|
return {
|
|
5513
5524
|
isOpen: t,
|
|
@@ -5521,10 +5532,10 @@ var Di = "comments", Oi = (e) => {
|
|
|
5521
5532
|
n(!1), a.current?.close();
|
|
5522
5533
|
}, []),
|
|
5523
5534
|
navigate: o((t) => {
|
|
5524
|
-
e.length !== 0 && i((n) =>
|
|
5535
|
+
e.length !== 0 && i((n) => _i(n, t, e.length));
|
|
5525
5536
|
}, [e.length])
|
|
5526
5537
|
};
|
|
5527
|
-
},
|
|
5538
|
+
}, Hi = (e) => {
|
|
5528
5539
|
let [t, n] = m({});
|
|
5529
5540
|
return c(() => {
|
|
5530
5541
|
n((t) => {
|
|
@@ -5551,7 +5562,7 @@ var Di = "comments", Oi = (e) => {
|
|
|
5551
5562
|
});
|
|
5552
5563
|
}, [])
|
|
5553
5564
|
};
|
|
5554
|
-
},
|
|
5565
|
+
}, Ui = (e, { uploadStrategy: t, required: n, currentFileCount: r, onMissingFiles: i }) => {
|
|
5555
5566
|
c(() => {
|
|
5556
5567
|
if (t !== "custom" || !n) return;
|
|
5557
5568
|
let a = e.current?.form;
|
|
@@ -5569,8 +5580,8 @@ var Di = "comments", Oi = (e) => {
|
|
|
5569
5580
|
r,
|
|
5570
5581
|
i
|
|
5571
5582
|
]);
|
|
5572
|
-
},
|
|
5573
|
-
let C = f(() =>
|
|
5583
|
+
}, Wi = i(({ ariaLabel: e, ariaLabelledby: t, ariaLive: n = "polite", ariaValueText: r, id: i, role: a = "progressbar", skin: o = "dark-blue", statusPlacement: s = "following", statusType: l = "none", title: u, titlePosition: d = "left", valueCurrent: h = 0, valueMax: g = 100, valueMin: y = 0, className: b, ...x }, S) => {
|
|
5584
|
+
let C = f(() => Jn(), []), w = i || C, T = p(null), [E, D] = m(0);
|
|
5574
5585
|
c(() => {
|
|
5575
5586
|
T.current && D(T.current.getBoundingClientRect().width || 0);
|
|
5576
5587
|
}, [h]);
|
|
@@ -5621,41 +5632,41 @@ var Di = "comments", Oi = (e) => {
|
|
|
5621
5632
|
})
|
|
5622
5633
|
});
|
|
5623
5634
|
});
|
|
5624
|
-
|
|
5635
|
+
Wi.displayName = "PktProgressbar";
|
|
5625
5636
|
//#endregion
|
|
5626
5637
|
//#region ../../shared-utils/scroll-lock/index.ts
|
|
5627
|
-
var
|
|
5638
|
+
var Gi = "is-scroll-locked", Ki = 0, qi = 0, Ji = () => typeof document < "u" && typeof window < "u", Yi = () => {
|
|
5628
5639
|
let e = document.body, t = document.documentElement;
|
|
5629
|
-
|
|
5640
|
+
qi = window.scrollY || window.pageYOffset;
|
|
5630
5641
|
let n = window.innerWidth - t.clientWidth;
|
|
5631
|
-
n > 0 && (e.style.paddingRight = `${n}px`), e.style.position = "fixed", e.style.top = `-${
|
|
5632
|
-
}, Yi = () => {
|
|
5633
|
-
let e = document.body, t = document.documentElement;
|
|
5634
|
-
e.style.removeProperty("position"), e.style.removeProperty("top"), e.style.removeProperty("left"), e.style.removeProperty("right"), e.style.removeProperty("width"), e.style.removeProperty("overflow"), e.style.removeProperty("padding-right"), t.classList.remove(Wi), typeof window.scrollTo == "function" && window.scrollTo({ top: Ki });
|
|
5642
|
+
n > 0 && (e.style.paddingRight = `${n}px`), e.style.position = "fixed", e.style.top = `-${qi}px`, e.style.left = "0", e.style.right = "0", e.style.width = "100%", e.style.overflow = "hidden", t.classList.add(Gi);
|
|
5635
5643
|
}, Xi = () => {
|
|
5636
|
-
|
|
5644
|
+
let e = document.body, t = document.documentElement;
|
|
5645
|
+
e.style.removeProperty("position"), e.style.removeProperty("top"), e.style.removeProperty("left"), e.style.removeProperty("right"), e.style.removeProperty("width"), e.style.removeProperty("overflow"), e.style.removeProperty("padding-right"), t.classList.remove(Gi), typeof window.scrollTo == "function" && window.scrollTo({ top: qi });
|
|
5637
5646
|
}, Zi = () => {
|
|
5638
|
-
|
|
5639
|
-
}, Qi = () =>
|
|
5640
|
-
|
|
5641
|
-
},
|
|
5642
|
-
|
|
5647
|
+
Ji() && (Ki += 1, Ki === 1 && Yi());
|
|
5648
|
+
}, Qi = () => {
|
|
5649
|
+
!Ji() || Ki === 0 || (--Ki, Ki === 0 && Xi());
|
|
5650
|
+
}, $i = () => ({ locked: !1 }), ea = (e, t) => {
|
|
5651
|
+
e.locked !== t && (e.locked = t, t ? Zi() : Qi());
|
|
5652
|
+
}, ta = i(({ children: e, className: t, open: n = !1, headingText: r = "", hideCloseButton: i = !1, closeOnBackdropClick: a = !1, size: s = "medium", removePadding: l = !1, closeButtonSkin: u = "blue", variant: d = "dialog", drawerPosition: f = "right", transparentBackdrop: m = !1, onClose: h, ...g }, y) => {
|
|
5653
|
+
let b = p(null), x = p($i()), S = o((e) => {
|
|
5643
5654
|
b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
5644
5655
|
}, [y]), C = o(() => {
|
|
5645
|
-
b.current?.open && (b.current.close(),
|
|
5656
|
+
b.current?.open && (b.current.close(), ea(x.current, !1), h?.());
|
|
5646
5657
|
}, [h]);
|
|
5647
5658
|
c(() => {
|
|
5648
|
-
n ? (b.current?.open || b.current?.showModal(),
|
|
5659
|
+
n ? (b.current?.open || b.current?.showModal(), ea(x.current, !0)) : (b.current?.open && b.current.close(), ea(x.current, !1));
|
|
5649
5660
|
}, [n]), c(() => {
|
|
5650
5661
|
let e = x.current;
|
|
5651
5662
|
return () => {
|
|
5652
|
-
|
|
5663
|
+
ea(e, !1);
|
|
5653
5664
|
};
|
|
5654
5665
|
}, []);
|
|
5655
5666
|
let w = o((e) => {
|
|
5656
5667
|
a && e.target === b.current && C();
|
|
5657
5668
|
}, [a, C]), T = o(() => {
|
|
5658
|
-
|
|
5669
|
+
ea(x.current, !1), h?.();
|
|
5659
5670
|
}, [h]), E = u === "blue", D = (0, M.default)({
|
|
5660
5671
|
"pkt-modal": !0,
|
|
5661
5672
|
"pkt-modal--removePadding": l,
|
|
@@ -5709,11 +5720,11 @@ var Wi = "is-scroll-locked", Gi = 0, Ki = 0, qi = () => typeof document < "u" &&
|
|
|
5709
5720
|
})
|
|
5710
5721
|
});
|
|
5711
5722
|
});
|
|
5712
|
-
|
|
5723
|
+
ta.displayName = "PktModal";
|
|
5713
5724
|
//#endregion
|
|
5714
5725
|
//#region src/components/fileupload/Truncate.tsx
|
|
5715
|
-
var
|
|
5716
|
-
let n = s(
|
|
5726
|
+
var na = n({ tail: 5 }), ra = ({ children: e, tail: t }) => {
|
|
5727
|
+
let n = s(na), r = gi(e, t === void 0 ? n.tail : t);
|
|
5717
5728
|
return r ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
5718
5729
|
className: "pkt-fileupload__queue-display__item__title__head",
|
|
5719
5730
|
"data-pkt-truncate-part": "first",
|
|
@@ -5726,18 +5737,18 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5726
5737
|
"data-pkt-truncate-part": "first",
|
|
5727
5738
|
children: e
|
|
5728
5739
|
});
|
|
5729
|
-
},
|
|
5740
|
+
}, ia = (e) => /* @__PURE__ */ _("button", {
|
|
5730
5741
|
type: "button",
|
|
5731
5742
|
onClick: e.onClick,
|
|
5732
5743
|
disabled: e.disabled,
|
|
5733
5744
|
className: "pkt-fileupload__queue-display__item__cancel-button",
|
|
5734
5745
|
"aria-label": e.ariaLabel || "Avbryt opplasting",
|
|
5735
5746
|
children: e.label || "Avbryt"
|
|
5736
|
-
}),
|
|
5747
|
+
}), aa = () => /* @__PURE__ */ _("span", {
|
|
5737
5748
|
className: "pkt-fileupload__queue-display__item__loading-text",
|
|
5738
5749
|
"aria-label": "Laster opp fil",
|
|
5739
5750
|
children: "Laster opp"
|
|
5740
|
-
}),
|
|
5751
|
+
}), oa = ({ cancelTransfer: e, transferItem: t, disabled: n = !1 }) => {
|
|
5741
5752
|
let r = t.showProgress ?? t.progress !== 0;
|
|
5742
5753
|
return /* @__PURE__ */ v(g, { children: [
|
|
5743
5754
|
/* @__PURE__ */ _(L, {
|
|
@@ -5748,21 +5759,21 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5748
5759
|
/* @__PURE__ */ v("p", {
|
|
5749
5760
|
className: "pkt-fileupload__queue-display__item__title",
|
|
5750
5761
|
"aria-label": "Filnavn",
|
|
5751
|
-
children: [/* @__PURE__ */ _(
|
|
5762
|
+
children: [/* @__PURE__ */ _(ra, { children: bi(t) }), /* @__PURE__ */ v("span", {
|
|
5752
5763
|
className: "pkt-fileupload__queue-display__item__filesize",
|
|
5753
5764
|
children: [
|
|
5754
5765
|
" ",
|
|
5755
5766
|
"(",
|
|
5756
|
-
|
|
5767
|
+
$r(t.file.size),
|
|
5757
5768
|
")"
|
|
5758
5769
|
]
|
|
5759
5770
|
})]
|
|
5760
5771
|
}),
|
|
5761
|
-
/* @__PURE__ */ _(
|
|
5772
|
+
/* @__PURE__ */ _(ia, {
|
|
5762
5773
|
onClick: e,
|
|
5763
5774
|
disabled: n
|
|
5764
5775
|
}),
|
|
5765
|
-
r ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
5776
|
+
r ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(Wi, {
|
|
5766
5777
|
valueCurrent: t.progress * 100,
|
|
5767
5778
|
statusType: "none",
|
|
5768
5779
|
valueMax: 100,
|
|
@@ -5772,20 +5783,20 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5772
5783
|
className: "pkt-fileupload__queue-display__item__percentage",
|
|
5773
5784
|
"aria-hidden": "true",
|
|
5774
5785
|
children: `${Math.round(t.progress * 100)}%`
|
|
5775
|
-
})] }) : /* @__PURE__ */ _(
|
|
5786
|
+
})] }) : /* @__PURE__ */ _(aa, {})
|
|
5776
5787
|
] });
|
|
5777
|
-
},
|
|
5788
|
+
}, sa = ({ transferItem: e }) => /* @__PURE__ */ v("p", {
|
|
5778
5789
|
className: "pkt-fileupload__queue-display__item__title",
|
|
5779
|
-
children: [/* @__PURE__ */ _(
|
|
5790
|
+
children: [/* @__PURE__ */ _(ra, { children: bi(e) }), e.file && /* @__PURE__ */ v("span", {
|
|
5780
5791
|
className: "pkt-fileupload__queue-display__item__filesize",
|
|
5781
5792
|
children: [
|
|
5782
5793
|
" ",
|
|
5783
5794
|
"(",
|
|
5784
|
-
|
|
5795
|
+
$r(e.file.size),
|
|
5785
5796
|
")"
|
|
5786
5797
|
]
|
|
5787
5798
|
})]
|
|
5788
|
-
}),
|
|
5799
|
+
}), ca = ({ transferItem: e, onRemove: t, disabled: n }) => {
|
|
5789
5800
|
let r = (e.lastProgress ?? 1) * 100;
|
|
5790
5801
|
return /* @__PURE__ */ v(g, { children: [
|
|
5791
5802
|
/* @__PURE__ */ _(L, {
|
|
@@ -5793,14 +5804,14 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5793
5804
|
name: "alert-error",
|
|
5794
5805
|
"aria-hidden": "true"
|
|
5795
5806
|
}),
|
|
5796
|
-
/* @__PURE__ */ _(
|
|
5797
|
-
/* @__PURE__ */ _(
|
|
5807
|
+
/* @__PURE__ */ _(sa, { transferItem: e }),
|
|
5808
|
+
/* @__PURE__ */ _(ia, {
|
|
5798
5809
|
onClick: t,
|
|
5799
5810
|
label: "Fjern",
|
|
5800
5811
|
ariaLabel: "Fjern fil som feilet under opplasting",
|
|
5801
5812
|
disabled: n
|
|
5802
5813
|
}),
|
|
5803
|
-
/* @__PURE__ */ _(
|
|
5814
|
+
/* @__PURE__ */ _(Wi, {
|
|
5804
5815
|
valueCurrent: r,
|
|
5805
5816
|
statusType: "none",
|
|
5806
5817
|
valueMax: 100,
|
|
@@ -5812,14 +5823,14 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5812
5823
|
children: e.errorMessage
|
|
5813
5824
|
})
|
|
5814
5825
|
] });
|
|
5815
|
-
},
|
|
5826
|
+
}, la = ({ transferItem: e, onRemove: t, disabled: n }) => /* @__PURE__ */ v(g, { children: [
|
|
5816
5827
|
/* @__PURE__ */ _(L, {
|
|
5817
5828
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5818
5829
|
name: "alert-error",
|
|
5819
5830
|
"aria-hidden": "true"
|
|
5820
5831
|
}),
|
|
5821
|
-
/* @__PURE__ */ _(
|
|
5822
|
-
/* @__PURE__ */ _(
|
|
5832
|
+
/* @__PURE__ */ _(sa, { transferItem: e }),
|
|
5833
|
+
/* @__PURE__ */ _(ia, {
|
|
5823
5834
|
onClick: t,
|
|
5824
5835
|
label: "Fjern",
|
|
5825
5836
|
ariaLabel: "Fjern fil som feilet under opplasting",
|
|
@@ -5829,15 +5840,15 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5829
5840
|
className: "pkt-fileupload__queue-display__item__error-message",
|
|
5830
5841
|
children: e.errorMessage
|
|
5831
5842
|
})
|
|
5832
|
-
] }),
|
|
5843
|
+
] }), ua = ({ transferItem: e, onRemove: t, disabled: n }) => e.showProgress ? /* @__PURE__ */ _(ca, {
|
|
5833
5844
|
transferItem: e,
|
|
5834
5845
|
onRemove: t,
|
|
5835
5846
|
disabled: n
|
|
5836
|
-
}) : /* @__PURE__ */ _(
|
|
5847
|
+
}) : /* @__PURE__ */ _(la, {
|
|
5837
5848
|
transferItem: e,
|
|
5838
5849
|
onRemove: t,
|
|
5839
5850
|
disabled: n
|
|
5840
|
-
}),
|
|
5851
|
+
}), da = ({ operation: e, context: t }) => {
|
|
5841
5852
|
let n = typeof e.title == "function" ? e.title(t.file) : e.title;
|
|
5842
5853
|
return n ? /* @__PURE__ */ _("button", {
|
|
5843
5854
|
type: "button",
|
|
@@ -5849,11 +5860,11 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5849
5860
|
"aria-label": typeof e.ariaLabel == "function" ? e.ariaLabel(t.file) : e.ariaLabel,
|
|
5850
5861
|
children: n
|
|
5851
5862
|
}) : null;
|
|
5852
|
-
},
|
|
5863
|
+
}, fa = ({ transferItem: e }) => /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(L, {
|
|
5853
5864
|
name: "document-text",
|
|
5854
5865
|
className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
|
|
5855
5866
|
"aria-hidden": "true"
|
|
5856
|
-
}), /* @__PURE__ */ _(
|
|
5867
|
+
}), /* @__PURE__ */ _(sa, { transferItem: e })] }), pa = ({ transferItem: e, onPreviewClick: t }) => {
|
|
5857
5868
|
let [n, r] = m(null), [i, a] = m(!1), o = e.file;
|
|
5858
5869
|
c(() => {
|
|
5859
5870
|
if (a(!1), o.type.startsWith("image/")) {
|
|
@@ -5887,10 +5898,10 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5887
5898
|
}), s]
|
|
5888
5899
|
}), /* @__PURE__ */ _("span", {
|
|
5889
5900
|
className: "pkt-fileupload__queue-display__item__thumbnail__title",
|
|
5890
|
-
children: /* @__PURE__ */ _(
|
|
5901
|
+
children: /* @__PURE__ */ _(ra, { children: e.attributes.targetFilename })
|
|
5891
5902
|
})]
|
|
5892
5903
|
});
|
|
5893
|
-
},
|
|
5904
|
+
}, ma = ({ isOpen: e, images: t, currentIndex: n, onClose: r, onNavigate: i, modalRef: a }) => {
|
|
5894
5905
|
let [o, s] = m(null), [l, u] = m(!1), d = t[n], f = t.length > 1;
|
|
5895
5906
|
return c(() => {
|
|
5896
5907
|
if (u(!1), d && d.file.type.startsWith("image/")) {
|
|
@@ -5902,7 +5913,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5902
5913
|
if (!e) return;
|
|
5903
5914
|
let t = (e) => {
|
|
5904
5915
|
if (e.key === "Tab") {
|
|
5905
|
-
|
|
5916
|
+
hi(e, a.current);
|
|
5906
5917
|
return;
|
|
5907
5918
|
}
|
|
5908
5919
|
switch (e.key) {
|
|
@@ -5921,7 +5932,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5921
5932
|
i,
|
|
5922
5933
|
r,
|
|
5923
5934
|
a
|
|
5924
|
-
]), d ? /* @__PURE__ */ _(
|
|
5935
|
+
]), d ? /* @__PURE__ */ _(ta, {
|
|
5925
5936
|
ref: a,
|
|
5926
5937
|
headingText: d.attributes.targetFilename,
|
|
5927
5938
|
closeOnBackdropClick: !0,
|
|
@@ -5971,7 +5982,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5971
5982
|
]
|
|
5972
5983
|
})
|
|
5973
5984
|
}) : null;
|
|
5974
|
-
},
|
|
5985
|
+
}, ha = ({ operation: e, transferItem: t, inputName: n, disabled: r, activatedOperation: i, onActivate: a, onClose: o, buildAttributeAccessors: s }) => {
|
|
5975
5986
|
let c = s(t.fileId);
|
|
5976
5987
|
return {
|
|
5977
5988
|
file: t,
|
|
@@ -5983,29 +5994,29 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
5983
5994
|
getAttribute: c.getAttribute,
|
|
5984
5995
|
setAttribute: c.setAttribute
|
|
5985
5996
|
};
|
|
5986
|
-
},
|
|
5997
|
+
}, ga = (e, t) => e.map((e) => ({
|
|
5987
5998
|
operation: e,
|
|
5988
|
-
context:
|
|
5999
|
+
context: ha({
|
|
5989
6000
|
operation: e,
|
|
5990
6001
|
...t
|
|
5991
6002
|
})
|
|
5992
|
-
})),
|
|
5993
|
-
let t =
|
|
6003
|
+
})), _a = (e) => {
|
|
6004
|
+
let t = ga(e.operations, e);
|
|
5994
6005
|
return /* @__PURE__ */ _("div", {
|
|
5995
6006
|
className: "pkt-fileupload__queue-display__item__actions",
|
|
5996
|
-
children: t.filter(({ operation: t }) => t.id !== e.activatedOperation?.id).map(({ operation: e, context: t }) => /* @__PURE__ */ _(
|
|
6007
|
+
children: t.filter(({ operation: t }) => t.id !== e.activatedOperation?.id).map(({ operation: e, context: t }) => /* @__PURE__ */ _(da, {
|
|
5997
6008
|
operation: e,
|
|
5998
6009
|
context: t
|
|
5999
6010
|
}, e.id))
|
|
6000
6011
|
});
|
|
6001
|
-
},
|
|
6002
|
-
let t =
|
|
6012
|
+
}, va = (e) => {
|
|
6013
|
+
let t = ga(e.operations, e);
|
|
6003
6014
|
return /* @__PURE__ */ _(g, { children: t.filter(({ operation: e }) => e.renderContent).map(({ operation: e, context: t }) => /* @__PURE__ */ _("div", {
|
|
6004
6015
|
className: "pkt-fileupload__queue-display__item__operation-content",
|
|
6005
6016
|
children: e.renderContent(t)
|
|
6006
6017
|
}, e.id)) });
|
|
6007
|
-
},
|
|
6008
|
-
let { transferItem: t, activatedOperation: n, operations: r, ItemRenderer: i, onPreviewClick: a } = e, o = n ?
|
|
6018
|
+
}, ya = (e) => {
|
|
6019
|
+
let { transferItem: t, activatedOperation: n, operations: r, ItemRenderer: i, onPreviewClick: a } = e, o = n ? ha({
|
|
6009
6020
|
operation: n,
|
|
6010
6021
|
...e
|
|
6011
6022
|
}) : void 0, s = n?.renderInlineUI || n?.renderExtendedUI ? [] : r;
|
|
@@ -6021,43 +6032,43 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6021
6032
|
queueItemOperations: r,
|
|
6022
6033
|
onPreviewClick: a
|
|
6023
6034
|
}),
|
|
6024
|
-
s.length > 0 && /* @__PURE__ */ _(
|
|
6035
|
+
s.length > 0 && /* @__PURE__ */ _(_a, {
|
|
6025
6036
|
...e,
|
|
6026
6037
|
operations: s
|
|
6027
6038
|
}),
|
|
6028
|
-
/* @__PURE__ */ _(
|
|
6039
|
+
/* @__PURE__ */ _(va, { ...e }),
|
|
6029
6040
|
n?.renderExtendedUI && o && /* @__PURE__ */ _("div", {
|
|
6030
6041
|
className: "pkt-fileupload__queue-display__item__expanded-operation-ui",
|
|
6031
6042
|
children: n.renderExtendedUI(o)
|
|
6032
6043
|
})
|
|
6033
6044
|
] });
|
|
6034
|
-
},
|
|
6035
|
-
let { transferItem: t, enableImagePreview: n, onCancelTransfer: r, onOpenPreview: i, disabled: a } = e, o =
|
|
6045
|
+
}, ba = (e) => {
|
|
6046
|
+
let { transferItem: t, enableImagePreview: n, onCancelTransfer: r, onOpenPreview: i, disabled: a } = e, o = si(t.progress), s = n && t.progress === "done" && oi(t);
|
|
6036
6047
|
switch (o) {
|
|
6037
|
-
case "in-progress": return /* @__PURE__ */ _(
|
|
6048
|
+
case "in-progress": return /* @__PURE__ */ _(oa, {
|
|
6038
6049
|
transferItem: t,
|
|
6039
6050
|
cancelTransfer: () => r(t.fileId),
|
|
6040
6051
|
disabled: a
|
|
6041
6052
|
});
|
|
6042
|
-
case "error": return /* @__PURE__ */ _(
|
|
6053
|
+
case "error": return /* @__PURE__ */ _(ua, {
|
|
6043
6054
|
transferItem: t,
|
|
6044
6055
|
onRemove: () => r(t.fileId),
|
|
6045
6056
|
disabled: a
|
|
6046
6057
|
});
|
|
6047
|
-
case "idle": return /* @__PURE__ */ _(
|
|
6058
|
+
case "idle": return /* @__PURE__ */ _(ya, {
|
|
6048
6059
|
...e,
|
|
6049
6060
|
onPreviewClick: s ? () => i(t.fileId) : void 0
|
|
6050
6061
|
});
|
|
6051
6062
|
}
|
|
6052
|
-
},
|
|
6063
|
+
}, xa = (e, t, n) => f(() => ci(e, t, n), [
|
|
6053
6064
|
e,
|
|
6054
6065
|
t,
|
|
6055
6066
|
n
|
|
6056
|
-
]),
|
|
6057
|
-
let d =
|
|
6067
|
+
]), Sa = (e, t) => f(() => t ? e.filter((e) => e.progress === "done" && oi(e)) : [], [e, t]), Ca = ({ files: e, cancelTransfer: t, transfers: n = [], queueItemOperations: r = [], ItemRenderer: i = fa, truncateTail: a, enableImagePreview: o = !1, uploadStrategy: s = "form", disabled: c = !1, inputName: l, buildAttributeAccessors: u }) => {
|
|
6068
|
+
let d = xa(e, n, s), f = Sa(d, o), p = Hi(r), m = Vi(f);
|
|
6058
6069
|
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("ul", {
|
|
6059
6070
|
className: "pkt-fileupload__queue-display",
|
|
6060
|
-
children: /* @__PURE__ */ _(
|
|
6071
|
+
children: /* @__PURE__ */ _(na.Provider, {
|
|
6061
6072
|
value: { tail: a },
|
|
6062
6073
|
children: d.map((e) => {
|
|
6063
6074
|
let n = {
|
|
@@ -6075,10 +6086,10 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6075
6086
|
"pkt-fileupload__queue-display__item--in-progress": typeof e.progress == "number",
|
|
6076
6087
|
[`pkt-fileupload__queue-display__item--${e.progress}`]: typeof e.progress == "string"
|
|
6077
6088
|
}),
|
|
6078
|
-
children: [r.filter((e) => e.renderHidden).map((t) => /* @__PURE__ */ _("span", { children: t.renderHidden(
|
|
6089
|
+
children: [r.filter((e) => e.renderHidden).map((t) => /* @__PURE__ */ _("span", { children: t.renderHidden(ha({
|
|
6079
6090
|
operation: t,
|
|
6080
6091
|
...n
|
|
6081
|
-
})) }, `${t.id}-${e.fileId}`)), /* @__PURE__ */ _(
|
|
6092
|
+
})) }, `${t.id}-${e.fileId}`)), /* @__PURE__ */ _(ba, {
|
|
6082
6093
|
...n,
|
|
6083
6094
|
ItemRenderer: i,
|
|
6084
6095
|
enableImagePreview: o,
|
|
@@ -6088,7 +6099,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6088
6099
|
}, e.fileId);
|
|
6089
6100
|
})
|
|
6090
6101
|
})
|
|
6091
|
-
}), o && f.length > 0 && /* @__PURE__ */ _(
|
|
6102
|
+
}), o && f.length > 0 && /* @__PURE__ */ _(ma, {
|
|
6092
6103
|
modalRef: m.modalRef,
|
|
6093
6104
|
isOpen: m.isOpen,
|
|
6094
6105
|
images: f,
|
|
@@ -6096,10 +6107,10 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6096
6107
|
onClose: m.close,
|
|
6097
6108
|
onNavigate: m.navigate
|
|
6098
6109
|
})] });
|
|
6099
|
-
},
|
|
6100
|
-
filename:
|
|
6101
|
-
thumbnail:
|
|
6102
|
-
},
|
|
6110
|
+
}, wa = {
|
|
6111
|
+
filename: fa,
|
|
6112
|
+
thumbnail: pa
|
|
6113
|
+
}, Ta = 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 = wa.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: N, helptextDropdown: P, helptextDropdownButton: ee, optionalTag: te, optionalText: ne, requiredTag: F, requiredText: re, tagText: ie, required: ae = !1, enableImagePreview: oe = !1, "aria-describedby": se, "aria-invalid": I, strings: L, ...R }, ce) => {
|
|
6103
6114
|
let z = l(), ue = n ?? `pkt-fileupload-${z}`, de = p(null);
|
|
6104
6115
|
u(ce, () => de.current, []);
|
|
6105
6116
|
let V = "transfers" in R ? R.transfers : void 0, H = ve(["fileupload"], L).fileupload, [U, W] = m(null), [G, K] = m("");
|
|
@@ -6113,7 +6124,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6113
6124
|
N ? `${ue}-helptext` : void 0,
|
|
6114
6125
|
pe
|
|
6115
6126
|
].filter(Boolean).join(" ") || void 0, he = q || I === !0 || I === "true", J = o((e) => {
|
|
6116
|
-
let t =
|
|
6127
|
+
let t = ai(e, {
|
|
6117
6128
|
allowedFormats: S,
|
|
6118
6129
|
maxFileSize: w,
|
|
6119
6130
|
formatErrorMessage: C,
|
|
@@ -6139,13 +6150,13 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6139
6150
|
]);
|
|
6140
6151
|
e !== void 0 && t !== void 0 && console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"), e !== void 0 && h === void 0 && console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");
|
|
6141
6152
|
let ge = e !== void 0, [Y, _e] = m(() => t ?? []), X = ge ? e : Y;
|
|
6142
|
-
|
|
6153
|
+
Ui(de, {
|
|
6143
6154
|
uploadStrategy: i,
|
|
6144
6155
|
required: ae,
|
|
6145
6156
|
currentFileCount: X.length,
|
|
6146
6157
|
onMissingFiles: o(() => W(H.requiredMissing), [H])
|
|
6147
6158
|
});
|
|
6148
|
-
let be = typeof b == "string" ?
|
|
6159
|
+
let be = typeof b == "string" ? wa[b] : b, Z = b === "thumbnail", Q = typeof R.accept == "string" ? R.accept.trim() : void 0, xe = f(() => ri(Q, S) || void 0, [Q, S]), Se = s && !Z, Ce = a && !Z, we = o((e) => {
|
|
6149
6160
|
for (let t of e) {
|
|
6150
6161
|
let e = J(t.file);
|
|
6151
6162
|
if (e) {
|
|
@@ -6185,15 +6196,15 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6185
6196
|
X,
|
|
6186
6197
|
R,
|
|
6187
6198
|
ge
|
|
6188
|
-
]), { buildAttributeAccessors: De } =
|
|
6199
|
+
]), { buildAttributeAccessors: De } = Bi(X, Te), Oe = f(() => {
|
|
6189
6200
|
let e = [];
|
|
6190
|
-
return Se && e.push(
|
|
6201
|
+
return Se && e.push(zi), Ce && e.push(Pi), e.push(...y), e.push(Fi(Ee)), e;
|
|
6191
6202
|
}, [
|
|
6192
6203
|
Se,
|
|
6193
6204
|
Ce,
|
|
6194
6205
|
y,
|
|
6195
6206
|
Ee
|
|
6196
|
-
]), { totalCount: ke, uploadedCount: Ae, failedCount: je } = f(() =>
|
|
6207
|
+
]), { totalCount: ke, uploadedCount: Ae, failedCount: je } = f(() => vi(X, V), [X, V]), Me = le(ke, H.fileLabelOne, H.fileLabelOther), $ = /* @__PURE__ */ _("div", {
|
|
6197
6208
|
className: (0, M.default)("pkt-fileupload", {
|
|
6198
6209
|
"pkt-fileupload--full-width": x,
|
|
6199
6210
|
"pkt-fileupload--error": q,
|
|
@@ -6201,7 +6212,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6201
6212
|
}),
|
|
6202
6213
|
"aria-disabled": A,
|
|
6203
6214
|
...A ? { inert: !0 } : {},
|
|
6204
|
-
children: /* @__PURE__ */ v(
|
|
6215
|
+
children: /* @__PURE__ */ v(wi.Provider, {
|
|
6205
6216
|
value: {
|
|
6206
6217
|
name: R.name || "",
|
|
6207
6218
|
multiple: !!r,
|
|
@@ -6228,7 +6239,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6228
6239
|
label: Me
|
|
6229
6240
|
})
|
|
6230
6241
|
}),
|
|
6231
|
-
/* @__PURE__ */ _(
|
|
6242
|
+
/* @__PURE__ */ _(Ti, {
|
|
6232
6243
|
id: ue,
|
|
6233
6244
|
name: R.name || "",
|
|
6234
6245
|
form: R.form,
|
|
@@ -6237,7 +6248,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6237
6248
|
multiple: r,
|
|
6238
6249
|
uploadStrategy: i,
|
|
6239
6250
|
ref: de,
|
|
6240
|
-
accept: Z ?
|
|
6251
|
+
accept: Z ? yi : xe,
|
|
6241
6252
|
isThumbnailView: Z,
|
|
6242
6253
|
disabled: A,
|
|
6243
6254
|
required: ae && i === "form",
|
|
@@ -6256,7 +6267,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6256
6267
|
className: "pkt-fileupload__error-alert",
|
|
6257
6268
|
children: fe
|
|
6258
6269
|
}),
|
|
6259
|
-
X.length > 0 && /* @__PURE__ */ _(
|
|
6270
|
+
X.length > 0 && /* @__PURE__ */ _(Ca, {
|
|
6260
6271
|
files: X,
|
|
6261
6272
|
cancelTransfer: Ee,
|
|
6262
6273
|
truncateTail: d,
|
|
@@ -6274,7 +6285,7 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6274
6285
|
});
|
|
6275
6286
|
return /* @__PURE__ */ _("div", {
|
|
6276
6287
|
className: "pkt-fileupload-component",
|
|
6277
|
-
children: /* @__PURE__ */ _(
|
|
6288
|
+
children: /* @__PURE__ */ _(ir, {
|
|
6278
6289
|
strings: L,
|
|
6279
6290
|
forId: ue,
|
|
6280
6291
|
label: j ?? "",
|
|
@@ -6293,10 +6304,10 @@ var ta = n({ tail: 5 }), na = ({ children: e, tail: t }) => {
|
|
|
6293
6304
|
})
|
|
6294
6305
|
});
|
|
6295
6306
|
});
|
|
6296
|
-
|
|
6307
|
+
Ta.displayName = "PktFileUpload";
|
|
6297
6308
|
//#endregion
|
|
6298
6309
|
//#region ../../shared-utils/header-footer/icon-map.ts
|
|
6299
|
-
var
|
|
6310
|
+
var Ea = {
|
|
6300
6311
|
automat: "parking-meter",
|
|
6301
6312
|
bike: "bicycle",
|
|
6302
6313
|
corona: "virus",
|
|
@@ -6321,10 +6332,10 @@ var Ta = {
|
|
|
6321
6332
|
treatment: "processing",
|
|
6322
6333
|
"warning-triangle": "alert-warning"
|
|
6323
6334
|
};
|
|
6324
|
-
function
|
|
6325
|
-
return e && (
|
|
6335
|
+
function Da(e) {
|
|
6336
|
+
return e && (Ea[e] ?? e);
|
|
6326
6337
|
}
|
|
6327
|
-
var
|
|
6338
|
+
var Oa = {
|
|
6328
6339
|
"facebook.com": "facebook",
|
|
6329
6340
|
"fb.com": "facebook",
|
|
6330
6341
|
"instagram.com": "instagram",
|
|
@@ -6332,36 +6343,36 @@ var Da = {
|
|
|
6332
6343
|
"x.com": "x",
|
|
6333
6344
|
"github.com": "github"
|
|
6334
6345
|
};
|
|
6335
|
-
function
|
|
6346
|
+
function ka(e) {
|
|
6336
6347
|
return e.toLowerCase().replace(/^(?:www|m)\./, "");
|
|
6337
6348
|
}
|
|
6338
|
-
function
|
|
6349
|
+
function Aa(e, t) {
|
|
6339
6350
|
if (e) try {
|
|
6340
|
-
let t =
|
|
6351
|
+
let t = Oa[ka(new URL(e).hostname)];
|
|
6341
6352
|
if (t) return t;
|
|
6342
6353
|
} catch {}
|
|
6343
6354
|
if (t) {
|
|
6344
6355
|
let e = t.trim().toLowerCase().replace(/\s+/g, "-");
|
|
6345
6356
|
if (e) {
|
|
6346
|
-
let t =
|
|
6357
|
+
let t = Da(e);
|
|
6347
6358
|
if (t) return t;
|
|
6348
6359
|
}
|
|
6349
6360
|
}
|
|
6350
6361
|
}
|
|
6351
6362
|
//#endregion
|
|
6352
6363
|
//#region ../../shared-utils/header-footer/select-megamenu.ts
|
|
6353
|
-
var
|
|
6354
|
-
function
|
|
6355
|
-
if (e) return e[t] ?? e[
|
|
6364
|
+
var ja = "nb-NO";
|
|
6365
|
+
function Ma(e, t = ja) {
|
|
6366
|
+
if (e) return e[t] ?? e[ja];
|
|
6356
6367
|
}
|
|
6357
6368
|
//#endregion
|
|
6358
6369
|
//#region ../../shared-utils/header-footer/external-domain.ts
|
|
6359
|
-
var
|
|
6360
|
-
function
|
|
6370
|
+
var Na = "oslo.kommune.no", Pa = /\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;
|
|
6371
|
+
function Fa(e) {
|
|
6361
6372
|
let t = e.toLowerCase().replace(/\.$/, ""), n = t.split(".");
|
|
6362
|
-
return n.length <= 2 ? t : n.slice(
|
|
6373
|
+
return n.length <= 2 ? t : n.slice(Pa.test(t) ? -3 : -2).join(".");
|
|
6363
6374
|
}
|
|
6364
|
-
function
|
|
6375
|
+
function Ia(e) {
|
|
6365
6376
|
if (!e) return;
|
|
6366
6377
|
let t;
|
|
6367
6378
|
try {
|
|
@@ -6369,9 +6380,9 @@ function Fa(e) {
|
|
|
6369
6380
|
} catch {
|
|
6370
6381
|
return;
|
|
6371
6382
|
}
|
|
6372
|
-
if (t.protocol === "http:" || t.protocol === "https:") return
|
|
6383
|
+
if (t.protocol === "http:" || t.protocol === "https:") return Fa(t.hostname.toLowerCase().replace(/\.$/, ""));
|
|
6373
6384
|
}
|
|
6374
|
-
function
|
|
6385
|
+
function La(e, t = Na) {
|
|
6375
6386
|
if (!e) return;
|
|
6376
6387
|
let n;
|
|
6377
6388
|
try {
|
|
@@ -6381,21 +6392,21 @@ function Ia(e, t = Ma) {
|
|
|
6381
6392
|
}
|
|
6382
6393
|
if (n.protocol !== "http:" && n.protocol !== "https:") return;
|
|
6383
6394
|
let r = n.hostname.toLowerCase().replace(/\.$/, ""), i = t.toLowerCase();
|
|
6384
|
-
if (!(r === i || r.endsWith(`.${i}`))) return
|
|
6395
|
+
if (!(r === i || r.endsWith(`.${i}`))) return Fa(r);
|
|
6385
6396
|
}
|
|
6386
6397
|
//#endregion
|
|
6387
6398
|
//#region ../../shared-utils/header-footer/fetch-header-footer-data.ts
|
|
6388
|
-
var
|
|
6389
|
-
async function
|
|
6399
|
+
var Ra = /* @__PURE__ */ new Map();
|
|
6400
|
+
async function za(e) {
|
|
6390
6401
|
let t = await fetch(e);
|
|
6391
6402
|
if (!t.ok) throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${t.status})`);
|
|
6392
6403
|
let n = await t.json();
|
|
6393
6404
|
if (!n || typeof n != "object") throw Error(`pkt-header-menu: ${e} returned a non-object payload`);
|
|
6394
6405
|
return n;
|
|
6395
6406
|
}
|
|
6396
|
-
function
|
|
6397
|
-
return t ? t.aborted ? Promise.reject(
|
|
6398
|
-
let i = () => r(
|
|
6407
|
+
function Ba(e, t) {
|
|
6408
|
+
return t ? t.aborted ? Promise.reject(Va(t.reason)) : new Promise((n, r) => {
|
|
6409
|
+
let i = () => r(Va(t.reason));
|
|
6399
6410
|
t.addEventListener("abort", i, { once: !0 }), e.then((e) => {
|
|
6400
6411
|
t.removeEventListener("abort", i), n(e);
|
|
6401
6412
|
}, (e) => {
|
|
@@ -6403,22 +6414,22 @@ function za(e, t) {
|
|
|
6403
6414
|
});
|
|
6404
6415
|
}) : e;
|
|
6405
6416
|
}
|
|
6406
|
-
function
|
|
6417
|
+
function Va(e) {
|
|
6407
6418
|
return e instanceof Error ? e : new DOMException("The operation was aborted.", "AbortError");
|
|
6408
6419
|
}
|
|
6409
|
-
async function
|
|
6410
|
-
let n =
|
|
6411
|
-
return n || (n =
|
|
6420
|
+
async function Ha(e = Rn, t) {
|
|
6421
|
+
let n = Ra.get(e);
|
|
6422
|
+
return n || (n = za(e), n.catch(() => Ra.delete(e)), Ra.set(e, n)), Ba(n, t);
|
|
6412
6423
|
}
|
|
6413
6424
|
//#endregion
|
|
6414
6425
|
//#region src/components/footer/FooterGlobal.tsx
|
|
6415
|
-
var
|
|
6416
|
-
function
|
|
6426
|
+
var Ua = "#cb-trigger";
|
|
6427
|
+
function Wa({ data: e, dataUrl: t, locale: n = "nb-NO", skipGlobal: r = !1, onDataError: i }) {
|
|
6417
6428
|
let [a, o] = m(), s = p(i);
|
|
6418
6429
|
s.current = i, c(() => {
|
|
6419
6430
|
if (e || r) return;
|
|
6420
6431
|
let n = new AbortController();
|
|
6421
|
-
return
|
|
6432
|
+
return Ha(t, n.signal).then((e) => {
|
|
6422
6433
|
n.signal.aborted || o(e);
|
|
6423
6434
|
}).catch((e) => {
|
|
6424
6435
|
e.name !== "AbortError" && (console.warn("Failed to fetch header/footer data:", e), s.current?.(e));
|
|
@@ -6430,20 +6441,20 @@ function Ua({ data: e, dataUrl: t, locale: n = "nb-NO", skipGlobal: r = !1, onDa
|
|
|
6430
6441
|
]);
|
|
6431
6442
|
let l = e ?? a;
|
|
6432
6443
|
return f(() => {
|
|
6433
|
-
if (!r) return
|
|
6444
|
+
if (!r) return Ma(l, n)?.footer;
|
|
6434
6445
|
}, [
|
|
6435
6446
|
l,
|
|
6436
6447
|
n,
|
|
6437
6448
|
r
|
|
6438
6449
|
]);
|
|
6439
6450
|
}
|
|
6440
|
-
var
|
|
6441
|
-
if (e.url ===
|
|
6451
|
+
var Ga = ({ link: e, includeConsent: t, consent: n }) => {
|
|
6452
|
+
if (e.url === Ua) return t ? /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(Ir, {
|
|
6442
6453
|
triggerType: "footerlink",
|
|
6443
6454
|
triggerText: e.text,
|
|
6444
6455
|
...n
|
|
6445
6456
|
}) }) : null;
|
|
6446
|
-
let r =
|
|
6457
|
+
let r = La(e.url);
|
|
6447
6458
|
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ v("a", {
|
|
6448
6459
|
href: e.url,
|
|
6449
6460
|
children: [e.text, r && /* @__PURE__ */ v("span", {
|
|
@@ -6455,15 +6466,15 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6455
6466
|
]
|
|
6456
6467
|
})]
|
|
6457
6468
|
}) });
|
|
6458
|
-
},
|
|
6469
|
+
}, Ka = ({ section: e, includeConsent: t, consent: n }) => /* @__PURE__ */ v("section", { children: [/* @__PURE__ */ _("h2", { children: e.title }), /* @__PURE__ */ _("ul", {
|
|
6459
6470
|
className: "pkt-footer__link-list",
|
|
6460
|
-
children: e.links.map((e) => /* @__PURE__ */ _(
|
|
6471
|
+
children: e.links.map((e) => /* @__PURE__ */ _(Ga, {
|
|
6461
6472
|
link: e,
|
|
6462
6473
|
includeConsent: t,
|
|
6463
6474
|
consent: n
|
|
6464
6475
|
}, `${e.url}|${e.text}`))
|
|
6465
|
-
})] }),
|
|
6466
|
-
let t =
|
|
6476
|
+
})] }), qa = ({ entry: e }) => {
|
|
6477
|
+
let t = Aa(e.url, e.text);
|
|
6467
6478
|
return t ? /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _("a", {
|
|
6468
6479
|
className: "pkt-footer__some-link",
|
|
6469
6480
|
href: e.url,
|
|
@@ -6476,7 +6487,7 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6476
6487
|
href: e.url,
|
|
6477
6488
|
children: e.text
|
|
6478
6489
|
}) });
|
|
6479
|
-
},
|
|
6490
|
+
}, Ja = ({ footer: e, includeConsent: t = !1, consent: n = {} }) => {
|
|
6480
6491
|
let r = e.links?.length > 0, i = e.some?.length > 0;
|
|
6481
6492
|
return /* @__PURE__ */ _("div", {
|
|
6482
6493
|
className: "pkt-footer__band pkt-footer__band--global",
|
|
@@ -6484,7 +6495,7 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6484
6495
|
className: "pkt-footer__inner",
|
|
6485
6496
|
children: /* @__PURE__ */ v("div", {
|
|
6486
6497
|
className: "pkt-footer__sections",
|
|
6487
|
-
children: [e.sections.map((e) => /* @__PURE__ */ _(
|
|
6498
|
+
children: [e.sections.map((e) => /* @__PURE__ */ _(Ka, {
|
|
6488
6499
|
section: e,
|
|
6489
6500
|
includeConsent: t,
|
|
6490
6501
|
consent: n
|
|
@@ -6498,14 +6509,14 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6498
6509
|
}) }, `${e.url}|${e.text}`))
|
|
6499
6510
|
}), i && /* @__PURE__ */ _("ul", {
|
|
6500
6511
|
className: "pkt-footer__some",
|
|
6501
|
-
children: e.some.map((e) => /* @__PURE__ */ _(
|
|
6512
|
+
children: e.some.map((e) => /* @__PURE__ */ _(qa, { entry: e }, `${e.url}|${e.text}`))
|
|
6502
6513
|
})]
|
|
6503
6514
|
})]
|
|
6504
6515
|
})
|
|
6505
6516
|
})
|
|
6506
6517
|
});
|
|
6507
|
-
},
|
|
6508
|
-
let n = e.openInNewTab || t, r = e.external ?
|
|
6518
|
+
}, Ya = ({ link: e, openLinksInNewTab: t }) => {
|
|
6519
|
+
let n = e.openInNewTab || t, r = e.external ? Ia(e.href) : void 0;
|
|
6509
6520
|
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ v("a", {
|
|
6510
6521
|
href: e.href,
|
|
6511
6522
|
target: n ? "_blank" : "_self",
|
|
@@ -6519,17 +6530,17 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6519
6530
|
]
|
|
6520
6531
|
})]
|
|
6521
6532
|
}) });
|
|
6522
|
-
},
|
|
6533
|
+
}, Xa = ({ column: e, openLinksInNewTab: t }) => /* @__PURE__ */ v("section", { children: [
|
|
6523
6534
|
/* @__PURE__ */ _("h2", { children: e.title }),
|
|
6524
6535
|
e.text && /* @__PURE__ */ _("p", { children: e.text }),
|
|
6525
6536
|
!!e.links?.length && /* @__PURE__ */ _("ul", {
|
|
6526
6537
|
className: "pkt-footer__link-list",
|
|
6527
|
-
children: e.links.map((e) => /* @__PURE__ */ _(
|
|
6538
|
+
children: e.links.map((e) => /* @__PURE__ */ _(Ya, {
|
|
6528
6539
|
link: e,
|
|
6529
6540
|
openLinksInNewTab: t
|
|
6530
6541
|
}, `${e.href}|${e.text}`))
|
|
6531
6542
|
})
|
|
6532
|
-
] }),
|
|
6543
|
+
] }), Za = ({ columns: e, columnOne: t, columnTwo: n, personvernOgInfoLink: r, tilgjengelighetLink: i, socialLinks: a, skipGlobal: o = !1, data: s, dataUrl: l, locale: u = "nb-NO", openLinksInNewTab: d = !1, includeConsent: p = !1, hotjarId: m = null, googleAnalyticsId: h = null, devMode: g = !1, cookieDomain: y = null, cookieSecure: b = null, cookieExpiryDays: x = null, onToggleConsent: S, onDataError: C, className: w, ...T }) => {
|
|
6533
6544
|
c(() => {
|
|
6534
6545
|
(t || n) && console.warn("PktFooter: The \"columnOne\"/\"columnTwo\" props are deprecated and will be removed in a future version. Please use \"columns\" instead.");
|
|
6535
6546
|
}, [t, n]), c(() => {
|
|
@@ -6537,7 +6548,7 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6537
6548
|
}, [r, i]), c(() => {
|
|
6538
6549
|
a && console.warn("PktFooter: The \"socialLinks\" prop is deprecated and will be removed in a future version — the social media links now come from the global footer.");
|
|
6539
6550
|
}, [a]);
|
|
6540
|
-
let E =
|
|
6551
|
+
let E = Wa({
|
|
6541
6552
|
data: s,
|
|
6542
6553
|
dataUrl: l,
|
|
6543
6554
|
locale: u,
|
|
@@ -6580,14 +6591,14 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6580
6591
|
children: [
|
|
6581
6592
|
D.length > 0 && /* @__PURE__ */ _("div", {
|
|
6582
6593
|
className: "pkt-footer__sections",
|
|
6583
|
-
children: D.map((e) => /* @__PURE__ */ _(
|
|
6594
|
+
children: D.map((e) => /* @__PURE__ */ _(Xa, {
|
|
6584
6595
|
column: e,
|
|
6585
6596
|
openLinksInNewTab: d
|
|
6586
6597
|
}, e.title))
|
|
6587
6598
|
}),
|
|
6588
6599
|
k && /* @__PURE__ */ _("div", {
|
|
6589
6600
|
className: "pkt-footer__consent",
|
|
6590
|
-
children: /* @__PURE__ */ _(
|
|
6601
|
+
children: /* @__PURE__ */ _(Ir, {
|
|
6591
6602
|
triggerType: "footerlink",
|
|
6592
6603
|
...O
|
|
6593
6604
|
})
|
|
@@ -6620,14 +6631,14 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6620
6631
|
})
|
|
6621
6632
|
]
|
|
6622
6633
|
})
|
|
6623
|
-
}), E && /* @__PURE__ */ _(
|
|
6634
|
+
}), E && /* @__PURE__ */ _(Ja, {
|
|
6624
6635
|
footer: E,
|
|
6625
6636
|
includeConsent: p,
|
|
6626
6637
|
consent: O
|
|
6627
6638
|
})]
|
|
6628
6639
|
});
|
|
6629
|
-
},
|
|
6630
|
-
let n = e.openInNewTab || t, r = e.external ?
|
|
6640
|
+
}, Qa = ({ link: e, openLinksInNewTab: t }) => {
|
|
6641
|
+
let n = e.openInNewTab || t, r = e.external ? Ia(e.href) : void 0;
|
|
6631
6642
|
return /* @__PURE__ */ v("a", {
|
|
6632
6643
|
className: "pkt-footer-simple__link",
|
|
6633
6644
|
href: e.href,
|
|
@@ -6645,11 +6656,11 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6645
6656
|
]
|
|
6646
6657
|
})] })]
|
|
6647
6658
|
});
|
|
6648
|
-
},
|
|
6659
|
+
}, $a = ({ links: e, personvernOgInfoLink: t, tilgjengelighetLink: n, skipGlobal: r = !1, data: i, dataUrl: a, locale: o = "nb-NO", openLinksInNewTab: s = !1, includeConsent: l = !1, hotjarId: u = null, googleAnalyticsId: d = null, devMode: p = !1, cookieDomain: m = null, cookieSecure: h = null, cookieExpiryDays: g = null, onToggleConsent: y, onDataError: b, className: x, ...S }) => {
|
|
6649
6660
|
c(() => {
|
|
6650
6661
|
(t || n) && console.warn("PktFooterSimple: The \"personvernOgInfoLink\"/\"tilgjengelighetLink\" props are deprecated — the links now come from the global footer. Overridden values are rendered in the secondary footer.");
|
|
6651
6662
|
}, [t, n]);
|
|
6652
|
-
let C =
|
|
6663
|
+
let C = Wa({
|
|
6653
6664
|
data: i,
|
|
6654
6665
|
dataUrl: a,
|
|
6655
6666
|
locale: o,
|
|
@@ -6686,22 +6697,22 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6686
6697
|
className: "pkt-footer__inner pkt-footer__inner--compact",
|
|
6687
6698
|
children: /* @__PURE__ */ v("ul", {
|
|
6688
6699
|
className: "pkt-footer-simple__list",
|
|
6689
|
-
children: [w.map((e) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(
|
|
6700
|
+
children: [w.map((e) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(Qa, {
|
|
6690
6701
|
link: e,
|
|
6691
6702
|
openLinksInNewTab: s
|
|
6692
|
-
}) }, `${e.href}|${e.text}`)), E && /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(
|
|
6703
|
+
}) }, `${e.href}|${e.text}`)), E && /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(Ir, {
|
|
6693
6704
|
triggerType: "footerlink",
|
|
6694
6705
|
...T
|
|
6695
6706
|
}) })]
|
|
6696
6707
|
})
|
|
6697
6708
|
})
|
|
6698
|
-
}), C && /* @__PURE__ */ _(
|
|
6709
|
+
}), C && /* @__PURE__ */ _(Ja, {
|
|
6699
6710
|
footer: C,
|
|
6700
6711
|
includeConsent: l,
|
|
6701
6712
|
consent: T
|
|
6702
6713
|
})]
|
|
6703
6714
|
});
|
|
6704
|
-
},
|
|
6715
|
+
}, eo = (e, t) => {
|
|
6705
6716
|
let [n, r] = m(() => typeof window > "u" ? t ?? 0 : t ?? window.innerWidth);
|
|
6706
6717
|
return c(() => {
|
|
6707
6718
|
let t = e.current;
|
|
@@ -6722,10 +6733,10 @@ var Wa = ({ link: e, includeConsent: t, consent: n }) => {
|
|
|
6722
6733
|
};
|
|
6723
6734
|
//#endregion
|
|
6724
6735
|
//#region src/hooks/useHeaderChrome.ts
|
|
6725
|
-
function
|
|
6736
|
+
function to({ forwardedRef: e, mobileBreakpoint: t, tabletBreakpoint: n, position: r, scrollBehavior: i, pauseScrollHide: a = !1 }) {
|
|
6726
6737
|
let s = p(null), l = o((t) => {
|
|
6727
6738
|
s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
6728
|
-
}, [e]), u =
|
|
6739
|
+
}, [e]), u = eo(s), d = u < t, f = u < n, h = r === "fixed", g = r === "sticky", [_, v] = m(!1), y = p(0), b = i === "hide";
|
|
6729
6740
|
c(() => {
|
|
6730
6741
|
let e = () => {
|
|
6731
6742
|
if (!b || a) return;
|
|
@@ -6755,16 +6766,16 @@ function eo({ forwardedRef: e, mobileBreakpoint: t, tabletBreakpoint: n, positio
|
|
|
6755
6766
|
}
|
|
6756
6767
|
//#endregion
|
|
6757
6768
|
//#region src/hooks/useScrollLock.ts
|
|
6758
|
-
function
|
|
6759
|
-
let t = p(
|
|
6769
|
+
function no(e) {
|
|
6770
|
+
let t = p($i());
|
|
6760
6771
|
c(() => {
|
|
6761
6772
|
let n = t.current;
|
|
6762
|
-
return
|
|
6773
|
+
return ea(n, e), () => ea(n, !1);
|
|
6763
6774
|
}, [e]);
|
|
6764
6775
|
}
|
|
6765
6776
|
//#endregion
|
|
6766
6777
|
//#region src/components/header-menu/HeaderMenu.tsx
|
|
6767
|
-
var
|
|
6778
|
+
var ro = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileBreakpoint: i = 768, className: a, onDataLoaded: s, onDataError: l, ref: u, ...d }) => {
|
|
6768
6779
|
let [h, y] = m("loading"), [b, x] = m(void 0), S = t ? "ready" : h, C = p(s), w = p(l);
|
|
6769
6780
|
c(() => {
|
|
6770
6781
|
C.current = s;
|
|
@@ -6773,19 +6784,19 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6773
6784
|
}, [l]);
|
|
6774
6785
|
let T = p(null), E = o((e) => {
|
|
6775
6786
|
T.current = e, typeof u == "function" ? u(e) : u && (u.current = e);
|
|
6776
|
-
}, [u]), D =
|
|
6787
|
+
}, [u]), D = eo(T) < i;
|
|
6777
6788
|
c(() => {
|
|
6778
6789
|
t && C.current?.(t);
|
|
6779
6790
|
}, [t]), c(() => {
|
|
6780
6791
|
if (t) return;
|
|
6781
6792
|
let n = new AbortController();
|
|
6782
|
-
return
|
|
6793
|
+
return Ha(e, n.signal).then((e) => {
|
|
6783
6794
|
n.signal.aborted || (x(e), y("ready"), C.current?.(e));
|
|
6784
6795
|
}).catch((e) => {
|
|
6785
6796
|
e.name !== "AbortError" && (y("error"), w.current?.(e));
|
|
6786
6797
|
}), () => n.abort();
|
|
6787
6798
|
}, [t, e]);
|
|
6788
|
-
let O = t ?? b, k = f(() =>
|
|
6799
|
+
let O = t ?? b, k = f(() => Ma(O, n), [O, n]), A = [
|
|
6789
6800
|
"pkt-header-menu",
|
|
6790
6801
|
r && "pkt-header-menu--open",
|
|
6791
6802
|
a
|
|
@@ -6817,28 +6828,28 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6817
6828
|
className: A,
|
|
6818
6829
|
"aria-label": N,
|
|
6819
6830
|
children: [
|
|
6820
|
-
D ? /* @__PURE__ */ _(
|
|
6831
|
+
D ? /* @__PURE__ */ _(ao, {
|
|
6821
6832
|
services: j.services,
|
|
6822
6833
|
sections: j.sections
|
|
6823
6834
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
6824
|
-
/* @__PURE__ */ _(
|
|
6825
|
-
/* @__PURE__ */ _(
|
|
6835
|
+
/* @__PURE__ */ _(oo, { services: j.services }),
|
|
6836
|
+
/* @__PURE__ */ _(so, {
|
|
6826
6837
|
buttons: j.buttons,
|
|
6827
6838
|
mobile: !1
|
|
6828
6839
|
}),
|
|
6829
|
-
/* @__PURE__ */ _(
|
|
6840
|
+
/* @__PURE__ */ _(co, { sections: j.sections })
|
|
6830
6841
|
] }),
|
|
6831
|
-
/* @__PURE__ */ _(
|
|
6842
|
+
/* @__PURE__ */ _(so, {
|
|
6832
6843
|
buttons: j.buttons,
|
|
6833
6844
|
mobile: !0
|
|
6834
6845
|
}),
|
|
6835
|
-
/* @__PURE__ */ _(
|
|
6846
|
+
/* @__PURE__ */ _(uo, {
|
|
6836
6847
|
links: j.links,
|
|
6837
6848
|
some: j.some
|
|
6838
6849
|
})
|
|
6839
6850
|
]
|
|
6840
6851
|
});
|
|
6841
|
-
},
|
|
6852
|
+
}, io = ({ services: e }) => /* @__PURE__ */ _("ul", {
|
|
6842
6853
|
className: "pkt-header-menu__services-list",
|
|
6843
6854
|
children: e.links.map((e) => /* @__PURE__ */ _("li", {
|
|
6844
6855
|
className: "pkt-header-menu__service",
|
|
@@ -6847,7 +6858,7 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6847
6858
|
href: e.url,
|
|
6848
6859
|
children: [/* @__PURE__ */ _(L, {
|
|
6849
6860
|
className: "pkt-header-menu__service-icon",
|
|
6850
|
-
name:
|
|
6861
|
+
name: Da(e.icon),
|
|
6851
6862
|
"aria-hidden": "true"
|
|
6852
6863
|
}), /* @__PURE__ */ _("span", {
|
|
6853
6864
|
className: "pkt-header-menu__service-text",
|
|
@@ -6855,7 +6866,7 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6855
6866
|
})]
|
|
6856
6867
|
})
|
|
6857
6868
|
}, e.url))
|
|
6858
|
-
}),
|
|
6869
|
+
}), ao = ({ services: e, sections: t }) => /* @__PURE__ */ _("div", {
|
|
6859
6870
|
className: "pkt-header-menu__sections",
|
|
6860
6871
|
children: /* @__PURE__ */ v(j, {
|
|
6861
6872
|
className: "pkt-header-menu__sections-inner",
|
|
@@ -6866,22 +6877,22 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6866
6877
|
skin: "plus-minus",
|
|
6867
6878
|
id: "pkt-header-menu-services",
|
|
6868
6879
|
title: e.title,
|
|
6869
|
-
children: /* @__PURE__ */ _(
|
|
6880
|
+
children: /* @__PURE__ */ _(io, { services: e })
|
|
6870
6881
|
}), t.map((e, t) => /* @__PURE__ */ _(R, {
|
|
6871
6882
|
className: "pkt-header-menu__section",
|
|
6872
6883
|
skin: "plus-minus",
|
|
6873
6884
|
id: `pkt-header-menu-section-${t}`,
|
|
6874
6885
|
title: e.title,
|
|
6875
|
-
children: /* @__PURE__ */ _(
|
|
6886
|
+
children: /* @__PURE__ */ _(lo, { links: e.links })
|
|
6876
6887
|
}, e.title))]
|
|
6877
6888
|
})
|
|
6878
|
-
}),
|
|
6889
|
+
}), oo = ({ services: e }) => /* @__PURE__ */ v("div", {
|
|
6879
6890
|
className: "pkt-header-menu__services",
|
|
6880
6891
|
children: [/* @__PURE__ */ _("h2", {
|
|
6881
6892
|
className: "pkt-header-menu__services-title",
|
|
6882
6893
|
children: e.title
|
|
6883
|
-
}), /* @__PURE__ */ _(
|
|
6884
|
-
}),
|
|
6894
|
+
}), /* @__PURE__ */ _(io, { services: e })]
|
|
6895
|
+
}), so = ({ buttons: e, mobile: t }) => {
|
|
6885
6896
|
if (!e || e.length === 0) return null;
|
|
6886
6897
|
let n = ["pkt-header-menu__buttons", t && "pkt-header-menu__buttons--mobile"].filter(Boolean).join(" ");
|
|
6887
6898
|
return /* @__PURE__ */ _("div", {
|
|
@@ -6891,7 +6902,7 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6891
6902
|
href: e.url,
|
|
6892
6903
|
children: [/* @__PURE__ */ _(L, {
|
|
6893
6904
|
className: "pkt-btn__icon",
|
|
6894
|
-
name: e.iconName ?
|
|
6905
|
+
name: e.iconName ? Da(e.iconName) : "user",
|
|
6895
6906
|
"aria-hidden": "true"
|
|
6896
6907
|
}), /* @__PURE__ */ _("span", {
|
|
6897
6908
|
className: "pkt-btn__text",
|
|
@@ -6899,7 +6910,7 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6899
6910
|
})]
|
|
6900
6911
|
}, e.url))
|
|
6901
6912
|
});
|
|
6902
|
-
},
|
|
6913
|
+
}, co = ({ sections: e }) => !e || e.length === 0 ? null : /* @__PURE__ */ _("div", {
|
|
6903
6914
|
className: "pkt-header-menu__sections",
|
|
6904
6915
|
children: /* @__PURE__ */ _("div", {
|
|
6905
6916
|
className: "pkt-header-menu__sections-inner",
|
|
@@ -6908,17 +6919,17 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6908
6919
|
children: [/* @__PURE__ */ _("h2", {
|
|
6909
6920
|
className: "pkt-header-menu__section-title",
|
|
6910
6921
|
children: e.title
|
|
6911
|
-
}), /* @__PURE__ */ _(
|
|
6922
|
+
}), /* @__PURE__ */ _(lo, { links: e.links })]
|
|
6912
6923
|
}, e.title))
|
|
6913
6924
|
})
|
|
6914
|
-
}),
|
|
6925
|
+
}), lo = ({ links: e }) => /* @__PURE__ */ _("ul", {
|
|
6915
6926
|
className: "pkt-header-menu__section-list",
|
|
6916
6927
|
children: e.map((e) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _("a", {
|
|
6917
6928
|
className: "pkt-header-menu__section-link",
|
|
6918
6929
|
href: e.url,
|
|
6919
6930
|
children: e.text
|
|
6920
6931
|
}) }, e.url))
|
|
6921
|
-
}),
|
|
6932
|
+
}), uo = ({ links: e, some: t }) => {
|
|
6922
6933
|
let n = e && e.length > 0, r = t && t.length > 0;
|
|
6923
6934
|
return !n && !r ? null : /* @__PURE__ */ v("div", {
|
|
6924
6935
|
className: "pkt-header-menu__footer",
|
|
@@ -6931,11 +6942,11 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6931
6942
|
}) }, e.url))
|
|
6932
6943
|
}), r && /* @__PURE__ */ _("ul", {
|
|
6933
6944
|
className: "pkt-header-menu__footer-list pkt-header-menu__footer-list--social",
|
|
6934
|
-
children: t.map((e) => /* @__PURE__ */ _(
|
|
6945
|
+
children: t.map((e) => /* @__PURE__ */ _(fo, { entry: e }, e.url))
|
|
6935
6946
|
})]
|
|
6936
6947
|
});
|
|
6937
|
-
},
|
|
6938
|
-
let t =
|
|
6948
|
+
}, fo = ({ entry: e }) => {
|
|
6949
|
+
let t = Aa(e.url, e.text);
|
|
6939
6950
|
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _("a", {
|
|
6940
6951
|
className: "pkt-header-menu__social-link",
|
|
6941
6952
|
href: e.url,
|
|
@@ -6945,7 +6956,7 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6945
6956
|
"aria-hidden": "true"
|
|
6946
6957
|
}) : /* @__PURE__ */ _("span", { children: e.text })
|
|
6947
6958
|
}) });
|
|
6948
|
-
},
|
|
6959
|
+
}, po = ({ href: e, iconName: t, className: n, iconPosition: r, external: i, target: a, renderLink: o, children: s, ...c }) => {
|
|
6949
6960
|
let l = {
|
|
6950
6961
|
"pkt-link": !0,
|
|
6951
6962
|
"pkt-link--icon-left": !!t && r === "left" || !!(t && !r),
|
|
@@ -6971,10 +6982,10 @@ var no = ({ dataUrl: e = Rn, data: t, locale: n = "nb-NO", open: r = !1, mobileB
|
|
|
6971
6982
|
}
|
|
6972
6983
|
});
|
|
6973
6984
|
};
|
|
6974
|
-
|
|
6985
|
+
po.displayName = "PktLink";
|
|
6975
6986
|
//#endregion
|
|
6976
6987
|
//#region src/components/headerUserMenu/UserMenu.tsx
|
|
6977
|
-
var
|
|
6988
|
+
var mo = (e) => typeof e.target == "string" ? {
|
|
6978
6989
|
title: e.title,
|
|
6979
6990
|
iconName: e.iconName,
|
|
6980
6991
|
href: e.target
|
|
@@ -6982,7 +6993,7 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
6982
6993
|
title: e.title,
|
|
6983
6994
|
iconName: e.iconName,
|
|
6984
6995
|
onClick: e.target
|
|
6985
|
-
},
|
|
6996
|
+
}, ho = ({ item: e, className: t }) => "href" in e ? /* @__PURE__ */ _(po, {
|
|
6986
6997
|
iconName: e.iconName,
|
|
6987
6998
|
href: e.href,
|
|
6988
6999
|
className: (0, M.default)("pkt-user-menu__link", t),
|
|
@@ -6998,14 +7009,14 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
6998
7009
|
className: "pkt-link__icon",
|
|
6999
7010
|
"aria-hidden": "true"
|
|
7000
7011
|
}), e.title]
|
|
7001
|
-
}),
|
|
7012
|
+
}), go = ({ links: e }) => /* @__PURE__ */ _("ul", {
|
|
7002
7013
|
className: "pkt-user-menu__sublist",
|
|
7003
7014
|
children: e.map((e, t) => /* @__PURE__ */ _("li", {
|
|
7004
7015
|
className: "pkt-user-menu__subitem",
|
|
7005
|
-
children: /* @__PURE__ */ _(
|
|
7016
|
+
children: /* @__PURE__ */ _(ho, { item: e })
|
|
7006
7017
|
}, t))
|
|
7007
|
-
}),
|
|
7008
|
-
let l = ve(["header"], e).header, u = i?.map(
|
|
7018
|
+
}), _o = i(({ strings: e, user: t, formattedLastLoggedIn: n, representing: r, userMenu: i, canChangeRepresentation: a, changeRepresentation: o, logoutOnClick: s }, c) => {
|
|
7019
|
+
let l = ve(["header"], e).header, u = i?.map(mo);
|
|
7009
7020
|
return /* @__PURE__ */ _("nav", {
|
|
7010
7021
|
className: "pkt-user-menu",
|
|
7011
7022
|
ref: c,
|
|
@@ -7037,7 +7048,7 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
7037
7048
|
}),
|
|
7038
7049
|
u && u.length > 0 && /* @__PURE__ */ _("li", {
|
|
7039
7050
|
className: "pkt-user-menu__item",
|
|
7040
|
-
children: /* @__PURE__ */ _(
|
|
7051
|
+
children: /* @__PURE__ */ _(go, { links: u })
|
|
7041
7052
|
}),
|
|
7042
7053
|
r && /* @__PURE__ */ v("li", {
|
|
7043
7054
|
className: "pkt-user-menu__item",
|
|
@@ -7059,7 +7070,7 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
7059
7070
|
className: "pkt-user-menu__sublist mt-size-16",
|
|
7060
7071
|
children: /* @__PURE__ */ _("li", {
|
|
7061
7072
|
className: "pkt-user-menu__subitem",
|
|
7062
|
-
children: /* @__PURE__ */ _(
|
|
7073
|
+
children: /* @__PURE__ */ _(ho, { item: {
|
|
7063
7074
|
title: l.changeRepresentation,
|
|
7064
7075
|
iconName: "cogwheel",
|
|
7065
7076
|
onClick: o
|
|
@@ -7074,7 +7085,7 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
7074
7085
|
className: "pkt-user-menu__sublist",
|
|
7075
7086
|
children: /* @__PURE__ */ _("li", {
|
|
7076
7087
|
className: "pkt-user-menu__subitem",
|
|
7077
|
-
children: /* @__PURE__ */ _(
|
|
7088
|
+
children: /* @__PURE__ */ _(ho, { item: {
|
|
7078
7089
|
title: l.changeRepresentation,
|
|
7079
7090
|
iconName: "cogwheel",
|
|
7080
7091
|
onClick: o
|
|
@@ -7084,7 +7095,7 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
7084
7095
|
}),
|
|
7085
7096
|
s && /* @__PURE__ */ _("li", {
|
|
7086
7097
|
className: "pkt-user-menu__item",
|
|
7087
|
-
children: /* @__PURE__ */ _(
|
|
7098
|
+
children: /* @__PURE__ */ _(ho, { item: {
|
|
7088
7099
|
title: l.logOut,
|
|
7089
7100
|
iconName: "exit",
|
|
7090
7101
|
onClick: s
|
|
@@ -7094,10 +7105,10 @@ var po = (e) => typeof e.target == "string" ? {
|
|
|
7094
7105
|
})
|
|
7095
7106
|
});
|
|
7096
7107
|
});
|
|
7097
|
-
|
|
7108
|
+
_o.displayName = "PktHeaderUserMenu";
|
|
7098
7109
|
//#endregion
|
|
7099
7110
|
//#region src/components/searchinput/SearchInput.tsx
|
|
7100
|
-
var
|
|
7111
|
+
var vo = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1, fullwidth: r = !1, id: i, label: a, name: o, placeholder: s, suggestions: c, value: l = "", action: u, method: d, onChange: p, onSearch: m, onSuggestionClick: h, strings: y, ...b }, x) => {
|
|
7101
7112
|
let S = ve(["searchinput"], y), C = s ?? S.searchinput.placeholder, w = (e, t) => {
|
|
7102
7113
|
e ? e() : h && h(t);
|
|
7103
7114
|
}, T = (e) => {
|
|
@@ -7107,10 +7118,10 @@ var _o = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
|
|
|
7107
7118
|
`pkt-searchinput--${e}`,
|
|
7108
7119
|
`pkt-searchinput--${t}`,
|
|
7109
7120
|
r && "pkt-searchinput--fullwidth"
|
|
7110
|
-
].filter(Boolean).join(" "), D = f(() =>
|
|
7121
|
+
].filter(Boolean).join(" "), D = f(() => Jn(), []), O = i || D, k = {
|
|
7111
7122
|
role: "search",
|
|
7112
7123
|
className: E,
|
|
7113
|
-
...
|
|
7124
|
+
...Zn()
|
|
7114
7125
|
}, A = (e) => u ? /* @__PURE__ */ _("form", {
|
|
7115
7126
|
...k,
|
|
7116
7127
|
action: u,
|
|
@@ -7187,19 +7198,19 @@ var _o = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
|
|
|
7187
7198
|
})
|
|
7188
7199
|
] }));
|
|
7189
7200
|
});
|
|
7190
|
-
|
|
7201
|
+
vo.displayName = "PktSearchInput";
|
|
7191
7202
|
//#endregion
|
|
7192
7203
|
//#region src/components/header/HeaderGlobal.tsx
|
|
7193
|
-
var
|
|
7194
|
-
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath ||
|
|
7195
|
-
var
|
|
7204
|
+
var yo = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7205
|
+
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || yo);
|
|
7206
|
+
var bo = "pkt-header-global-menu", xo = "pkt-header-global-menu-toggle", So = "pkt-header-global-search-panel", Co = "pkt-header-global-search-toggle", wo = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a = zn, logoClick: s, logoPath: l = typeof window < "u" ? window.pktLogoPath : yo, 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: N, onDataError: P, strings: ee }, te) => {
|
|
7196
7207
|
let ne = k === "hide", [F, re] = m("none"), [ie, ae] = m(void 0), [oe, se] = m(!1), I = p(N), R = p(P);
|
|
7197
7208
|
c(() => {
|
|
7198
7209
|
I.current = N;
|
|
7199
7210
|
}, [N]), c(() => {
|
|
7200
7211
|
R.current = P;
|
|
7201
7212
|
}, [P]);
|
|
7202
|
-
let { setRef: ce, isMobile: z, isTablet: B, isFixed: le, isSticky: ue, hidden: de, captureFocus: V, flagRestoreFocus: H, restoreFocus: U } =
|
|
7213
|
+
let { setRef: ce, isMobile: z, isTablet: B, isFixed: le, isSticky: ue, hidden: de, captureFocus: V, flagRestoreFocus: H, restoreFocus: U } = to({
|
|
7203
7214
|
forwardedRef: te,
|
|
7204
7215
|
mobileBreakpoint: A,
|
|
7205
7216
|
tabletBreakpoint: j,
|
|
@@ -7207,13 +7218,13 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7207
7218
|
scrollBehavior: k,
|
|
7208
7219
|
pauseScrollHide: F !== "none"
|
|
7209
7220
|
});
|
|
7210
|
-
|
|
7221
|
+
no(F === "menu" || F === "search");
|
|
7211
7222
|
let W = p(null), G = o((e) => {
|
|
7212
7223
|
W.current = e, ce(e);
|
|
7213
7224
|
}, [ce]);
|
|
7214
7225
|
d(() => {
|
|
7215
7226
|
if (F !== "menu" && F !== "search") return;
|
|
7216
|
-
let e = document.getElementById(F === "menu" ?
|
|
7227
|
+
let e = document.getElementById(F === "menu" ? bo : So), t = W.current?.getBoundingClientRect();
|
|
7217
7228
|
!e || !t || (e.style.setProperty("--pkt-header-global-top", `${t.top}px`), e.style.setProperty("--pkt-header-global-left", `${t.left}px`), e.style.setProperty("--pkt-header-global-width", `${t.width}px`));
|
|
7218
7229
|
}, [
|
|
7219
7230
|
F,
|
|
@@ -7224,17 +7235,17 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7224
7235
|
}, [r]), c(() => {
|
|
7225
7236
|
if (r) return;
|
|
7226
7237
|
let e = new AbortController();
|
|
7227
|
-
return
|
|
7238
|
+
return Ha(n, e.signal).then((t) => {
|
|
7228
7239
|
e.signal.aborted || (ae(t), se(!1), I.current?.(t));
|
|
7229
7240
|
}).catch((e) => {
|
|
7230
7241
|
e.name !== "AbortError" && (se(!0), R.current?.(e));
|
|
7231
7242
|
}), () => e.abort();
|
|
7232
7243
|
}, [r, n]);
|
|
7233
|
-
let K = r ?? ie, fe = f(() =>
|
|
7244
|
+
let K = r ?? ie, fe = f(() => Ma(K, i), [K, i]);
|
|
7234
7245
|
c(() => {
|
|
7235
7246
|
let e = (e) => {
|
|
7236
7247
|
let t = e.target;
|
|
7237
|
-
F === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && re("none"), F === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${
|
|
7248
|
+
F === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && re("none"), F === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${xo}`) && re("none"), F === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${Co}`) && re("none");
|
|
7238
7249
|
}, t = (e) => {
|
|
7239
7250
|
e.key === "Escape" && F !== "none" && (e.preventDefault(), H(), re("none"));
|
|
7240
7251
|
};
|
|
@@ -7248,13 +7259,13 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7248
7259
|
H
|
|
7249
7260
|
]), c(() => {
|
|
7250
7261
|
if (F !== "menu" && F !== "search") return;
|
|
7251
|
-
let e = F === "menu" ?
|
|
7262
|
+
let e = F === "menu" ? bo : So, t = F === "menu" ? xo : Co, n = () => document.getElementById(e), r = () => document.getElementById(t), i = (e) => {
|
|
7252
7263
|
re("none"), (e.querySelector("button") ?? e).focus();
|
|
7253
7264
|
}, a = (e) => {
|
|
7254
7265
|
if (e.key !== "Tab") return;
|
|
7255
7266
|
let t = n(), a = r();
|
|
7256
7267
|
if (!t || !a) return;
|
|
7257
|
-
let o =
|
|
7268
|
+
let o = pi(t), s = mi();
|
|
7258
7269
|
if (s && a.contains(s)) {
|
|
7259
7270
|
!e.shiftKey && o.length > 0 && (e.preventDefault(), o[0].focus());
|
|
7260
7271
|
return;
|
|
@@ -7317,7 +7328,7 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7317
7328
|
children: [
|
|
7318
7329
|
!Q && xe && J && /* @__PURE__ */ _("div", {
|
|
7319
7330
|
className: "pkt-header-global__search",
|
|
7320
|
-
children: /* @__PURE__ */ _(
|
|
7331
|
+
children: /* @__PURE__ */ _(vo, {
|
|
7321
7332
|
appearance: "global",
|
|
7322
7333
|
inputSize: B ? "small" : "medium",
|
|
7323
7334
|
fullwidth: !0,
|
|
@@ -7332,7 +7343,7 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7332
7343
|
})
|
|
7333
7344
|
}),
|
|
7334
7345
|
Q && xe && /* @__PURE__ */ _(Y, {
|
|
7335
|
-
id:
|
|
7346
|
+
id: Co,
|
|
7336
7347
|
className: "pkt-header-global__search-toggle",
|
|
7337
7348
|
skin: "primary",
|
|
7338
7349
|
color: Z ? void 0 : "yellow",
|
|
@@ -7341,12 +7352,12 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7341
7352
|
size: z ? "small" : "medium",
|
|
7342
7353
|
state: Z ? "active" : "normal",
|
|
7343
7354
|
"aria-expanded": Z,
|
|
7344
|
-
"aria-controls":
|
|
7355
|
+
"aria-controls": So,
|
|
7345
7356
|
onClick: () => pe("search"),
|
|
7346
7357
|
children: X
|
|
7347
7358
|
}),
|
|
7348
7359
|
/* @__PURE__ */ _(Y, {
|
|
7349
|
-
id:
|
|
7360
|
+
id: xo,
|
|
7350
7361
|
className: "pkt-header-global__menu-toggle",
|
|
7351
7362
|
skin: Q ? "tertiary" : "secondary",
|
|
7352
7363
|
variant: Q ? "icon-only" : "icon-right",
|
|
@@ -7354,7 +7365,7 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7354
7365
|
size: B ? "small" : "medium",
|
|
7355
7366
|
state: ye ? "active" : "normal",
|
|
7356
7367
|
"aria-expanded": ye,
|
|
7357
|
-
"aria-controls":
|
|
7368
|
+
"aria-controls": bo,
|
|
7358
7369
|
disabled: Ce,
|
|
7359
7370
|
onClick: () => pe("menu"),
|
|
7360
7371
|
children: _e
|
|
@@ -7391,7 +7402,7 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7391
7402
|
})]
|
|
7392
7403
|
}), be && /* @__PURE__ */ _("div", {
|
|
7393
7404
|
className: "pkt-header-global__user-menu is-open",
|
|
7394
|
-
children: /* @__PURE__ */ _(
|
|
7405
|
+
children: /* @__PURE__ */ _(_o, {
|
|
7395
7406
|
strings: ee,
|
|
7396
7407
|
user: x,
|
|
7397
7408
|
formattedLastLoggedIn: q,
|
|
@@ -7407,8 +7418,8 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7407
7418
|
]
|
|
7408
7419
|
}), Te = ye && /* @__PURE__ */ _("div", {
|
|
7409
7420
|
className: (0, M.default)("pkt-header-global__menu", z && "pkt-header-global__menu--mobile", B && !z && "pkt-header-global__menu--tablet"),
|
|
7410
|
-
id:
|
|
7411
|
-
children: fe ? /* @__PURE__ */ _(
|
|
7421
|
+
id: bo,
|
|
7422
|
+
children: fe ? /* @__PURE__ */ _(ro, {
|
|
7412
7423
|
data: K,
|
|
7413
7424
|
locale: i,
|
|
7414
7425
|
open: !0,
|
|
@@ -7422,10 +7433,10 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7422
7433
|
})
|
|
7423
7434
|
}), Ee = Z && xe && J && /* @__PURE__ */ _("div", {
|
|
7424
7435
|
className: (0, M.default)("pkt-header-global__search-panel", z && "pkt-header-global__search-panel--mobile", B && !z && "pkt-header-global__search-panel--tablet"),
|
|
7425
|
-
id:
|
|
7436
|
+
id: So,
|
|
7426
7437
|
children: /* @__PURE__ */ _("div", {
|
|
7427
7438
|
className: "pkt-header-global__search-panel-inner",
|
|
7428
|
-
children: /* @__PURE__ */ _(
|
|
7439
|
+
children: /* @__PURE__ */ _(vo, {
|
|
7429
7440
|
appearance: "global",
|
|
7430
7441
|
fullwidth: !0,
|
|
7431
7442
|
id: Se,
|
|
@@ -7454,18 +7465,18 @@ var yo = "pkt-header-global-menu", bo = "pkt-header-global-menu-toggle", xo = "p
|
|
|
7454
7465
|
Te
|
|
7455
7466
|
] });
|
|
7456
7467
|
});
|
|
7457
|
-
|
|
7468
|
+
wo.displayName = "PktHeaderGlobal";
|
|
7458
7469
|
//#endregion
|
|
7459
7470
|
//#region src/components/textinput/Textinput.tsx
|
|
7460
|
-
var
|
|
7461
|
-
let ue = i ?? (o ?? 0) > 0, de = [s, "pkt-textinput"].filter(Boolean).join(" "), V = j === "search" && !g && !N, H = j === "date" && P ? P.slice(0, 10) : P, [U, W] = m(P?.length || 0), G =
|
|
7471
|
+
var To = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: l = !1, errorMessage: u, hasError: d = !1, helptext: f, helptextDropdown: p, helptextDropdownButton: h, iconNameRight: g, inline: y = !1, fullwidth: b = !1, label: x, name: S, optionalTag: C = !1, optionalText: w, requiredTag: T = !1, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = "text", useWrapper: M = !0, omitSearchIcon: N = !1, value: P, minLength: ee, maxLength: te, min: ne, max: F, step: re, size: ie, readonly: ae, required: oe, dataTestid: se, onChange: I, skipForwardTestid: R = !1, inputSize: ce = "medium", strings: z, ...B }, le) => {
|
|
7472
|
+
let ue = i ?? (o ?? 0) > 0, de = [s, "pkt-textinput"].filter(Boolean).join(" "), V = j === "search" && !g && !N, H = j === "date" && P ? P.slice(0, 10) : P, [U, W] = m(P?.length || 0), G = Yn(e), K = `${G}`, fe = `${K}-label`, q = n || fe, pe = (e) => {
|
|
7462
7473
|
ue && W(e.currentTarget?.value?.length || 0), I && I(e);
|
|
7463
7474
|
};
|
|
7464
7475
|
return c(() => {
|
|
7465
7476
|
P !== void 0 && W(P?.length || 0);
|
|
7466
7477
|
}, [P]), /* @__PURE__ */ _("div", {
|
|
7467
7478
|
className: de,
|
|
7468
|
-
children: /* @__PURE__ */ _(
|
|
7479
|
+
children: /* @__PURE__ */ _(ir, {
|
|
7469
7480
|
strings: z,
|
|
7470
7481
|
ariaDescribedby: t,
|
|
7471
7482
|
disabled: l,
|
|
@@ -7510,7 +7521,7 @@ var wo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7510
7521
|
disabled: l,
|
|
7511
7522
|
"aria-invalid": d,
|
|
7512
7523
|
"aria-errormessage": d ? `${G}-error` : void 0,
|
|
7513
|
-
"aria-describedby":
|
|
7524
|
+
"aria-describedby": Qn({
|
|
7514
7525
|
id: K,
|
|
7515
7526
|
hasHelptext: !!f,
|
|
7516
7527
|
hasCounter: ue,
|
|
@@ -7554,12 +7565,12 @@ var wo = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7554
7565
|
})
|
|
7555
7566
|
});
|
|
7556
7567
|
});
|
|
7557
|
-
|
|
7568
|
+
To.displayName = "PktTextinput";
|
|
7558
7569
|
//#endregion
|
|
7559
7570
|
//#region src/components/header/HeaderService.tsx
|
|
7560
|
-
var
|
|
7561
|
-
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath ||
|
|
7562
|
-
var
|
|
7571
|
+
var Eo = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
7572
|
+
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || Eo);
|
|
7573
|
+
var Do = 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: N = !1, logoLink: P = zn, logoClick: ee, logoPath: te = typeof window < "u" ? window.pktLogoPath : Eo, position: ne = "fixed", scrollBehavior: F = "hide", slotMenuVariant: re = "icon-only", slotMenuText: ie, strings: ae }, oe) => {
|
|
7563
7574
|
let se = F === "hide";
|
|
7564
7575
|
c(() => {
|
|
7565
7576
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
@@ -7580,14 +7591,14 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7580
7591
|
c(() => {
|
|
7581
7592
|
u !== void 0 && B(u);
|
|
7582
7593
|
}, [u]);
|
|
7583
|
-
let [le, ue] = m(!1), [de, V] = m(!1), H = p(null), U = p(null), W = p(null), G = p(null), K = p(null), { setRef: fe, isMobile: q, isTablet: pe, isFixed: me, isSticky: he, hidden: J, captureFocus: ge, flagRestoreFocus: _e, restoreFocus: X } =
|
|
7594
|
+
let [le, ue] = m(!1), [de, V] = m(!1), H = p(null), U = p(null), W = p(null), G = p(null), K = p(null), { setRef: fe, isMobile: q, isTablet: pe, isFixed: me, isSticky: he, hidden: J, captureFocus: ge, flagRestoreFocus: _e, restoreFocus: X } = to({
|
|
7584
7595
|
forwardedRef: oe,
|
|
7585
7596
|
mobileBreakpoint: e,
|
|
7586
7597
|
tabletBreakpoint: t,
|
|
7587
7598
|
position: ne,
|
|
7588
7599
|
scrollBehavior: F
|
|
7589
7600
|
});
|
|
7590
|
-
|
|
7601
|
+
no((me || he) && q && z !== "none");
|
|
7591
7602
|
let ye = o((e, t) => {
|
|
7592
7603
|
let n = e.relatedTarget, r;
|
|
7593
7604
|
switch (t) {
|
|
@@ -7669,7 +7680,7 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7669
7680
|
})), T && /* @__PURE__ */ _("span", {
|
|
7670
7681
|
className: "pkt-header-service__service-name",
|
|
7671
7682
|
translate: "no",
|
|
7672
|
-
children: C ? /* @__PURE__ */ _(
|
|
7683
|
+
children: C ? /* @__PURE__ */ _(po, {
|
|
7673
7684
|
href: C,
|
|
7674
7685
|
className: "pkt-header-service__service-link ",
|
|
7675
7686
|
children: T
|
|
@@ -7732,7 +7743,7 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7732
7743
|
}), /* @__PURE__ */ _("div", {
|
|
7733
7744
|
className: (0, M.default)("pkt-header-service__mobile-menu", z === "search" && "is-open", de && "align-right"),
|
|
7734
7745
|
ref: K,
|
|
7735
|
-
children: z === "search" && /* @__PURE__ */ _(
|
|
7746
|
+
children: z === "search" && /* @__PURE__ */ _(To, {
|
|
7736
7747
|
id: "mobile-search-menu",
|
|
7737
7748
|
className: "pkt-header-service__search-input",
|
|
7738
7749
|
type: "search",
|
|
@@ -7748,7 +7759,7 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7748
7759
|
}
|
|
7749
7760
|
})
|
|
7750
7761
|
})]
|
|
7751
|
-
}) : /* @__PURE__ */ _(
|
|
7762
|
+
}) : /* @__PURE__ */ _(To, {
|
|
7752
7763
|
id: "header-service-search",
|
|
7753
7764
|
className: "pkt-header-service__search-input",
|
|
7754
7765
|
type: "search",
|
|
@@ -7795,7 +7806,7 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7795
7806
|
})]
|
|
7796
7807
|
}), z === "user" && E && /* @__PURE__ */ _("div", {
|
|
7797
7808
|
className: (0, M.default)(q ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
|
|
7798
|
-
children: /* @__PURE__ */ _(
|
|
7809
|
+
children: /* @__PURE__ */ _(_o, {
|
|
7799
7810
|
strings: ae,
|
|
7800
7811
|
user: E,
|
|
7801
7812
|
formattedLastLoggedIn: ce,
|
|
@@ -7822,20 +7833,20 @@ var Eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7822
7833
|
children: [xe, /* @__PURE__ */ _("div", { className: (0, M.default)("pkt-header-service-spacer", i && "pkt-header-service-spacer--compact", E && "pkt-header-service-spacer--has-user", q && "pkt-header-service-spacer--mobile", pe && "pkt-header-service-spacer--tablet") })]
|
|
7823
7834
|
}) : xe;
|
|
7824
7835
|
});
|
|
7825
|
-
|
|
7836
|
+
Do.displayName = "PktHeaderService";
|
|
7826
7837
|
//#endregion
|
|
7827
7838
|
//#region src/components/header/Header.tsx
|
|
7828
|
-
var
|
|
7839
|
+
var Oo = i((e, t) => e.type === "global" ? /* @__PURE__ */ _(wo, {
|
|
7829
7840
|
...e,
|
|
7830
7841
|
ref: t
|
|
7831
|
-
}) : /* @__PURE__ */ _(
|
|
7842
|
+
}) : /* @__PURE__ */ _(Do, {
|
|
7832
7843
|
...e,
|
|
7833
7844
|
ref: t
|
|
7834
7845
|
}));
|
|
7835
|
-
|
|
7846
|
+
Oo.displayName = "PktHeader";
|
|
7836
7847
|
//#endregion
|
|
7837
7848
|
//#region src/components/input/Input.tsx
|
|
7838
|
-
var
|
|
7849
|
+
var ko = i(({ label: e, id: t, children: n, ...r }, i) => /* @__PURE__ */ v("div", {
|
|
7839
7850
|
className: "pkt-form-group",
|
|
7840
7851
|
children: [
|
|
7841
7852
|
/* @__PURE__ */ _("label", {
|
|
@@ -7852,10 +7863,10 @@ var Oo = i(({ label: e, id: t, children: n, ...r }, i) => /* @__PURE__ */ v("div
|
|
|
7852
7863
|
n
|
|
7853
7864
|
]
|
|
7854
7865
|
}));
|
|
7855
|
-
|
|
7866
|
+
ko.displayName = "PktInput";
|
|
7856
7867
|
//#endregion
|
|
7857
7868
|
//#region src/components/linkcard/LinkCard.tsx
|
|
7858
|
-
var
|
|
7869
|
+
var Ao = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab: a, external: o, className: s, strings: c, ...l }) => {
|
|
7859
7870
|
let u = ve(["linkcard"], c), d = ["pkt-linkcard", t && `pkt-linkcard--${t}`].filter(Boolean).join(" "), f = ["pkt-linkcard__title", o && "pkt-link pkt-link--external"].filter(Boolean).join(" ");
|
|
7860
7871
|
return /* @__PURE__ */ v("a", {
|
|
7861
7872
|
...l,
|
|
@@ -7885,14 +7896,14 @@ var ko = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab:
|
|
|
7885
7896
|
};
|
|
7886
7897
|
//#endregion
|
|
7887
7898
|
//#region src/components/loader/Loader.tsx
|
|
7888
|
-
|
|
7889
|
-
var
|
|
7899
|
+
Ao.displayName = "PktLinkCard", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
|
|
7900
|
+
var jo = (e) => {
|
|
7890
7901
|
switch (e) {
|
|
7891
7902
|
case "blue": return "spinner-blue";
|
|
7892
7903
|
case "rainbow": return "spinner";
|
|
7893
7904
|
default: return "loader";
|
|
7894
7905
|
}
|
|
7895
|
-
},
|
|
7906
|
+
}, Mo = i(function({ delay: e = 0, inline: t = !1, isLoading: n = !0, message: r = null, size: i = "medium", variant: a = "rainbow", loadingAnimationPath: o = typeof window < "u" ? window.pktAnimationPath : void 0, className: s, children: l, ...u }, d) {
|
|
7896
7907
|
let [f, p] = m(e === 0);
|
|
7897
7908
|
c(() => {
|
|
7898
7909
|
if (e > 0) {
|
|
@@ -7913,7 +7924,7 @@ var Ao = (e) => {
|
|
|
7913
7924
|
children: [n && f && /* @__PURE__ */ v("div", {
|
|
7914
7925
|
className: "pkt-loader__spinner",
|
|
7915
7926
|
children: [/* @__PURE__ */ _(L, {
|
|
7916
|
-
name:
|
|
7927
|
+
name: jo(a),
|
|
7917
7928
|
path: o,
|
|
7918
7929
|
className: `pkt-loader__svg pkt-loader__${a}`
|
|
7919
7930
|
}), r && /* @__PURE__ */ _("p", { children: r })]
|
|
@@ -7923,10 +7934,10 @@ var Ao = (e) => {
|
|
|
7923
7934
|
})]
|
|
7924
7935
|
});
|
|
7925
7936
|
});
|
|
7926
|
-
|
|
7937
|
+
Mo.displayName = "PktLoader";
|
|
7927
7938
|
//#endregion
|
|
7928
7939
|
//#region src/components/messagebox/Messagebox.tsx
|
|
7929
|
-
var
|
|
7940
|
+
var No = ({ children: e, className: t, skin: n, title: i, compact: a, closable: s, onClose: c, ...l }) => {
|
|
7930
7941
|
let [u, d] = m(!1), f = {
|
|
7931
7942
|
"pkt-messagebox": !0,
|
|
7932
7943
|
"pkt-messagebox--compact": a,
|
|
@@ -7964,11 +7975,11 @@ var Mo = ({ children: e, className: t, skin: n, title: i, compact: a, closable:
|
|
|
7964
7975
|
]
|
|
7965
7976
|
});
|
|
7966
7977
|
};
|
|
7967
|
-
|
|
7978
|
+
No.displayName = "PktMessagebox";
|
|
7968
7979
|
//#endregion
|
|
7969
7980
|
//#region src/components/radio/RadioButton.tsx
|
|
7970
|
-
var
|
|
7971
|
-
let S = ve(["forms"], m), C =
|
|
7981
|
+
var Po = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1, disabled: a = !1, checkHelptext: o, hasError: s = !1, defaultChecked: c, checked: l, optionalTag: u, optionalText: d, requiredTag: f, requiredText: p, strings: m, tagText: h, "aria-describedby": y, ...b }, x) => {
|
|
7982
|
+
let S = ve(["forms"], m), C = Yn(e), w = [r, "pkt-input-check"].filter(Boolean).join(" "), T = [
|
|
7972
7983
|
"pkt-input-check__input",
|
|
7973
7984
|
i ? "pkt-input-check__input--tile" : "",
|
|
7974
7985
|
a && i ? "pkt-input-check__input--tile-disabled" : ""
|
|
@@ -8024,14 +8035,14 @@ var No = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1, disabled:
|
|
|
8024
8035
|
})
|
|
8025
8036
|
});
|
|
8026
8037
|
});
|
|
8027
|
-
|
|
8038
|
+
Po.displayName = "PktRadioButton";
|
|
8028
8039
|
//#endregion
|
|
8029
8040
|
//#region src/components/select/Select.tsx
|
|
8030
|
-
var
|
|
8031
|
-
let D =
|
|
8041
|
+
var Fo = i(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r, disabled: i = !1, errorMessage: a, hasError: o = !1, helptext: s, helptextDropdown: c, helptextDropdownButton: l, id: u, inline: d = !1, fullwidth: f = !1, label: p, name: m, optionalTag: h = !1, optionalText: g, requiredTag: v = !1, requiredText: y, tagText: b, useWrapper: x = !0, hasFieldset: S, inputSize: C = "medium", strings: w, ...T }, E) => {
|
|
8042
|
+
let D = Yn(u), O = [r, "pkt-select"].filter(Boolean).join(" ");
|
|
8032
8043
|
return /* @__PURE__ */ _("div", {
|
|
8033
8044
|
className: O,
|
|
8034
|
-
children: /* @__PURE__ */ _(
|
|
8045
|
+
children: /* @__PURE__ */ _(ir, {
|
|
8035
8046
|
strings: w,
|
|
8036
8047
|
forId: `${D}-input`,
|
|
8037
8048
|
label: p,
|
|
@@ -8056,7 +8067,7 @@ var Po = i(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r,
|
|
|
8056
8067
|
className: `pkt-input pkt-input--${C} ${f ? "pkt-input--fullwidth" : ""}`,
|
|
8057
8068
|
"aria-invalid": o,
|
|
8058
8069
|
"aria-errormessage": o ? `${D}-error` : void 0,
|
|
8059
|
-
"aria-describedby":
|
|
8070
|
+
"aria-describedby": Qn({
|
|
8060
8071
|
id: `${D}-input`,
|
|
8061
8072
|
hasHelptext: !!s,
|
|
8062
8073
|
hasCounter: !1,
|
|
@@ -8072,10 +8083,10 @@ var Po = i(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r,
|
|
|
8072
8083
|
})
|
|
8073
8084
|
});
|
|
8074
8085
|
});
|
|
8075
|
-
|
|
8086
|
+
Fo.displayName = "PktSelect";
|
|
8076
8087
|
//#endregion
|
|
8077
8088
|
//#region src/components/stepper/Step.tsx
|
|
8078
|
-
var
|
|
8089
|
+
var Io = /* @__PURE__ */ _("svg", {
|
|
8079
8090
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8080
8091
|
width: "24",
|
|
8081
8092
|
height: "24",
|
|
@@ -8086,7 +8097,7 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8086
8097
|
r: "7",
|
|
8087
8098
|
style: { fill: "var(--pkt-color-brand-neutrals-300, #CCC)" }
|
|
8088
8099
|
})
|
|
8089
|
-
}),
|
|
8100
|
+
}), Lo = /* @__PURE__ */ v("svg", {
|
|
8090
8101
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8091
8102
|
width: "24",
|
|
8092
8103
|
height: "24",
|
|
@@ -8103,7 +8114,7 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8103
8114
|
r: "6",
|
|
8104
8115
|
fill: "#2A2859"
|
|
8105
8116
|
})]
|
|
8106
|
-
}),
|
|
8117
|
+
}), Ro = /* @__PURE__ */ v("svg", {
|
|
8107
8118
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8108
8119
|
width: "24",
|
|
8109
8120
|
height: "24",
|
|
@@ -8115,7 +8126,7 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8115
8126
|
d: "m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",
|
|
8116
8127
|
fill: "#F1FDFF"
|
|
8117
8128
|
})]
|
|
8118
|
-
}),
|
|
8129
|
+
}), zo = ({ children: e, className: t, status: n = "incomplete", title: r }) => /* @__PURE__ */ v("li", {
|
|
8119
8130
|
className: (0, M.default)("pkt-step", t, `pkt-step--${n}`),
|
|
8120
8131
|
"data-testid": "pkt-step",
|
|
8121
8132
|
children: [
|
|
@@ -8129,7 +8140,7 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8129
8140
|
}),
|
|
8130
8141
|
/* @__PURE__ */ _("span", {
|
|
8131
8142
|
className: (0, M.default)("pkt-step__indicator"),
|
|
8132
|
-
children: n === "current" ?
|
|
8143
|
+
children: n === "current" ? Lo : n === "completed" ? Ro : Io
|
|
8133
8144
|
}),
|
|
8134
8145
|
/* @__PURE__ */ _("span", {
|
|
8135
8146
|
className: "pkt-step__line pkt-step__line--3",
|
|
@@ -8146,7 +8157,7 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8146
8157
|
})]
|
|
8147
8158
|
})
|
|
8148
8159
|
]
|
|
8149
|
-
}),
|
|
8160
|
+
}), Bo = i(({ activeStep: n, className: r, children: i, hideNonActiveSteps: o = !1, hideNonActiveStepsContent: s = !0, orientation: c = "vertical", ...l }, u) => {
|
|
8150
8161
|
let d = (0, M.default)(r, "pkt-stepper", c === "horizontal" ? "pkt-stepper--horizontal" : "pkt-stepper--vertical"), f = e.map(i, (e, r) => a(e) ? t(e, { className: (0, M.default)(e.props.className, {
|
|
8151
8162
|
"pkt-step--hideStep": o && r !== n,
|
|
8152
8163
|
"pkt-step--hideContent": s && r !== n
|
|
@@ -8159,10 +8170,10 @@ var Fo = /* @__PURE__ */ _("svg", {
|
|
|
8159
8170
|
children: f
|
|
8160
8171
|
});
|
|
8161
8172
|
});
|
|
8162
|
-
|
|
8173
|
+
Bo.displayName = "PktStepper";
|
|
8163
8174
|
//#endregion
|
|
8164
8175
|
//#region src/components/table/Table.tsx
|
|
8165
|
-
var
|
|
8176
|
+
var Vo = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r = !0, children: i, ...a }) => /* @__PURE__ */ _("table", {
|
|
8166
8177
|
"data-testid": "pkt-table",
|
|
8167
8178
|
className: (0, M.default)(e, "pkt-table", {
|
|
8168
8179
|
"pkt-table--responsive": r,
|
|
@@ -8173,36 +8184,36 @@ var Bo = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
8173
8184
|
role: "table",
|
|
8174
8185
|
...a,
|
|
8175
8186
|
children: i
|
|
8176
|
-
}),
|
|
8187
|
+
}), Ho = ({ id: e, children: t, className: n, ...r }) => /* @__PURE__ */ _("tbody", {
|
|
8177
8188
|
id: e,
|
|
8178
8189
|
className: (0, M.default)(n, "pkt-table__body", {}),
|
|
8179
8190
|
...r,
|
|
8180
8191
|
role: "rowgroup",
|
|
8181
8192
|
children: t
|
|
8182
|
-
}),
|
|
8193
|
+
}), Uo = ({ children: e, className: t, dataLabel: n, ...r }) => /* @__PURE__ */ _("td", {
|
|
8183
8194
|
className: (0, M.default)(t, "pkt-table__data-cell", {}),
|
|
8184
8195
|
"data-label": n,
|
|
8185
8196
|
role: "cell",
|
|
8186
8197
|
"data-testid": "pkt-table__data-cell",
|
|
8187
8198
|
...r,
|
|
8188
8199
|
children: e
|
|
8189
|
-
}),
|
|
8200
|
+
}), Wo = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("thead", {
|
|
8190
8201
|
className: (0, M.default)(e, "pkt-table__header", {}),
|
|
8191
8202
|
role: "rowgroup",
|
|
8192
8203
|
...n,
|
|
8193
8204
|
children: t
|
|
8194
|
-
}),
|
|
8205
|
+
}), Go = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("th", {
|
|
8195
8206
|
className: (0, M.default)(e, "pkt-table__header-cell", {}),
|
|
8196
8207
|
role: "columnheader",
|
|
8197
8208
|
...n,
|
|
8198
8209
|
children: t
|
|
8199
|
-
}),
|
|
8210
|
+
}), Ko = ({ className: e, children: t, ...n }) => /* @__PURE__ */ _("tr", {
|
|
8200
8211
|
className: (0, M.default)(e, "pkt-table__row", {}),
|
|
8201
8212
|
role: "row",
|
|
8202
8213
|
...n,
|
|
8203
8214
|
children: t
|
|
8204
|
-
}),
|
|
8205
|
-
let { arrowNav: d, registerTabRef: f, handleKeyPress: p, selectTab: m } =
|
|
8215
|
+
}), qo = i(({ children: e, active: t, disabled: n = !1, href: r, onClick: i, icon: a, controls: o, tag: s, tagSkin: c, index: l = 0 }, u) => {
|
|
8216
|
+
let { arrowNav: d, registerTabRef: f, handleKeyPress: p, selectTab: m } = Yo(), h = !!t && !n, y = {
|
|
8206
8217
|
"aria-selected": d ? h : void 0,
|
|
8207
8218
|
"aria-controls": o,
|
|
8208
8219
|
role: d ? "tab" : void 0,
|
|
@@ -8230,7 +8241,7 @@ var Bo = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
8230
8241
|
className: `pkt-icon--small ${a === "check" ? "pkt-tabs__status-icon" : ""}`
|
|
8231
8242
|
}),
|
|
8232
8243
|
e,
|
|
8233
|
-
s && /* @__PURE__ */ _(
|
|
8244
|
+
s && /* @__PURE__ */ _(Gn, {
|
|
8234
8245
|
skin: c,
|
|
8235
8246
|
size: "small",
|
|
8236
8247
|
children: s
|
|
@@ -8251,14 +8262,14 @@ var Bo = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
|
|
|
8251
8262
|
children: b
|
|
8252
8263
|
});
|
|
8253
8264
|
});
|
|
8254
|
-
|
|
8265
|
+
qo.displayName = "PktTabItem";
|
|
8255
8266
|
//#endregion
|
|
8256
8267
|
//#region src/components/tabs/Tabs.tsx
|
|
8257
|
-
var
|
|
8258
|
-
let e = s(
|
|
8268
|
+
var Jo = n(null), Yo = () => {
|
|
8269
|
+
let e = s(Jo);
|
|
8259
8270
|
if (!e) throw Error("TabItem must be used within a Tabs component");
|
|
8260
8271
|
return e;
|
|
8261
|
-
},
|
|
8272
|
+
}, Xo = i(({ arrowNav: t = !0, disableArrowNav: n = !1, separatorIconName: r, separatorIconPath: i, tabs: a, onTabSelected: o, children: s }, l) => {
|
|
8262
8273
|
let u = p([]), d = p({}), f = t && !n, m = e.toArray(s), h = m.length > 0, g = h ? m.length : a?.length || 0, v = !!(r || i);
|
|
8263
8274
|
c(() => {
|
|
8264
8275
|
u.current = u.current.slice(0, g), Object.keys(d.current).forEach((e) => {
|
|
@@ -8305,7 +8316,7 @@ var qo = n(null), Jo = () => {
|
|
|
8305
8316
|
name: r,
|
|
8306
8317
|
className: "pkt-tabs__separator-icon"
|
|
8307
8318
|
}) : null
|
|
8308
|
-
}, e), T = (e) => !v || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, w(`separator-${n}`)] : [t]), E = a?.map((e, t) => /* @__PURE__ */ _(
|
|
8319
|
+
}, e), T = (e) => !v || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, w(`separator-${n}`)] : [t]), E = a?.map((e, t) => /* @__PURE__ */ _(qo, {
|
|
8309
8320
|
active: !e.disabled && e.active,
|
|
8310
8321
|
disabled: e.disabled,
|
|
8311
8322
|
href: e.href,
|
|
@@ -8316,7 +8327,7 @@ var qo = n(null), Jo = () => {
|
|
|
8316
8327
|
index: t,
|
|
8317
8328
|
children: e.text
|
|
8318
8329
|
}, t)), D = ["pkt-tabs", v && "pkt-tabs--with-separator"].filter(Boolean).join(" "), O = T(h ? m : E || []);
|
|
8319
|
-
return /* @__PURE__ */ _(
|
|
8330
|
+
return /* @__PURE__ */ _(Jo.Provider, {
|
|
8320
8331
|
value: {
|
|
8321
8332
|
arrowNav: f,
|
|
8322
8333
|
registerTabRef: C,
|
|
@@ -8334,53 +8345,53 @@ var qo = n(null), Jo = () => {
|
|
|
8334
8345
|
})
|
|
8335
8346
|
});
|
|
8336
8347
|
});
|
|
8337
|
-
|
|
8348
|
+
Xo.displayName = "PktTabs";
|
|
8338
8349
|
//#endregion
|
|
8339
8350
|
//#region ../../shared-utils/timepicker/options.ts
|
|
8340
|
-
var
|
|
8351
|
+
var Zo = (e) => e ? Math.max(1, Math.round(e / 60)) : 1, Qo = (e, t) => {
|
|
8341
8352
|
let n = e ? parseInt(String(e).split(":")[0], 10) : 0, r = t ? parseInt(String(t).split(":")[0], 10) : 23;
|
|
8342
8353
|
return Array.from({ length: r - n + 1 }, (e, t) => t + n);
|
|
8343
|
-
},
|
|
8344
|
-
let t =
|
|
8354
|
+
}, $o = (e) => {
|
|
8355
|
+
let t = Zo(e);
|
|
8345
8356
|
return Array.from({ length: Math.floor(60 / t) }, (e, n) => n * t);
|
|
8346
|
-
},
|
|
8357
|
+
}, es = (e, t, n, r) => {
|
|
8347
8358
|
let i = e === "" ? n === 1 ? 0 : 23 : parseInt(e, 10), a = t === "" ? n === 1 ? 0 : Math.floor(59 / r) * r : parseInt(t, 10);
|
|
8348
8359
|
return a += n * r, a > 59 ? (a = 0, i = (i + 1) % 24) : a < 0 && (a = Math.floor(59 / r) * r, i = (i - 1 + 24) % 24), {
|
|
8349
8360
|
hours: String(i).padStart(2, "0"),
|
|
8350
8361
|
minutes: String(a).padStart(2, "0")
|
|
8351
8362
|
};
|
|
8352
|
-
},
|
|
8363
|
+
}, ts = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && parseInt(e.slice(3), 10) <= 59, ns = (e) => {
|
|
8353
8364
|
let [t, n] = e.split(":").map(Number);
|
|
8354
8365
|
return t * 60 + n;
|
|
8355
8366
|
};
|
|
8356
8367
|
//#endregion
|
|
8357
8368
|
//#region src/components/timepicker/useTimepickerState.ts
|
|
8358
|
-
function
|
|
8359
|
-
if (e &&
|
|
8369
|
+
function rs(e) {
|
|
8370
|
+
if (e && ts(e)) {
|
|
8360
8371
|
let [t, n] = e.split(":");
|
|
8361
8372
|
return [t, n];
|
|
8362
8373
|
}
|
|
8363
8374
|
return ["", ""];
|
|
8364
8375
|
}
|
|
8365
|
-
function
|
|
8376
|
+
function is(e, t) {
|
|
8366
8377
|
return `${String(parseInt(e, 10)).padStart(2, "0")}:${String(parseInt(t, 10)).padStart(2, "0")}`;
|
|
8367
8378
|
}
|
|
8368
|
-
function
|
|
8379
|
+
function as(e, t, n) {
|
|
8369
8380
|
let { required: r, min: i, max: a, step: o } = t;
|
|
8370
8381
|
if (r && !e) return {
|
|
8371
8382
|
valid: !1,
|
|
8372
8383
|
message: n.valueMissing
|
|
8373
8384
|
};
|
|
8374
8385
|
if (!e) return { valid: !0 };
|
|
8375
|
-
if (!
|
|
8386
|
+
if (!ts(e)) return {
|
|
8376
8387
|
valid: !1,
|
|
8377
8388
|
message: n.typeMismatch
|
|
8378
8389
|
};
|
|
8379
|
-
let s =
|
|
8380
|
-
return i && s <
|
|
8390
|
+
let s = ns(e), c = Zo(o);
|
|
8391
|
+
return i && s < ns(String(i)) ? {
|
|
8381
8392
|
valid: !1,
|
|
8382
8393
|
message: B(n.rangeUnderflowMin, { min: String(i) })
|
|
8383
|
-
} : a && s >
|
|
8394
|
+
} : a && s > ns(String(a)) ? {
|
|
8384
8395
|
valid: !1,
|
|
8385
8396
|
message: B(n.rangeOverflowMax, { max: String(a) })
|
|
8386
8397
|
} : o && s % c !== 0 ? {
|
|
@@ -8388,11 +8399,11 @@ function is(e, t, n) {
|
|
|
8388
8399
|
message: c === 60 ? n.timeStepMismatchHour : c === 30 ? n.timeStepMismatchHalfHour : B(n.timeStepMismatch, { step: `${c}, ${c * 2}, ${c * 3}` })
|
|
8389
8400
|
} : { valid: !0 };
|
|
8390
8401
|
}
|
|
8391
|
-
function
|
|
8402
|
+
function os(e) {
|
|
8392
8403
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
8393
8404
|
}
|
|
8394
|
-
function
|
|
8395
|
-
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: P = !0, ariaDescribedby: ee, strings: te, className: ne, inputSize: F = "medium", onValueChange: re, onFocus: ie, onBlur: ae } = e, oe = ve(["timepicker", "validation"], te), se = oe.timepicker, I = te, L = i !== void 0, R = i === void 0 ? a ?? "" : i ?? "", ce = p(R), [z, B] = m(() => R), le = L ? i ?? "" : z, [ue, de] = m(() =>
|
|
8405
|
+
function ss(e, t) {
|
|
8406
|
+
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: P = !0, ariaDescribedby: ee, strings: te, className: ne, inputSize: F = "medium", onValueChange: re, onFocus: ie, onBlur: ae } = e, oe = ve(["timepicker", "validation"], te), se = oe.timepicker, I = te, L = i !== void 0, R = i === void 0 ? a ?? "" : i ?? "", ce = p(R), [z, B] = m(() => R), le = L ? i ?? "" : z, [ue, de] = m(() => rs(i === void 0 ? a : i)[0]), [V, H] = m(() => rs(i === void 0 ? a : i)[1]), U = p(ue), W = p(V), G = o((e) => {
|
|
8396
8407
|
U.current = e, de(e);
|
|
8397
8408
|
}, []), K = o((e) => {
|
|
8398
8409
|
W.current = e, H(e);
|
|
@@ -8400,7 +8411,7 @@ function os(e, t) {
|
|
|
8400
8411
|
c(() => {
|
|
8401
8412
|
if (!L || i === he.current) return;
|
|
8402
8413
|
he.current = i;
|
|
8403
|
-
let [e, t] =
|
|
8414
|
+
let [e, t] = rs(i);
|
|
8404
8415
|
G(e), K(t);
|
|
8405
8416
|
}, [
|
|
8406
8417
|
i,
|
|
@@ -8408,13 +8419,13 @@ function os(e, t) {
|
|
|
8408
8419
|
G,
|
|
8409
8420
|
K
|
|
8410
8421
|
]), c(() => {
|
|
8411
|
-
h != null && !
|
|
8422
|
+
h != null && !os(h) && console.warn(`PktTimepicker: step="${h}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`);
|
|
8412
8423
|
}, [h]);
|
|
8413
|
-
let J = p(null), ge = p(null), Y = p(null), _e = p(null), X = p(null), ye = p(null), be =
|
|
8424
|
+
let J = p(null), ge = p(null), Y = p(null), _e = p(null), X = p(null), ye = p(null), be = Or(X, b), Z = p(0), Q = p(-1), xe = p(0), Se = p(-1), [Ce, we] = m(!1), Te = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Ee = f(() => Zo(h), [h]), De = f(() => Qo(s, l), [s, l]), Oe = f(() => $o(h), [h]), ke = `${n}-hours`, Ae = `${n}-minutes`, je = `${n}-popup`, Me = `${n}-input`;
|
|
8414
8425
|
c(() => {
|
|
8415
8426
|
let e = J.current;
|
|
8416
8427
|
if (!e) return;
|
|
8417
|
-
let t =
|
|
8428
|
+
let t = as(le, {
|
|
8418
8429
|
required: S,
|
|
8419
8430
|
min: s,
|
|
8420
8431
|
max: l,
|
|
@@ -8441,20 +8452,20 @@ function os(e, t) {
|
|
|
8441
8452
|
]), Ne = o(() => {
|
|
8442
8453
|
let e = U.current, t = W.current;
|
|
8443
8454
|
if (e !== "" && t !== "") {
|
|
8444
|
-
let n =
|
|
8455
|
+
let n = is(e, t);
|
|
8445
8456
|
n !== le && $(n);
|
|
8446
8457
|
} else le !== "" && $("");
|
|
8447
8458
|
}, [le, $]), Pe = o(() => {
|
|
8448
8459
|
let e = U.current, t = W.current;
|
|
8449
8460
|
if (e !== "" && t !== "") {
|
|
8450
|
-
let n =
|
|
8461
|
+
let n = is(e, t);
|
|
8451
8462
|
n === le ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(n);
|
|
8452
8463
|
} else le === "" ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $("");
|
|
8453
8464
|
}, [le, $]), Fe = o(() => {
|
|
8454
8465
|
we(!0), Ne();
|
|
8455
8466
|
let e = J.current, t = ye.current;
|
|
8456
8467
|
if (!e) return;
|
|
8457
|
-
let n =
|
|
8468
|
+
let n = as(t?.value ?? "", {
|
|
8458
8469
|
required: S,
|
|
8459
8470
|
min: s,
|
|
8460
8471
|
max: l,
|
|
@@ -8527,7 +8538,7 @@ function os(e, t) {
|
|
|
8527
8538
|
G,
|
|
8528
8539
|
K
|
|
8529
8540
|
]), ze = o((e) => {
|
|
8530
|
-
let t =
|
|
8541
|
+
let t = es(U.current, W.current, e, Ee);
|
|
8531
8542
|
G(t.hours), K(t.minutes), `${t.hours}:${t.minutes}` !== le && $(`${t.hours}:${t.minutes}`);
|
|
8532
8543
|
}, [
|
|
8533
8544
|
Ee,
|
|
@@ -8745,7 +8756,7 @@ function os(e, t) {
|
|
|
8745
8756
|
set value(e) {
|
|
8746
8757
|
let t = e ?? "";
|
|
8747
8758
|
L || B(t);
|
|
8748
|
-
let [n, r] =
|
|
8759
|
+
let [n, r] = rs(t);
|
|
8749
8760
|
G(n), K(r), ye.current && (ye.current.value = t);
|
|
8750
8761
|
},
|
|
8751
8762
|
focus() {
|
|
@@ -8762,7 +8773,7 @@ function os(e, t) {
|
|
|
8762
8773
|
if (!be) return;
|
|
8763
8774
|
let e = () => {
|
|
8764
8775
|
window.setTimeout(() => {
|
|
8765
|
-
let e = ce.current, [t, n] =
|
|
8776
|
+
let e = ce.current, [t, n] = rs(e);
|
|
8766
8777
|
G(t), K(n), L || B(e), ye.current && (ye.current.value = e), q(!1), we(!1);
|
|
8767
8778
|
}, 0);
|
|
8768
8779
|
};
|
|
@@ -8840,8 +8851,8 @@ function os(e, t) {
|
|
|
8840
8851
|
}
|
|
8841
8852
|
//#endregion
|
|
8842
8853
|
//#region src/components/timepicker/Timepicker.tsx
|
|
8843
|
-
var
|
|
8844
|
-
let { onChange: n, inputSize: r = "medium" } = e, i =
|
|
8854
|
+
var cs = i((e, t) => {
|
|
8855
|
+
let { onChange: n, inputSize: r = "medium" } = e, i = ss(e, t), a = i.strings.hours, o = i.strings.minutes, s = i.label ? `${a}, ${i.label}` : a, c = i.label ? `${o}, ${i.label}` : o, l = Qn({
|
|
8845
8856
|
id: i.hoursId,
|
|
8846
8857
|
hasHelptext: !!i.helptext,
|
|
8847
8858
|
ariaDescribedby: i.ariaDescribedby
|
|
@@ -9026,7 +9037,7 @@ var ss = i((e, t) => {
|
|
|
9026
9037
|
id: i.id || void 0,
|
|
9027
9038
|
onFocus: i.handleFocusIn,
|
|
9028
9039
|
onBlur: i.handleFocusOut,
|
|
9029
|
-
children: /* @__PURE__ */ _(
|
|
9040
|
+
children: /* @__PURE__ */ _(ir, {
|
|
9030
9041
|
strings: i.stringsOverride,
|
|
9031
9042
|
forId: i.hoursId,
|
|
9032
9043
|
label: i.label,
|
|
@@ -9053,6 +9064,6 @@ var ss = i((e, t) => {
|
|
|
9053
9064
|
})
|
|
9054
9065
|
});
|
|
9055
9066
|
});
|
|
9056
|
-
|
|
9067
|
+
cs.displayName = "PktTimepicker";
|
|
9057
9068
|
//#endregion
|
|
9058
|
-
export {
|
|
9069
|
+
export { Ci as FileItem, wa as ItemRenderers, j as PktAccordion, R as PktAccordionItem, ye as PktAlert, be as PktBackLink, Z as PktBreadcrumbs, Y as PktButton, Ln as PktCalendar, Kn as PktCard, Xn as PktCheckbox, jr as PktCombobox, Ir as PktConsent, Zr as PktDatepicker, Ta as PktFileUpload, Za as PktFooter, $a as PktFooterSimple, Oo as PktHeader, wo as PktHeaderGlobal, ro as PktHeaderMenu, Do as PktHeaderService, Wn as PktHeading, rr as PktHelptext, L as PktIcon, ko as PktInput, ir as PktInputWrapper, po as PktLink, Ao as PktLinkCard, Mo as PktLoader, No as PktMessagebox, ta as PktModal, Wi as PktProgressbar, Po as PktRadioButton, vo as PktSearchInput, Fo as PktSelect, zo as PktStep, Bo as PktStepper, X as PktStringsProvider, qo as PktTabItem, Vo as PktTable, Ho as PktTableBody, Uo as PktTableDataCell, Wo as PktTableHeader, Go as PktTableHeaderCell, Ko as PktTableRow, Xo as PktTabs, Gn as PktTag, Di as PktTextarea, To as PktTextinput, cs as PktTimepicker, W as getPktStrings, ce as pktStringsNb, G as resetPktStrings, U as setPktStrings, K as subscribePktStrings };
|