@oslokommune/punkt-react 18.9.4 → 18.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/components/combobox/types.d.ts +2 -0
- package/dist/components/helptext/helptextAssociation.test.d.ts +1 -0
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +827 -817
- package/package.json +3 -3
- package/src/components/combobox/ComboboxInput.tsx +9 -0
- package/src/components/combobox/types.ts +2 -0
- package/src/components/combobox/useComboboxState.ts +2 -0
- package/src/components/fileupload/FileUpload.tsx +22 -26
- package/src/components/helptext/helptextAssociation.test.tsx +100 -0
- package/src/components/timepicker/Timepicker.tsx +8 -0
package/dist/punkt-react.js
CHANGED
|
@@ -332,16 +332,16 @@ var le = {
|
|
|
332
332
|
function z(e, t) {
|
|
333
333
|
return t ? e.replace(R, (n, r) => {
|
|
334
334
|
let i = t[r];
|
|
335
|
-
return i == null ? (
|
|
335
|
+
return i == null ? (de(r, e), n) : String(i);
|
|
336
336
|
}) : e;
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function B(e, t, n) {
|
|
339
339
|
return e === 1 ? t : n;
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
341
|
+
var ue = /* @__PURE__ */ new Set();
|
|
342
|
+
function de(e, t) {
|
|
343
343
|
let n = `${e}::${t}`;
|
|
344
|
-
|
|
344
|
+
ue.has(n) || (ue.add(n), console.warn(`[punkt] Mangler verdi for plassholderen {${e}} i teksten «${t}»`));
|
|
345
345
|
}
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region ../../shared-strings/store.ts
|
|
@@ -353,7 +353,7 @@ function H() {
|
|
|
353
353
|
listeners: /* @__PURE__ */ new Set()
|
|
354
354
|
}), e[V];
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function U(e) {
|
|
357
357
|
let t = H(), n = { ...t.overrides };
|
|
358
358
|
for (let t of Object.keys(e)) {
|
|
359
359
|
let r = e[t];
|
|
@@ -364,14 +364,14 @@ function fe(e) {
|
|
|
364
364
|
}
|
|
365
365
|
t.overrides = n, t.listeners.forEach((e) => e());
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function W() {
|
|
368
368
|
return H().overrides;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function G() {
|
|
371
371
|
let e = H();
|
|
372
372
|
e.overrides = {}, e.listeners.forEach((e) => e());
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function K(e) {
|
|
375
375
|
let t = H();
|
|
376
376
|
return t.listeners.add(e), () => {
|
|
377
377
|
t.listeners.delete(e);
|
|
@@ -379,44 +379,44 @@ function G(e) {
|
|
|
379
379
|
}
|
|
380
380
|
//#endregion
|
|
381
381
|
//#region ../../shared-strings/resolve.ts
|
|
382
|
-
var
|
|
383
|
-
function
|
|
382
|
+
var fe = /* @__PURE__ */ new Map();
|
|
383
|
+
function q(e, t) {
|
|
384
384
|
if (t) for (let n of Object.keys(t)) {
|
|
385
385
|
let r = t[n];
|
|
386
386
|
r !== void 0 && (e[n] = r);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function pe(e) {
|
|
390
390
|
return !!e && Object.keys(e).length > 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
let t =
|
|
392
|
+
function me(e) {
|
|
393
|
+
let t = W(), n = fe.get(e);
|
|
394
394
|
if (n && n.overrides === t) return n.value;
|
|
395
395
|
let r = t[e], i;
|
|
396
|
-
if (
|
|
396
|
+
if (pe(r)) {
|
|
397
397
|
let t = { ...le[e] };
|
|
398
|
-
|
|
398
|
+
q(t, r), i = t;
|
|
399
399
|
} else i = le[e];
|
|
400
|
-
return
|
|
400
|
+
return fe.set(e, {
|
|
401
401
|
overrides: t,
|
|
402
402
|
value: i
|
|
403
403
|
}), i;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
let n = t.filter((t) =>
|
|
405
|
+
function he(e, ...t) {
|
|
406
|
+
let n = t.filter((t) => pe(t?.[e])), r = me(e);
|
|
407
407
|
if (n.length === 0) return r;
|
|
408
408
|
let i = { ...r };
|
|
409
|
-
for (let t of n)
|
|
409
|
+
for (let t of n) q(i, t?.[e]);
|
|
410
410
|
return i;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function J(e, ...t) {
|
|
413
413
|
let n = {};
|
|
414
|
-
for (let r of e) n[r] =
|
|
414
|
+
for (let r of e) n[r] = he(r, ...t);
|
|
415
415
|
return n;
|
|
416
416
|
}
|
|
417
417
|
//#endregion
|
|
418
418
|
//#region ../../shared-strings/consent.ts
|
|
419
|
-
var
|
|
419
|
+
var ge = {
|
|
420
420
|
i18n: {
|
|
421
421
|
nb: {
|
|
422
422
|
contentPresentation: {
|
|
@@ -529,7 +529,7 @@ var _e = {
|
|
|
529
529
|
//#endregion
|
|
530
530
|
//#region src/components/button/Button.tsx
|
|
531
531
|
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/18.9/animations/");
|
|
532
|
-
var
|
|
532
|
+
var Y = i(({ children: e, className: t, iconName: n = "user", secondIconName: r = "user", iconPath: i, secondIconPath: a, size: o = "medium", fullWidth: s = !1, fullWidthOnMobile: c = !1, skin: l = "primary", type: u = "button", variant: d = "label-only", state: f, color: p, isLoading: m = void 0, disabled: h = void 0, loadingAnimationPath: g = window.pktAnimationPath, ...y }, b) => {
|
|
533
533
|
let x = [
|
|
534
534
|
t,
|
|
535
535
|
"pkt-btn",
|
|
@@ -573,11 +573,11 @@ var ve = i(({ children: e, className: t, iconName: n = "user", secondIconName: r
|
|
|
573
573
|
]
|
|
574
574
|
});
|
|
575
575
|
});
|
|
576
|
-
|
|
576
|
+
Y.displayName = "PktButton";
|
|
577
577
|
//#endregion
|
|
578
578
|
//#region src/components/strings/PktStringsProvider.tsx
|
|
579
|
-
var
|
|
580
|
-
let n = s(
|
|
579
|
+
var _e = n(void 0), X = ({ strings: e, children: t }) => {
|
|
580
|
+
let n = s(_e), r = f(() => {
|
|
581
581
|
if (!n) return e;
|
|
582
582
|
let t = { ...n };
|
|
583
583
|
for (let n of Object.keys(e)) t[n] = {
|
|
@@ -586,16 +586,16 @@ var J = n(void 0), ye = ({ strings: e, children: t }) => {
|
|
|
586
586
|
};
|
|
587
587
|
return t;
|
|
588
588
|
}, [n, e]);
|
|
589
|
-
return /* @__PURE__ */ _(
|
|
589
|
+
return /* @__PURE__ */ _(_e.Provider, {
|
|
590
590
|
value: r,
|
|
591
591
|
children: t
|
|
592
592
|
});
|
|
593
593
|
};
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region src/hooks/usePktStrings.ts
|
|
596
|
-
function
|
|
597
|
-
let n = h(
|
|
598
|
-
return f(() =>
|
|
596
|
+
function ve(e, t) {
|
|
597
|
+
let n = h(K, W, W), r = s(_e), i = e.join("|");
|
|
598
|
+
return f(() => J(e, r, t), [
|
|
599
599
|
i,
|
|
600
600
|
n,
|
|
601
601
|
r,
|
|
@@ -604,8 +604,8 @@ function be(e, t) {
|
|
|
604
604
|
}
|
|
605
605
|
//#endregion
|
|
606
606
|
//#region src/components/alert/Alert.tsx
|
|
607
|
-
var
|
|
608
|
-
let [h, g] = m(!1), y =
|
|
607
|
+
var ye = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medium", title: i, date: a, ariaLive: s, "aria-live": c = "polite", role: l = "status", skin: u = "info", className: d, strings: f, ...p }) => {
|
|
608
|
+
let [h, g] = m(!1), y = ve(["generic", "alert"], f), b = {
|
|
609
609
|
"pkt-alert": !0,
|
|
610
610
|
[`pkt-alert--${r}`]: r,
|
|
611
611
|
[`pkt-alert--${u}`]: u,
|
|
@@ -636,7 +636,7 @@ var Y = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medi
|
|
|
636
636
|
}),
|
|
637
637
|
t && /* @__PURE__ */ _("div", {
|
|
638
638
|
className: "pkt-alert__close",
|
|
639
|
-
children: /* @__PURE__ */ _(
|
|
639
|
+
children: /* @__PURE__ */ _(Y, {
|
|
640
640
|
tabIndex: 0,
|
|
641
641
|
"aria-label": "close",
|
|
642
642
|
size: r,
|
|
@@ -667,10 +667,10 @@ var Y = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medi
|
|
|
667
667
|
})
|
|
668
668
|
});
|
|
669
669
|
};
|
|
670
|
-
|
|
670
|
+
ye.displayName = "PktAlert";
|
|
671
671
|
//#endregion
|
|
672
672
|
//#region src/components/backlink/BackLink.tsx
|
|
673
|
-
var
|
|
673
|
+
var be = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, className: i, strings: a, ...o }, s) => {
|
|
674
674
|
let c = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(I, {
|
|
675
675
|
className: "pkt-back-link__icon pkt-icon pkt-link__icon",
|
|
676
676
|
name: "chevron-thin-left",
|
|
@@ -683,7 +683,7 @@ var X = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, c
|
|
|
683
683
|
className: t,
|
|
684
684
|
...r,
|
|
685
685
|
children: n
|
|
686
|
-
})), u =
|
|
686
|
+
})), u = ve(["backlink"], a), d = ["pkt-back-link", i].filter(Boolean).join(" ");
|
|
687
687
|
return /* @__PURE__ */ _("nav", {
|
|
688
688
|
className: d,
|
|
689
689
|
"aria-label": n ?? u.backlink.label,
|
|
@@ -696,11 +696,11 @@ var X = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, c
|
|
|
696
696
|
})
|
|
697
697
|
});
|
|
698
698
|
});
|
|
699
|
-
|
|
699
|
+
be.displayName = "PktBackLink";
|
|
700
700
|
//#endregion
|
|
701
701
|
//#region src/components/breadcrumbs/Breadcrumbs.tsx
|
|
702
702
|
var Z = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, strings: i, ...a }, o) => {
|
|
703
|
-
let s = e, c = s[s.length - 2], l =
|
|
703
|
+
let s = e, c = s[s.length - 2], l = ve(["breadcrumbs"], i), u = [r, "pkt-breadcrumbs"].filter(Boolean).join(" "), d = n || (t === "router" ? ({ href: e, className: t, children: n, props: r }) => /* @__PURE__ */ _(y, {
|
|
704
704
|
to: e,
|
|
705
705
|
className: t,
|
|
706
706
|
...r,
|
|
@@ -768,49 +768,49 @@ function Te(e, t) {
|
|
|
768
768
|
}
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region ../../node_modules/date-fns/toDate.js
|
|
771
|
-
function
|
|
771
|
+
function Ee(e, t) {
|
|
772
772
|
return Te(t || e, e);
|
|
773
773
|
}
|
|
774
774
|
//#endregion
|
|
775
775
|
//#region ../../node_modules/date-fns/addDays.js
|
|
776
|
-
function
|
|
777
|
-
let r =
|
|
776
|
+
function De(e, t, n) {
|
|
777
|
+
let r = Ee(e, n?.in);
|
|
778
778
|
return isNaN(t) ? Te(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
779
779
|
}
|
|
780
780
|
//#endregion
|
|
781
781
|
//#region ../../node_modules/date-fns/_lib/defaultOptions.js
|
|
782
|
-
var
|
|
783
|
-
function
|
|
784
|
-
return
|
|
782
|
+
var Oe = {};
|
|
783
|
+
function ke() {
|
|
784
|
+
return Oe;
|
|
785
785
|
}
|
|
786
786
|
//#endregion
|
|
787
787
|
//#region ../../node_modules/date-fns/startOfWeek.js
|
|
788
|
-
function
|
|
789
|
-
let n =
|
|
788
|
+
function Ae(e, t) {
|
|
789
|
+
let n = ke(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = Ee(e, t?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
790
790
|
return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
|
|
791
791
|
}
|
|
792
792
|
//#endregion
|
|
793
793
|
//#region ../../node_modules/date-fns/startOfISOWeek.js
|
|
794
|
-
function
|
|
795
|
-
return
|
|
794
|
+
function je(e, t) {
|
|
795
|
+
return Ae(e, {
|
|
796
796
|
...t,
|
|
797
797
|
weekStartsOn: 1
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
800
|
//#endregion
|
|
801
801
|
//#region ../../node_modules/date-fns/getISOWeekYear.js
|
|
802
|
-
function
|
|
803
|
-
let n =
|
|
802
|
+
function Me(e, t) {
|
|
803
|
+
let n = Ee(e, t?.in), r = n.getFullYear(), i = Te(n, 0);
|
|
804
804
|
i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
|
|
805
|
-
let a =
|
|
805
|
+
let a = je(i), o = Te(n, 0);
|
|
806
806
|
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
807
|
-
let s =
|
|
807
|
+
let s = je(o);
|
|
808
808
|
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
|
|
809
809
|
}
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
812
|
-
function
|
|
813
|
-
let t =
|
|
812
|
+
function $(e) {
|
|
813
|
+
let t = Ee(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
|
|
814
814
|
return n.setUTCFullYear(t.getFullYear()), e - +n;
|
|
815
815
|
}
|
|
816
816
|
//#endregion
|
|
@@ -822,20 +822,20 @@ function Ne(e, ...t) {
|
|
|
822
822
|
//#endregion
|
|
823
823
|
//#region ../../node_modules/date-fns/startOfDay.js
|
|
824
824
|
function Pe(e, t) {
|
|
825
|
-
let n =
|
|
825
|
+
let n = Ee(e, t?.in);
|
|
826
826
|
return n.setHours(0, 0, 0, 0), n;
|
|
827
827
|
}
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region ../../node_modules/date-fns/differenceInCalendarDays.js
|
|
830
830
|
function Fe(e, t, n) {
|
|
831
|
-
let [r, i] = Ne(n?.in, e, t), a = Pe(r), o = Pe(i), s = +a -
|
|
831
|
+
let [r, i] = Ne(n?.in, e, t), a = Pe(r), o = Pe(i), s = +a - $(a), c = +o - $(o);
|
|
832
832
|
return Math.round((s - c) / Se);
|
|
833
833
|
}
|
|
834
834
|
//#endregion
|
|
835
835
|
//#region ../../node_modules/date-fns/startOfISOWeekYear.js
|
|
836
836
|
function Ie(e, t) {
|
|
837
|
-
let n =
|
|
838
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
837
|
+
let n = Me(e, t), r = Te(t?.in || e, 0);
|
|
838
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), je(r);
|
|
839
839
|
}
|
|
840
840
|
//#endregion
|
|
841
841
|
//#region ../../node_modules/date-fns/isDate.js
|
|
@@ -845,12 +845,12 @@ function Le(e) {
|
|
|
845
845
|
//#endregion
|
|
846
846
|
//#region ../../node_modules/date-fns/isValid.js
|
|
847
847
|
function Re(e) {
|
|
848
|
-
return !(!Le(e) && typeof e != "number" || isNaN(
|
|
848
|
+
return !(!Le(e) && typeof e != "number" || isNaN(+Ee(e)));
|
|
849
849
|
}
|
|
850
850
|
//#endregion
|
|
851
851
|
//#region ../../node_modules/date-fns/endOfDay.js
|
|
852
852
|
function ze(e, t) {
|
|
853
|
-
let n =
|
|
853
|
+
let n = Ee(e, t?.in);
|
|
854
854
|
return n.setHours(23, 59, 59, 999), n;
|
|
855
855
|
}
|
|
856
856
|
//#endregion
|
|
@@ -877,7 +877,7 @@ function Ve(e, t) {
|
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region ../../node_modules/date-fns/startOfYear.js
|
|
879
879
|
function He(e, t) {
|
|
880
|
-
let n =
|
|
880
|
+
let n = Ee(e, t?.in);
|
|
881
881
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
882
882
|
}
|
|
883
883
|
//#endregion
|
|
@@ -1381,35 +1381,35 @@ var tt = {
|
|
|
1381
1381
|
//#endregion
|
|
1382
1382
|
//#region ../../node_modules/date-fns/getDayOfYear.js
|
|
1383
1383
|
function nt(e, t) {
|
|
1384
|
-
let n =
|
|
1384
|
+
let n = Ee(e, t?.in);
|
|
1385
1385
|
return Fe(n, He(n)) + 1;
|
|
1386
1386
|
}
|
|
1387
1387
|
//#endregion
|
|
1388
1388
|
//#region ../../node_modules/date-fns/getISOWeek.js
|
|
1389
1389
|
function rt(e, t) {
|
|
1390
|
-
let n =
|
|
1390
|
+
let n = Ee(e, t?.in), r = je(n) - +Ie(n);
|
|
1391
1391
|
return Math.round(r / xe) + 1;
|
|
1392
1392
|
}
|
|
1393
1393
|
//#endregion
|
|
1394
1394
|
//#region ../../node_modules/date-fns/getWeekYear.js
|
|
1395
1395
|
function it(e, t) {
|
|
1396
|
-
let n =
|
|
1396
|
+
let n = Ee(e, t?.in), r = n.getFullYear(), i = ke(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = Te(t?.in || e, 0);
|
|
1397
1397
|
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
1398
|
-
let s =
|
|
1398
|
+
let s = Ae(o, t), c = Te(t?.in || e, 0);
|
|
1399
1399
|
c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
|
|
1400
|
-
let l =
|
|
1400
|
+
let l = Ae(c, t);
|
|
1401
1401
|
return +n >= +s ? r + 1 : +n >= +l ? r : r - 1;
|
|
1402
1402
|
}
|
|
1403
1403
|
//#endregion
|
|
1404
1404
|
//#region ../../node_modules/date-fns/startOfWeekYear.js
|
|
1405
1405
|
function at(e, t) {
|
|
1406
|
-
let n =
|
|
1407
|
-
return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0),
|
|
1406
|
+
let n = ke(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = it(e, t), a = Te(t?.in || e, 0);
|
|
1407
|
+
return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), Ae(a, t);
|
|
1408
1408
|
}
|
|
1409
1409
|
//#endregion
|
|
1410
1410
|
//#region ../../node_modules/date-fns/getWeek.js
|
|
1411
1411
|
function ot(e, t) {
|
|
1412
|
-
let n =
|
|
1412
|
+
let n = Ee(e, t?.in), r = Ae(n, t) - +at(n, t);
|
|
1413
1413
|
return Math.round(r / xe) + 1;
|
|
1414
1414
|
}
|
|
1415
1415
|
//#endregion
|
|
@@ -1489,7 +1489,7 @@ var ct = {
|
|
|
1489
1489
|
return t === "YY" ? st(a % 100, 2) : t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : st(a, t.length);
|
|
1490
1490
|
},
|
|
1491
1491
|
R: function(e, t) {
|
|
1492
|
-
return st(
|
|
1492
|
+
return st(Me(e), t.length);
|
|
1493
1493
|
},
|
|
1494
1494
|
u: function(e, t) {
|
|
1495
1495
|
return st(e.getFullYear(), t.length);
|
|
@@ -1889,7 +1889,7 @@ function Ct(e, t, n) {
|
|
|
1889
1889
|
//#region ../../node_modules/date-fns/format.js
|
|
1890
1890
|
var wt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Tt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Et = /^'([^]*?)'?$/, Dt = /''/g, Ot = /[a-zA-Z]/;
|
|
1891
1891
|
function kt(e, t, n) {
|
|
1892
|
-
let r =
|
|
1892
|
+
let r = ke(), i = n?.locale ?? r.locale ?? tt, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = Ee(e, n?.in);
|
|
1893
1893
|
if (!Re(s)) throw RangeError("Invalid time value");
|
|
1894
1894
|
let c = t.match(Tt).map((e) => {
|
|
1895
1895
|
let t = e[0];
|
|
@@ -1939,7 +1939,7 @@ function At(e) {
|
|
|
1939
1939
|
//#endregion
|
|
1940
1940
|
//#region ../../node_modules/date-fns/getISODay.js
|
|
1941
1941
|
function jt(e, t) {
|
|
1942
|
-
let n =
|
|
1942
|
+
let n = Ee(e, t?.in).getDay();
|
|
1943
1943
|
return n === 0 ? 7 : n;
|
|
1944
1944
|
}
|
|
1945
1945
|
//#endregion
|
|
@@ -2270,10 +2270,10 @@ function On(e) {
|
|
|
2270
2270
|
return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !e.dataset?.date;
|
|
2271
2271
|
}
|
|
2272
2272
|
function kn(e, t, n) {
|
|
2273
|
-
let r =
|
|
2273
|
+
let r = De(e, t);
|
|
2274
2274
|
if (!r) return null;
|
|
2275
2275
|
let i = n(`button[data-date="${Yt(r)}"]`);
|
|
2276
|
-
for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r =
|
|
2276
|
+
for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = De(r, t), i = n(`button[data-date="${Yt(r)}"]`), !i) return null;
|
|
2277
2277
|
return r;
|
|
2278
2278
|
}
|
|
2279
2279
|
function An(e) {
|
|
@@ -2282,7 +2282,7 @@ function An(e) {
|
|
|
2282
2282
|
//#endregion
|
|
2283
2283
|
//#region src/components/calendar/useCalendarState.ts
|
|
2284
2284
|
function jn(e) {
|
|
2285
|
-
let { selected: t, multiple: n = fn.multiple, maxMultiple: r = fn.maxMultiple, range: i = fn.range, earliest: a = fn.earliest, latest: s = fn.latest, excludedates: u, excludeweekdays: d = [], weeknumbers: h = fn.weeknumbers, withcontrols: g = fn.withcontrols, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = l(), T = S ?? w, E =
|
|
2285
|
+
let { selected: t, multiple: n = fn.multiple, maxMultiple: r = fn.maxMultiple, range: i = fn.range, earliest: a = fn.earliest, latest: s = fn.latest, excludedates: u, excludeweekdays: d = [], weeknumbers: h = fn.weeknumbers, withcontrols: g = fn.withcontrols, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = l(), T = S ?? w, E = ve(["dates", "calendar"], y), D = f(() => ({
|
|
2286
2286
|
month: E.dates.month,
|
|
2287
2287
|
year: E.dates.year,
|
|
2288
2288
|
week: E.dates.week,
|
|
@@ -2291,7 +2291,7 @@ function jn(e) {
|
|
|
2291
2291
|
months: E.dates.months,
|
|
2292
2292
|
prevMonth: E.calendar.prevMonth,
|
|
2293
2293
|
nextMonth: E.calendar.nextMonth
|
|
2294
|
-
}), [E]), O = f(() => v ? Jt(v) : qt(), [v]), k = f(() => u ? u.map((e) => typeof e == "string" ? Jt(e) : e) : [], [u]), A = t !== void 0, [j, M] = m([]), N = A ? t : j, P = f(() => _n(N), [N]), [ee, te] = m(0), [ne, F] = m(0), [re, ie] = m({}), [ae, oe] = m(null), [se, ce] = m(null), I = p(null), L = p([]), le = p(0), R = p(!1), z = p(!1),
|
|
2294
|
+
}), [E]), O = f(() => v ? Jt(v) : qt(), [v]), k = f(() => u ? u.map((e) => typeof e == "string" ? Jt(e) : e) : [], [u]), A = t !== void 0, [j, M] = m([]), N = A ? t : j, P = f(() => _n(N), [N]), [ee, te] = m(0), [ne, F] = m(0), [re, ie] = m({}), [ae, oe] = m(null), [se, ce] = m(null), I = p(null), L = p([]), le = p(0), R = p(!1), z = p(!1), B = f(() => ({
|
|
2295
2295
|
earliest: a,
|
|
2296
2296
|
latest: s,
|
|
2297
2297
|
excludedates: k,
|
|
@@ -2327,9 +2327,9 @@ function jn(e) {
|
|
|
2327
2327
|
}, [N]), c(() => {
|
|
2328
2328
|
i && P.length === 2 ? ie(vn(P[0], P[1])) : (!i || P.length < 2) && ie({});
|
|
2329
2329
|
}, [i, P]);
|
|
2330
|
-
let
|
|
2330
|
+
let ue = o((e) => {
|
|
2331
2331
|
A || M(e), b?.(e);
|
|
2332
|
-
}, [A, b]),
|
|
2332
|
+
}, [A, b]), de = o(() => {
|
|
2333
2333
|
x?.();
|
|
2334
2334
|
}, [x]), V = o((e, t) => {
|
|
2335
2335
|
te(typeof e == "string" ? parseInt(e) : e), F(typeof t == "string" ? parseInt(t) : t), le.current = 0, ce(null), L.current = [], R.current = !0;
|
|
@@ -2340,23 +2340,23 @@ function jn(e) {
|
|
|
2340
2340
|
ee,
|
|
2341
2341
|
ne,
|
|
2342
2342
|
V
|
|
2343
|
-
]),
|
|
2343
|
+
]), U = o(() => {
|
|
2344
2344
|
let e = ne === 11 ? 0 : ne + 1, t = ne === 11 ? ee + 1 : ee;
|
|
2345
2345
|
V(t, e);
|
|
2346
2346
|
}, [
|
|
2347
2347
|
ee,
|
|
2348
2348
|
ne,
|
|
2349
2349
|
V
|
|
2350
|
-
]),
|
|
2350
|
+
]), W = o((e) => pn(e, B), [B]), G = o((e, t) => mn(e, t, B, {
|
|
2351
2351
|
multiple: n,
|
|
2352
2352
|
maxMultiple: r,
|
|
2353
2353
|
selectedCount: N.length
|
|
2354
2354
|
}), [
|
|
2355
|
-
|
|
2355
|
+
B,
|
|
2356
2356
|
n,
|
|
2357
2357
|
r,
|
|
2358
2358
|
N.length
|
|
2359
|
-
]),
|
|
2359
|
+
]), K = o(() => typeof N == "string" ? N.split(",") : N, [N]), fe = o((e) => {
|
|
2360
2360
|
if (!i || P.length !== 1 || !yn(e, P, k, d) || P[0] >= e) {
|
|
2361
2361
|
oe(null);
|
|
2362
2362
|
return;
|
|
@@ -2367,50 +2367,50 @@ function jn(e) {
|
|
|
2367
2367
|
P,
|
|
2368
2368
|
k,
|
|
2369
2369
|
d
|
|
2370
|
-
]),
|
|
2370
|
+
]), q = o((e) => {
|
|
2371
2371
|
if (!e) return;
|
|
2372
2372
|
let t;
|
|
2373
|
-
if (i) t = Cn(e,
|
|
2373
|
+
if (i) t = Cn(e, K(), {
|
|
2374
2374
|
excludedates: k,
|
|
2375
2375
|
excludeweekdays: d
|
|
2376
|
-
}), A || M(t), t.length === 2 ? (b?.(t),
|
|
2377
|
-
else if (n) t = Sn(e,
|
|
2376
|
+
}), A || M(t), t.length === 2 ? (b?.(t), de()) : (t.length === 1 && ie({}), b?.(t));
|
|
2377
|
+
else if (n) t = Sn(e, K(), r), ue(t);
|
|
2378
2378
|
else {
|
|
2379
2379
|
let n = Yt(e);
|
|
2380
|
-
t = N.includes(n) ? [] : [n],
|
|
2380
|
+
t = N.includes(n) ? [] : [n], ue(t), de();
|
|
2381
2381
|
}
|
|
2382
2382
|
}, [
|
|
2383
2383
|
i,
|
|
2384
2384
|
n,
|
|
2385
2385
|
r,
|
|
2386
|
-
|
|
2386
|
+
K,
|
|
2387
2387
|
N,
|
|
2388
2388
|
k,
|
|
2389
2389
|
d,
|
|
2390
2390
|
A,
|
|
2391
|
+
ue,
|
|
2391
2392
|
de,
|
|
2392
|
-
B,
|
|
2393
2393
|
b
|
|
2394
|
-
]),
|
|
2395
|
-
let t = bn(e,
|
|
2396
|
-
A || M(t), i && t.length === 2 && (b?.(t),
|
|
2394
|
+
]), pe = o((e) => {
|
|
2395
|
+
let t = bn(e, K());
|
|
2396
|
+
A || M(t), i && t.length === 2 && (b?.(t), de());
|
|
2397
2397
|
}, [
|
|
2398
|
-
|
|
2398
|
+
K,
|
|
2399
2399
|
A,
|
|
2400
2400
|
i,
|
|
2401
2401
|
b,
|
|
2402
|
-
|
|
2403
|
-
]),
|
|
2404
|
-
let t = xn(e,
|
|
2402
|
+
de
|
|
2403
|
+
]), me = o((e) => {
|
|
2404
|
+
let t = xn(e, K());
|
|
2405
2405
|
A || M(t);
|
|
2406
|
-
}, [
|
|
2407
|
-
let t = Sn(e,
|
|
2406
|
+
}, [K, A]), he = o((e) => {
|
|
2407
|
+
let t = Sn(e, K(), r);
|
|
2408
2408
|
A || M(t);
|
|
2409
2409
|
}, [
|
|
2410
|
-
|
|
2410
|
+
K,
|
|
2411
2411
|
r,
|
|
2412
2412
|
A
|
|
2413
|
-
]),
|
|
2413
|
+
]), J = o(() => {
|
|
2414
2414
|
let e = Yt(en(O)), t = I.current?.querySelector(`button[data-date="${e}"]`);
|
|
2415
2415
|
if (t instanceof HTMLButtonElement) {
|
|
2416
2416
|
ce(e), t.focus();
|
|
@@ -2421,11 +2421,11 @@ function jn(e) {
|
|
|
2421
2421
|
let e = I.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);
|
|
2422
2422
|
e instanceof HTMLButtonElement && (ce(n.currentDateISO), e.focus());
|
|
2423
2423
|
}
|
|
2424
|
-
}, []),
|
|
2424
|
+
}, []), ge = o((e, t) => {
|
|
2425
2425
|
let n = e.target;
|
|
2426
2426
|
if (On(n)) return;
|
|
2427
2427
|
if (e.preventDefault(), !se) {
|
|
2428
|
-
|
|
2428
|
+
J();
|
|
2429
2429
|
return;
|
|
2430
2430
|
}
|
|
2431
2431
|
let r = kn(Qt(se), t, I.current.querySelector.bind(I.current));
|
|
@@ -2433,7 +2433,7 @@ function jn(e) {
|
|
|
2433
2433
|
let e = I.current.querySelector(`button[data-date="${Yt(r)}"]`);
|
|
2434
2434
|
e instanceof HTMLButtonElement && !e.dataset.disabled && (ce(Yt(r)), e.focus());
|
|
2435
2435
|
}
|
|
2436
|
-
}, [se,
|
|
2436
|
+
}, [se, J]);
|
|
2437
2437
|
return {
|
|
2438
2438
|
componentId: T,
|
|
2439
2439
|
strings: D,
|
|
@@ -2454,34 +2454,34 @@ function jn(e) {
|
|
|
2454
2454
|
excludedates: k,
|
|
2455
2455
|
excludeweekdays: d,
|
|
2456
2456
|
className: C,
|
|
2457
|
-
dateConstraints:
|
|
2457
|
+
dateConstraints: B,
|
|
2458
2458
|
calendarRef: I,
|
|
2459
2459
|
selectableDatesRef: L,
|
|
2460
2460
|
tabIndexSetRef: le,
|
|
2461
2461
|
prevMonth: H,
|
|
2462
|
-
nextMonth:
|
|
2462
|
+
nextMonth: U,
|
|
2463
2463
|
changeMonth: V,
|
|
2464
|
-
handleDateSelect:
|
|
2465
|
-
addToSelected:
|
|
2466
|
-
removeFromSelected:
|
|
2467
|
-
toggleSelectedDate:
|
|
2468
|
-
handleRangeHover:
|
|
2469
|
-
isExcluded:
|
|
2470
|
-
isDayDisabled:
|
|
2471
|
-
focusOnCurrentDate:
|
|
2464
|
+
handleDateSelect: q,
|
|
2465
|
+
addToSelected: pe,
|
|
2466
|
+
removeFromSelected: me,
|
|
2467
|
+
toggleSelectedDate: he,
|
|
2468
|
+
handleRangeHover: fe,
|
|
2469
|
+
isExcluded: W,
|
|
2470
|
+
isDayDisabled: G,
|
|
2471
|
+
focusOnCurrentDate: J,
|
|
2472
2472
|
handleKeydown: o((e) => {
|
|
2473
2473
|
if (e.key === "Escape") {
|
|
2474
|
-
e.preventDefault(),
|
|
2474
|
+
e.preventDefault(), de();
|
|
2475
2475
|
return;
|
|
2476
2476
|
}
|
|
2477
2477
|
let t = An(e.key);
|
|
2478
|
-
t !== null &&
|
|
2479
|
-
}, [
|
|
2478
|
+
t !== null && ge(e.nativeEvent, t);
|
|
2479
|
+
}, [de, ge]),
|
|
2480
2480
|
handleFocusOut: o((e) => {
|
|
2481
2481
|
let t = e.target, n = e.relatedTarget;
|
|
2482
|
-
I.current && I.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") ||
|
|
2483
|
-
}, [
|
|
2484
|
-
close:
|
|
2482
|
+
I.current && I.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || de();
|
|
2483
|
+
}, [de]),
|
|
2484
|
+
close: de,
|
|
2485
2485
|
setFocusedDate: ce
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
@@ -2809,7 +2809,7 @@ var Wn = i(({ children: e, skin: t = "blue", textStyle: n, size: r = "medium", c
|
|
|
2809
2809
|
c(() => {
|
|
2810
2810
|
E(w.current?.textContent?.trim() ?? "");
|
|
2811
2811
|
}, [e]);
|
|
2812
|
-
let D =
|
|
2812
|
+
let D = ve(["tag"], g), O = f(() => {
|
|
2813
2813
|
if (i && !l) return T && z(D.tag.remove, { label: T }) || h;
|
|
2814
2814
|
}, [
|
|
2815
2815
|
i,
|
|
@@ -2969,7 +2969,7 @@ function Jn(e) {
|
|
|
2969
2969
|
//#endregion
|
|
2970
2970
|
//#region src/components/checkbox/Checkbox.tsx
|
|
2971
2971
|
var Yn = i(({ id: e, hasTile: t = !1, disabled: n = !1, label: r, checkHelptext: i, hasError: a = !1, className: o, isSwitch: s = !1, hideLabel: l = !1, labelPosition: u = "right", defaultChecked: d, checked: f, indeterminate: m, optionalTag: h, optionalText: y, requiredTag: b, requiredText: x, strings: S, tagText: C, "aria-describedby": w, ...T }, E) => {
|
|
2972
|
-
let D =
|
|
2972
|
+
let D = ve(["forms"], S), O = Jn(e), k = p(null);
|
|
2973
2973
|
c(() => {
|
|
2974
2974
|
k.current && m !== void 0 && (k.current.indeterminate = m);
|
|
2975
2975
|
}, [m]), c(() => {
|
|
@@ -3116,7 +3116,7 @@ nr.displayName = "PktHelptext";
|
|
|
3116
3116
|
//#endregion
|
|
3117
3117
|
//#region src/components/inputwrapper/InputWrapper.tsx
|
|
3118
3118
|
var rr = 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) => {
|
|
3119
|
-
let j = Xn(A), M =
|
|
3119
|
+
let j = Xn(A), M = ve(["forms", "validation"], k), N = f(() => qn(), []), P = e || N, ee = x || (n ? `${P}-helptext` : void 0), te = !!a, ne = te && D === "top", F = te && D === "bottom", re = [
|
|
3120
3120
|
"pkt-inputwrapper",
|
|
3121
3121
|
w,
|
|
3122
3122
|
m ? "pkt-inputwrapper--error" : "",
|
|
@@ -3189,7 +3189,7 @@ var rr = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3189
3189
|
F && /* @__PURE__ */ _(oe, {}),
|
|
3190
3190
|
m && h && /* @__PURE__ */ _("div", {
|
|
3191
3191
|
className: "pkt-inputwrapper__alert-wrapper",
|
|
3192
|
-
children: /* @__PURE__ */ _(
|
|
3192
|
+
children: /* @__PURE__ */ _(ye, {
|
|
3193
3193
|
skin: "error",
|
|
3194
3194
|
size: L,
|
|
3195
3195
|
"aria-live": "assertive",
|
|
@@ -3413,8 +3413,13 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3413
3413
|
o && "pkt-combobox__input--open",
|
|
3414
3414
|
m && "pkt-combobox__input--error",
|
|
3415
3415
|
f && "pkt-combobox__input--disabled"
|
|
3416
|
-
].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] && ir(a, i[0]) ? `${r}-${ar(a, i[0])}` : void 0, F = s && i.length > 0 ? `${i.length} valgt` : void 0, re =
|
|
3416
|
+
].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] && ir(a, i[0]) ? `${r}-${ar(a, i[0])}` : void 0, F = s && i.length > 0 ? `${i.length} valgt` : void 0, re = Zn({
|
|
3417
|
+
id: P ? n : `${t}-combobox`,
|
|
3418
|
+
hasHelptext: !!e.helptext,
|
|
3419
|
+
ariaDescribedby: e.ariaDescribedby
|
|
3420
|
+
}), ie = P ? { tabIndex: -1 } : {
|
|
3417
3421
|
id: `${t}-combobox`,
|
|
3422
|
+
"aria-describedby": re,
|
|
3418
3423
|
role: "combobox",
|
|
3419
3424
|
"aria-expanded": o ? "true" : "false",
|
|
3420
3425
|
"aria-controls": r,
|
|
@@ -3432,7 +3437,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3432
3437
|
onBlur: (e) => {
|
|
3433
3438
|
e.target === e.currentTarget && b();
|
|
3434
3439
|
},
|
|
3435
|
-
...
|
|
3440
|
+
...ie,
|
|
3436
3441
|
children: [
|
|
3437
3442
|
ee ? /* @__PURE__ */ _("span", {
|
|
3438
3443
|
className: "pkt-combobox__placeholder",
|
|
@@ -3460,6 +3465,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3460
3465
|
"aria-controls": r,
|
|
3461
3466
|
"aria-activedescendant": ne,
|
|
3462
3467
|
"aria-description": F,
|
|
3468
|
+
"aria-describedby": re,
|
|
3463
3469
|
disabled: f
|
|
3464
3470
|
})
|
|
3465
3471
|
}) : /* @__PURE__ */ _("input", {
|
|
@@ -3477,7 +3483,7 @@ var ir = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3477
3483
|
]
|
|
3478
3484
|
});
|
|
3479
3485
|
}, Tr = ({ state: e }) => {
|
|
3480
|
-
let t =
|
|
3486
|
+
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 = [
|
|
3481
3487
|
"pkt-listbox",
|
|
3482
3488
|
i && "pkt-listbox__open",
|
|
3483
3489
|
"pkt-txt-16-light"
|
|
@@ -3636,15 +3642,15 @@ function Dr(e, t) {
|
|
|
3636
3642
|
}));
|
|
3637
3643
|
}
|
|
3638
3644
|
function Or(t, n) {
|
|
3639
|
-
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,
|
|
3640
|
-
|
|
3641
|
-
}, [
|
|
3642
|
-
|
|
3643
|
-
let e =
|
|
3644
|
-
e && e.type !== "hidden" && e.setAttribute("tabindex", "-1"),
|
|
3645
|
+
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: ce, className: I, onChange: L, onValueChange: le, children: R, strings: B } = 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 = Er(K, se), q = o(() => {
|
|
3646
|
+
V ? H.current?.focus() : W.current?.focus();
|
|
3647
|
+
}, [V]), pe = o(() => {
|
|
3648
|
+
Pe(!0);
|
|
3649
|
+
let e = H.current;
|
|
3650
|
+
e && e.type !== "hidden" && e.setAttribute("tabindex", "-1"), W.current?.focus();
|
|
3645
3651
|
}, []), me = f(() => {
|
|
3646
3652
|
let t = [];
|
|
3647
|
-
return e.forEach(
|
|
3653
|
+
return e.forEach(R, (e) => {
|
|
3648
3654
|
if (a(e) && e.type === "option") {
|
|
3649
3655
|
let n = e.props;
|
|
3650
3656
|
t.push({
|
|
@@ -3655,7 +3661,7 @@ function Or(t, n) {
|
|
|
3655
3661
|
});
|
|
3656
3662
|
}
|
|
3657
3663
|
}), t;
|
|
3658
|
-
}, [
|
|
3664
|
+
}, [R]), he = f(() => h && h.length > 0 ? h.map((e) => ({
|
|
3659
3665
|
...e,
|
|
3660
3666
|
fulltext: sr(e)
|
|
3661
3667
|
})) : d && d.length > 0 ? d.map((e) => ({
|
|
@@ -3668,80 +3674,80 @@ function Or(t, n) {
|
|
|
3668
3674
|
h,
|
|
3669
3675
|
d,
|
|
3670
3676
|
me
|
|
3671
|
-
]),
|
|
3677
|
+
]), J = s !== void 0, [ge, Y] = m(() => {
|
|
3672
3678
|
let e = ur(s ?? l, g), t = he.filter((t) => t.selected && !e.includes(t.value)).map((e) => e.value);
|
|
3673
3679
|
return t.length ? g ? [...e, ...t] : e.length ? e : [t[0]] : e;
|
|
3674
|
-
}),
|
|
3680
|
+
}), _e = p(ge);
|
|
3675
3681
|
c(() => {
|
|
3676
|
-
|
|
3682
|
+
J && Y(ur(s, g));
|
|
3677
3683
|
}, [
|
|
3678
3684
|
s,
|
|
3679
|
-
|
|
3685
|
+
J,
|
|
3680
3686
|
g
|
|
3681
3687
|
]);
|
|
3682
|
-
let
|
|
3688
|
+
let X = J ? ur(s, g) : ge, [ye, be] = m([]), Z = f(() => Dr([...ye.filter((e) => !he.some((t) => t.value === e.value)), ...he], X), [
|
|
3683
3689
|
he,
|
|
3684
3690
|
ye,
|
|
3685
|
-
|
|
3686
|
-
]), [
|
|
3687
|
-
|
|
3688
|
-
|
|
3691
|
+
X
|
|
3692
|
+
]), [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"], B), Ve = Ee ? z(Be.combobox[Ee], { value: Oe ?? "" }) : "", He = cr(X.length, _ ?? null), Ue = ie ?? (g && _ != null), We = f(() => Se ? v ? dr(Z, Se).filtered : or(Z, Se) : Z, [
|
|
3693
|
+
Z,
|
|
3694
|
+
Se,
|
|
3689
3695
|
v
|
|
3690
|
-
]),
|
|
3691
|
-
let t =
|
|
3692
|
-
if (!t || !
|
|
3696
|
+
]), Ge = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Ke = o((e) => {
|
|
3697
|
+
let t = U.current;
|
|
3698
|
+
if (!t || !Ge) return;
|
|
3693
3699
|
let n = g ? e.join(",") : e[0] || "";
|
|
3694
|
-
|
|
3695
|
-
}, [
|
|
3700
|
+
Ge.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3701
|
+
}, [Ge, g]), qe = g ? X.join(",") : X[0] || "";
|
|
3696
3702
|
c(() => {
|
|
3697
|
-
|
|
3698
|
-
}, [
|
|
3699
|
-
if (
|
|
3700
|
-
let e = !g &&
|
|
3701
|
-
|
|
3703
|
+
U.current && (U.current.value = qe);
|
|
3704
|
+
}, [qe]), c(() => {
|
|
3705
|
+
if (Q || !H.current) return;
|
|
3706
|
+
let e = !g && X[0] ? hr(X[0], Z, x) : "";
|
|
3707
|
+
H.current.value !== e && (H.current.value = e);
|
|
3702
3708
|
}, [
|
|
3703
|
-
J,
|
|
3704
3709
|
X,
|
|
3710
|
+
Z,
|
|
3705
3711
|
x,
|
|
3706
3712
|
g,
|
|
3707
|
-
|
|
3713
|
+
Q
|
|
3708
3714
|
]);
|
|
3709
|
-
let
|
|
3710
|
-
|
|
3715
|
+
let Je = o((e, t = !0) => {
|
|
3716
|
+
J || Y(e), t && (le?.(e), Ke(e));
|
|
3711
3717
|
}, [
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
]),
|
|
3716
|
-
if (!e ||
|
|
3717
|
-
if (g && cr(
|
|
3718
|
-
|
|
3718
|
+
J,
|
|
3719
|
+
le,
|
|
3720
|
+
Ke
|
|
3721
|
+
]), Ye = o((e) => {
|
|
3722
|
+
if (!e || X.includes(e)) return;
|
|
3723
|
+
if (g && cr(X.length, _ ?? null)) {
|
|
3724
|
+
De("maxSelected");
|
|
3719
3725
|
return;
|
|
3720
3726
|
}
|
|
3721
|
-
let t = g ? [...
|
|
3722
|
-
|
|
3727
|
+
let t = g ? [...X, e] : [e];
|
|
3728
|
+
Je(t);
|
|
3723
3729
|
}, [
|
|
3724
|
-
|
|
3730
|
+
X,
|
|
3725
3731
|
g,
|
|
3726
3732
|
_,
|
|
3727
|
-
|
|
3728
|
-
]),
|
|
3733
|
+
Je
|
|
3734
|
+
]), Xe = o((e) => {
|
|
3729
3735
|
if (!e) return;
|
|
3730
|
-
let t =
|
|
3731
|
-
ir(
|
|
3736
|
+
let t = X.filter((t) => t !== e);
|
|
3737
|
+
ir(Z, e)?.userAdded && be((t) => t.filter((t) => t.value !== e)), Je(t);
|
|
3732
3738
|
}, [
|
|
3733
|
-
J,
|
|
3734
3739
|
X,
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3740
|
+
Z,
|
|
3741
|
+
Je
|
|
3742
|
+
]), Ze = o(() => {
|
|
3743
|
+
be([]), Je([]);
|
|
3744
|
+
}, [Je]), Qe = o((e) => {
|
|
3739
3745
|
if (!e || e.trim() === "") return;
|
|
3740
3746
|
let t;
|
|
3741
3747
|
if (!g) t = [e];
|
|
3742
3748
|
else {
|
|
3743
|
-
if (ir(
|
|
3744
|
-
t = [...
|
|
3749
|
+
if (ir(Z, e) || cr(X.length, _ ?? null)) return;
|
|
3750
|
+
t = [...X, e];
|
|
3745
3751
|
}
|
|
3746
3752
|
let n = {
|
|
3747
3753
|
value: e,
|
|
@@ -3749,398 +3755,398 @@ function Or(t, n) {
|
|
|
3749
3755
|
userAdded: !0,
|
|
3750
3756
|
selected: !0
|
|
3751
3757
|
};
|
|
3752
|
-
|
|
3758
|
+
be((t) => [n, ...t.filter((t) => t.value !== e)]), Je(t);
|
|
3753
3759
|
}, [
|
|
3754
3760
|
g,
|
|
3761
|
+
Z,
|
|
3755
3762
|
X,
|
|
3756
|
-
J,
|
|
3757
3763
|
_,
|
|
3758
|
-
|
|
3759
|
-
]),
|
|
3760
|
-
if (
|
|
3761
|
-
|
|
3762
|
-
let e = t === void 0 ?
|
|
3763
|
-
!g && e ?
|
|
3764
|
+
Je
|
|
3765
|
+
]), $e = o((e = !0, t) => {
|
|
3766
|
+
if (je(null), e && H.current && H.current.type !== "hidden") {
|
|
3767
|
+
Ce(""), Te("");
|
|
3768
|
+
let e = t === void 0 ? X[0] : t;
|
|
3769
|
+
!g && e ? H.current.value = hr(e, Z, x) : H.current.value = "", g || (Le(!1), De(""));
|
|
3764
3770
|
}
|
|
3765
3771
|
}, [
|
|
3766
3772
|
g,
|
|
3767
|
-
J,
|
|
3768
3773
|
X,
|
|
3774
|
+
Z,
|
|
3769
3775
|
x
|
|
3770
|
-
]),
|
|
3776
|
+
]), et = o((e) => {
|
|
3771
3777
|
if (T) return;
|
|
3772
|
-
|
|
3773
|
-
let t = ir(
|
|
3774
|
-
i || (!r && b && !a ? (
|
|
3775
|
-
|
|
3778
|
+
De(""), je(null);
|
|
3779
|
+
let t = ir(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 = cr(X.length, _ ?? null), l = !1, u = !0, d = "", f = null, p = "", m;
|
|
3780
|
+
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 ? hr(t || "", Z, x) : lr(ir(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(() => {
|
|
3781
|
+
pe();
|
|
3776
3782
|
}, 0));
|
|
3777
3783
|
}, [
|
|
3778
3784
|
T,
|
|
3785
|
+
Z,
|
|
3779
3786
|
X,
|
|
3780
|
-
J,
|
|
3781
3787
|
g,
|
|
3782
3788
|
_,
|
|
3783
3789
|
b,
|
|
3790
|
+
Qe,
|
|
3791
|
+
Xe,
|
|
3784
3792
|
Ze,
|
|
3785
3793
|
Ye,
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
K,
|
|
3790
|
-
B,
|
|
3794
|
+
$e,
|
|
3795
|
+
pe,
|
|
3796
|
+
V,
|
|
3791
3797
|
x
|
|
3792
|
-
]),
|
|
3793
|
-
if (
|
|
3794
|
-
let e =
|
|
3798
|
+
]), tt = o(() => {
|
|
3799
|
+
if ($(!1), je(null), De(""), Ce(""), H.current && H.current.type !== "hidden") {
|
|
3800
|
+
let e = H.current.value, t = X[0];
|
|
3795
3801
|
if (!g) {
|
|
3796
|
-
if (!e)
|
|
3802
|
+
if (!e) X[0] && Xe(X[0]), t = void 0;
|
|
3797
3803
|
else {
|
|
3798
|
-
let n = ir(
|
|
3799
|
-
n && n.value !==
|
|
3804
|
+
let n = ir(Z, e);
|
|
3805
|
+
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);
|
|
3800
3806
|
}
|
|
3801
3807
|
} else if (e !== "") {
|
|
3802
|
-
let { action: t, value: n } = mr(e,
|
|
3808
|
+
let { action: t, value: n } = mr(e, X, Z, b, g);
|
|
3803
3809
|
switch (t) {
|
|
3804
3810
|
case "addUserValue":
|
|
3805
|
-
|
|
3811
|
+
Qe(n);
|
|
3806
3812
|
break;
|
|
3807
3813
|
case "selectOption":
|
|
3808
|
-
|
|
3814
|
+
Ye(n);
|
|
3809
3815
|
break;
|
|
3810
|
-
case "removeValue":
|
|
3816
|
+
case "removeValue": Xe(n);
|
|
3811
3817
|
}
|
|
3812
3818
|
}
|
|
3813
|
-
!g && t ?
|
|
3819
|
+
!g && t ? H.current.value = hr(t, Z, x) : H.current.value = "";
|
|
3814
3820
|
}
|
|
3815
|
-
|
|
3821
|
+
xe(!1), Le(!1);
|
|
3816
3822
|
}, [
|
|
3817
|
-
J,
|
|
3818
3823
|
X,
|
|
3824
|
+
Z,
|
|
3819
3825
|
b,
|
|
3820
3826
|
g,
|
|
3821
3827
|
x,
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
]),
|
|
3828
|
+
Qe,
|
|
3829
|
+
Ye,
|
|
3830
|
+
Xe
|
|
3831
|
+
]), nt = o((e) => {
|
|
3826
3832
|
if (!e.trim().toLowerCase()) {
|
|
3827
|
-
|
|
3833
|
+
je(null), De(""), !g && X[0] && Xe(X[0]);
|
|
3828
3834
|
return;
|
|
3829
3835
|
}
|
|
3830
|
-
let t = fr(e,
|
|
3831
|
-
|
|
3836
|
+
let t = fr(e, X, Z, b);
|
|
3837
|
+
je(t.addValueText), De(t.userInfoMessage);
|
|
3832
3838
|
}, [
|
|
3833
|
-
J,
|
|
3834
3839
|
X,
|
|
3840
|
+
Z,
|
|
3835
3841
|
b,
|
|
3836
3842
|
g,
|
|
3837
|
-
|
|
3838
|
-
]),
|
|
3843
|
+
Xe
|
|
3844
|
+
]), rt = o((e) => {
|
|
3839
3845
|
if (T) return;
|
|
3840
3846
|
let t = e.target.value;
|
|
3841
|
-
if (
|
|
3842
|
-
let { suggestion: n } = dr(
|
|
3843
|
-
n?.label &&
|
|
3847
|
+
if (Te(t), Ce(t), nt(t), v && t) {
|
|
3848
|
+
let { suggestion: n } = dr(Z, t);
|
|
3849
|
+
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));
|
|
3844
3850
|
}
|
|
3845
3851
|
}, [
|
|
3846
3852
|
T,
|
|
3847
3853
|
v,
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
]),
|
|
3854
|
+
Z,
|
|
3855
|
+
nt
|
|
3856
|
+
]), it = o((e) => {
|
|
3851
3857
|
if (e.key === "Backspace") {
|
|
3852
|
-
let t = !
|
|
3853
|
-
if (!
|
|
3858
|
+
let t = !H.current?.value;
|
|
3859
|
+
if (!Se && t && g && X.length > 0) {
|
|
3854
3860
|
e.preventDefault();
|
|
3855
|
-
let t =
|
|
3856
|
-
|
|
3861
|
+
let t = X[X.length - 1];
|
|
3862
|
+
Xe(t);
|
|
3857
3863
|
}
|
|
3858
3864
|
return;
|
|
3859
3865
|
}
|
|
3860
|
-
if (e.key === "ArrowLeft" && g &&
|
|
3861
|
-
e.preventDefault(),
|
|
3866
|
+
if (e.key === "ArrowLeft" && g && X.length > 0 && (H.current?.selectionStart ?? 0) === 0 && !H.current?.value) {
|
|
3867
|
+
e.preventDefault(), ze(X.length - 1);
|
|
3862
3868
|
return;
|
|
3863
3869
|
}
|
|
3864
3870
|
let t = pr(e.key, e.shiftKey, g);
|
|
3865
|
-
if (t && !(e.key === "Tab" && !
|
|
3866
|
-
if (t === "focusListbox" && e.key === "Tab" && !
|
|
3867
|
-
|
|
3871
|
+
if (t && !(e.key === "Tab" && !Q)) {
|
|
3872
|
+
if (t === "focusListbox" && e.key === "Tab" && !G.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
|
|
3873
|
+
tt();
|
|
3868
3874
|
return;
|
|
3869
3875
|
}
|
|
3870
3876
|
switch (e.preventDefault(), t) {
|
|
3871
3877
|
case "addValue": {
|
|
3872
|
-
let e =
|
|
3873
|
-
if (
|
|
3874
|
-
|
|
3878
|
+
let e = H.current?.value.trim() || "";
|
|
3879
|
+
if (Ce(e), e && X.includes(e)) {
|
|
3880
|
+
$e(!0), De("alreadySelected");
|
|
3875
3881
|
break;
|
|
3876
3882
|
}
|
|
3877
|
-
|
|
3883
|
+
et(e);
|
|
3878
3884
|
break;
|
|
3879
3885
|
}
|
|
3880
3886
|
case "focusListbox":
|
|
3881
|
-
|
|
3887
|
+
G.current && (Q || xe(!0), xr(G.current, {
|
|
3882
3888
|
disabled: T,
|
|
3883
3889
|
allowUserInput: b,
|
|
3884
|
-
customUserInput:
|
|
3890
|
+
customUserInput: Ae,
|
|
3885
3891
|
includeSearch: y
|
|
3886
3892
|
}));
|
|
3887
3893
|
break;
|
|
3888
|
-
case "closeOptions":
|
|
3894
|
+
case "closeOptions": xe(!1);
|
|
3889
3895
|
}
|
|
3890
3896
|
}
|
|
3891
3897
|
}, [
|
|
3892
|
-
|
|
3893
|
-
|
|
3898
|
+
Se,
|
|
3899
|
+
X,
|
|
3894
3900
|
g,
|
|
3895
3901
|
T,
|
|
3896
3902
|
b,
|
|
3897
|
-
|
|
3903
|
+
Ae,
|
|
3898
3904
|
y,
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
]),
|
|
3905
|
+
Q,
|
|
3906
|
+
Xe,
|
|
3907
|
+
et,
|
|
3908
|
+
q
|
|
3909
|
+
]), at = o(() => {
|
|
3904
3910
|
if (!T) {
|
|
3905
|
-
if (
|
|
3906
|
-
|
|
3911
|
+
if (Pe(!1), Fe.current) {
|
|
3912
|
+
Fe.current = !1, $(!0);
|
|
3907
3913
|
return;
|
|
3908
3914
|
}
|
|
3909
|
-
!g &&
|
|
3915
|
+
!g && X[0] && H.current && H.current.type !== "hidden" && (Le(!0), H.current.value = hr(X[0], Z, x)), $(!0), Ce(""), xe(!0);
|
|
3910
3916
|
}
|
|
3911
3917
|
}, [
|
|
3912
3918
|
T,
|
|
3913
3919
|
g,
|
|
3914
|
-
J,
|
|
3915
3920
|
X,
|
|
3921
|
+
Z,
|
|
3916
3922
|
x
|
|
3917
|
-
]),
|
|
3918
|
-
|
|
3919
|
-
}, []),
|
|
3920
|
-
if (T || !
|
|
3921
|
-
let t = e.relatedTarget, n =
|
|
3922
|
-
n && t && n.contains(t) ||
|
|
3923
|
+
]), ot = o(() => {
|
|
3924
|
+
$(!1), Le(!1);
|
|
3925
|
+
}, []), st = o((e) => {
|
|
3926
|
+
if (T || !Q) return;
|
|
3927
|
+
let t = e.relatedTarget, n = K.current;
|
|
3928
|
+
n && t && n.contains(t) || tt();
|
|
3923
3929
|
}, [
|
|
3924
3930
|
T,
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
]),
|
|
3931
|
+
Q,
|
|
3932
|
+
tt
|
|
3933
|
+
]), ct = o((e) => {
|
|
3928
3934
|
if (T) {
|
|
3929
3935
|
e.preventDefault(), e.stopPropagation();
|
|
3930
3936
|
return;
|
|
3931
3937
|
}
|
|
3932
|
-
if (
|
|
3938
|
+
if (V) H.current?.focus();
|
|
3933
3939
|
else {
|
|
3934
3940
|
e.stopPropagation(), e.preventDefault();
|
|
3935
|
-
let t = !
|
|
3936
|
-
|
|
3941
|
+
let t = !Q;
|
|
3942
|
+
xe(t), t && G.current && xr(G.current, {
|
|
3937
3943
|
disabled: T,
|
|
3938
3944
|
allowUserInput: b,
|
|
3939
|
-
customUserInput:
|
|
3945
|
+
customUserInput: Ae,
|
|
3940
3946
|
includeSearch: y
|
|
3941
3947
|
});
|
|
3942
3948
|
}
|
|
3943
3949
|
}, [
|
|
3944
3950
|
T,
|
|
3945
|
-
|
|
3946
|
-
|
|
3951
|
+
V,
|
|
3952
|
+
Q,
|
|
3947
3953
|
b,
|
|
3948
|
-
|
|
3954
|
+
Ae,
|
|
3949
3955
|
y
|
|
3950
|
-
]),
|
|
3951
|
-
T || (e.stopPropagation(),
|
|
3952
|
-
}, [T,
|
|
3956
|
+
]), lt = o((e) => {
|
|
3957
|
+
T || (e.stopPropagation(), V && H.current ? (H.current.focus(), $(!0)) : xe((e) => !e));
|
|
3958
|
+
}, [T, V]), ut = o((e) => {
|
|
3953
3959
|
if (!T) switch (e.key) {
|
|
3954
3960
|
case "Enter":
|
|
3955
3961
|
case " ":
|
|
3956
3962
|
case "ArrowDown":
|
|
3957
3963
|
case "ArrowUp":
|
|
3958
|
-
e.preventDefault(),
|
|
3959
|
-
|
|
3964
|
+
e.preventDefault(), Q ? xe(!1) : (xe(!0), G.current && window.setTimeout(() => {
|
|
3965
|
+
G.current && xr(G.current, {
|
|
3960
3966
|
disabled: T,
|
|
3961
|
-
allowUserInput: b && !
|
|
3962
|
-
customUserInput:
|
|
3967
|
+
allowUserInput: b && !He,
|
|
3968
|
+
customUserInput: Ae,
|
|
3963
3969
|
includeSearch: y
|
|
3964
3970
|
});
|
|
3965
3971
|
}, 0));
|
|
3966
3972
|
break;
|
|
3967
3973
|
case "Escape":
|
|
3968
|
-
|
|
3974
|
+
Q && (e.preventDefault(), xe(!1));
|
|
3969
3975
|
break;
|
|
3970
3976
|
case "Home":
|
|
3971
3977
|
case "End":
|
|
3972
|
-
e.preventDefault(),
|
|
3973
|
-
|
|
3978
|
+
e.preventDefault(), Q || xe(!0), G.current && window.setTimeout(() => {
|
|
3979
|
+
G.current && xr(G.current, {
|
|
3974
3980
|
disabled: T,
|
|
3975
|
-
allowUserInput: b && !
|
|
3976
|
-
customUserInput:
|
|
3981
|
+
allowUserInput: b && !He,
|
|
3982
|
+
customUserInput: Ae,
|
|
3977
3983
|
includeSearch: y
|
|
3978
3984
|
});
|
|
3979
3985
|
}, 0);
|
|
3980
3986
|
break;
|
|
3981
3987
|
case "ArrowLeft":
|
|
3982
|
-
g &&
|
|
3988
|
+
g && X.length > 0 && (e.preventDefault(), ze(X.length - 1));
|
|
3983
3989
|
break;
|
|
3984
3990
|
case "Backspace":
|
|
3985
|
-
case "Delete": if (g &&
|
|
3991
|
+
case "Delete": if (g && X.length > 0) {
|
|
3986
3992
|
e.preventDefault();
|
|
3987
|
-
let t =
|
|
3988
|
-
|
|
3993
|
+
let t = X[X.length - 1];
|
|
3994
|
+
Xe(t);
|
|
3989
3995
|
}
|
|
3990
3996
|
}
|
|
3991
3997
|
}, [
|
|
3992
3998
|
T,
|
|
3993
|
-
|
|
3999
|
+
Q,
|
|
3994
4000
|
b,
|
|
3995
|
-
|
|
3996
|
-
|
|
4001
|
+
He,
|
|
4002
|
+
Ae,
|
|
3997
4003
|
y,
|
|
3998
4004
|
g,
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
]),
|
|
4002
|
-
|
|
4003
|
-
}, [
|
|
4005
|
+
X,
|
|
4006
|
+
Xe
|
|
4007
|
+
]), dt = o((e) => {
|
|
4008
|
+
et(e);
|
|
4009
|
+
}, [et]), ft = o((e, t) => {
|
|
4004
4010
|
switch (e.key) {
|
|
4005
4011
|
case "Enter":
|
|
4006
4012
|
case " ":
|
|
4007
|
-
e.preventDefault(),
|
|
4013
|
+
e.preventDefault(), et(t);
|
|
4008
4014
|
break;
|
|
4009
4015
|
case "ArrowDown":
|
|
4010
4016
|
e.preventDefault(), vr(e.currentTarget);
|
|
4011
4017
|
break;
|
|
4012
4018
|
case "ArrowUp":
|
|
4013
|
-
e.preventDefault(),
|
|
4019
|
+
e.preventDefault(), G.current && yr(e.currentTarget, G.current, y);
|
|
4014
4020
|
break;
|
|
4015
4021
|
case "Escape":
|
|
4016
|
-
e.preventDefault(),
|
|
4022
|
+
e.preventDefault(), xe(!1), V && (Fe.current = !0), q();
|
|
4017
4023
|
break;
|
|
4018
|
-
case "Tab":
|
|
4024
|
+
case "Tab": tt();
|
|
4019
4025
|
}
|
|
4020
4026
|
}, [
|
|
4021
|
-
$e,
|
|
4022
|
-
y,
|
|
4023
|
-
pe,
|
|
4024
4027
|
et,
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4028
|
+
y,
|
|
4029
|
+
q,
|
|
4030
|
+
tt,
|
|
4031
|
+
V
|
|
4032
|
+
]), pt = o((e) => {
|
|
4033
|
+
Xe(e), ze(-1), V && H.current && ($(!0), H.current.focus());
|
|
4034
|
+
}, [Xe, V]), mt = o((e, t) => {
|
|
4029
4035
|
switch (e.stopPropagation(), e.key) {
|
|
4030
4036
|
case "ArrowLeft":
|
|
4031
|
-
e.preventDefault(), t > 0 &&
|
|
4037
|
+
e.preventDefault(), t > 0 && ze(t - 1);
|
|
4032
4038
|
break;
|
|
4033
4039
|
case "ArrowRight":
|
|
4034
|
-
e.preventDefault(), t <
|
|
4040
|
+
e.preventDefault(), t < X.length - 1 ? ze(t + 1) : (ze(-1), V && H.current ? H.current.focus() : W.current?.focus());
|
|
4035
4041
|
break;
|
|
4036
4042
|
case "Backspace":
|
|
4037
4043
|
case "Delete":
|
|
4038
4044
|
e.preventDefault();
|
|
4039
4045
|
{
|
|
4040
|
-
let e =
|
|
4041
|
-
|
|
4046
|
+
let e = X[t], n = t >= X.length - 1 ? t - 1 : t;
|
|
4047
|
+
Xe(e), n >= 0 ? ze(n) : (ze(-1), V && H.current ? H.current.focus() : W.current?.focus());
|
|
4042
4048
|
}
|
|
4043
4049
|
break;
|
|
4044
4050
|
case "Tab":
|
|
4045
|
-
|
|
4051
|
+
ze(-1);
|
|
4046
4052
|
break;
|
|
4047
|
-
case "Escape": e.preventDefault(),
|
|
4053
|
+
case "Escape": e.preventDefault(), ze(-1), V && H.current ? H.current.focus() : W.current?.focus();
|
|
4048
4054
|
}
|
|
4049
4055
|
}, [
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
]),
|
|
4054
|
-
|
|
4055
|
-
}, [
|
|
4056
|
+
X,
|
|
4057
|
+
V,
|
|
4058
|
+
Xe
|
|
4059
|
+
]), ht = o((e) => {
|
|
4060
|
+
Ce(e.target.value), nt(e.target.value);
|
|
4061
|
+
}, [nt]), gt = o((e) => {
|
|
4056
4062
|
switch (e.key) {
|
|
4057
4063
|
case "ArrowDown":
|
|
4058
|
-
e.preventDefault(),
|
|
4064
|
+
e.preventDefault(), G.current && G.current.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")?.focus();
|
|
4059
4065
|
break;
|
|
4060
4066
|
case "Tab":
|
|
4061
|
-
|
|
4067
|
+
tt();
|
|
4062
4068
|
break;
|
|
4063
|
-
case "Escape": e.preventDefault(),
|
|
4069
|
+
case "Escape": e.preventDefault(), xe(!1), V && (Fe.current = !0), q();
|
|
4064
4070
|
}
|
|
4065
4071
|
}, [
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
]),
|
|
4070
|
-
|
|
4071
|
-
}, [
|
|
4072
|
+
q,
|
|
4073
|
+
tt,
|
|
4074
|
+
V
|
|
4075
|
+
]), _t = o((e) => {
|
|
4076
|
+
et(e);
|
|
4077
|
+
}, [et]), vt = o((e) => {
|
|
4072
4078
|
switch (e.key) {
|
|
4073
4079
|
case "Enter":
|
|
4074
4080
|
case " ":
|
|
4075
|
-
e.preventDefault(),
|
|
4081
|
+
e.preventDefault(), et(e.currentTarget.dataset.value || "");
|
|
4076
4082
|
break;
|
|
4077
4083
|
case "ArrowDown":
|
|
4078
|
-
e.preventDefault(),
|
|
4084
|
+
e.preventDefault(), G.current && br(G.current);
|
|
4079
4085
|
break;
|
|
4080
4086
|
case "ArrowUp":
|
|
4081
|
-
e.preventDefault(),
|
|
4087
|
+
e.preventDefault(), G.current && yr(e.currentTarget, G.current, y);
|
|
4082
4088
|
break;
|
|
4083
|
-
case "Escape": e.preventDefault(),
|
|
4089
|
+
case "Escape": e.preventDefault(), xe(!1), V && (Fe.current = !0), q();
|
|
4084
4090
|
}
|
|
4085
4091
|
}, [
|
|
4086
|
-
|
|
4092
|
+
et,
|
|
4087
4093
|
y,
|
|
4088
|
-
|
|
4089
|
-
|
|
4094
|
+
q,
|
|
4095
|
+
V
|
|
4090
4096
|
]);
|
|
4091
4097
|
return c(() => {
|
|
4092
|
-
if (!
|
|
4098
|
+
if (!Q) return;
|
|
4093
4099
|
let e = (e) => {
|
|
4094
4100
|
let t = e.target;
|
|
4095
|
-
|
|
4101
|
+
K.current && !K.current.contains(t) && tt();
|
|
4096
4102
|
};
|
|
4097
4103
|
return document.addEventListener("click", e, !0), () => {
|
|
4098
4104
|
document.removeEventListener("click", e, !0);
|
|
4099
4105
|
};
|
|
4100
|
-
}, [
|
|
4101
|
-
if (!
|
|
4106
|
+
}, [Q, tt]), c(() => {
|
|
4107
|
+
if (!fe) return;
|
|
4102
4108
|
let e = () => {
|
|
4103
4109
|
window.setTimeout(() => {
|
|
4104
|
-
if (_e
|
|
4105
|
-
let e = g ?
|
|
4106
|
-
|
|
4110
|
+
if (Y(_e.current), be([]), Te(""), Ce(""), je(null), De(""), U.current) {
|
|
4111
|
+
let e = g ? _e.current.join(",") : _e.current[0] || "";
|
|
4112
|
+
U.current.value = e;
|
|
4107
4113
|
}
|
|
4108
4114
|
}, 0);
|
|
4109
4115
|
};
|
|
4110
|
-
return
|
|
4111
|
-
}, [g,
|
|
4116
|
+
return fe.addEventListener("reset", e), () => fe.removeEventListener("reset", e);
|
|
4117
|
+
}, [g, fe]), u(n, () => ({
|
|
4112
4118
|
get value() {
|
|
4113
|
-
return
|
|
4119
|
+
return U.current?.value ?? "";
|
|
4114
4120
|
},
|
|
4115
4121
|
set value(e) {
|
|
4116
4122
|
let t = Array.isArray(e) ? e : e ? String(e).split(",").filter(Boolean) : [];
|
|
4117
|
-
|
|
4123
|
+
J || Y(t), U.current && (U.current.value = t.join(","));
|
|
4118
4124
|
},
|
|
4119
4125
|
focus() {
|
|
4120
|
-
|
|
4126
|
+
V ? H.current?.focus() : W.current?.focus();
|
|
4121
4127
|
},
|
|
4122
4128
|
blur() {
|
|
4123
|
-
|
|
4129
|
+
V ? H.current?.blur() : W.current?.blur();
|
|
4124
4130
|
}
|
|
4125
|
-
}), [
|
|
4131
|
+
}), [J]), {
|
|
4126
4132
|
id: r,
|
|
4127
4133
|
inputId: ue,
|
|
4128
4134
|
listboxId: de,
|
|
4129
|
-
values:
|
|
4130
|
-
inputValue:
|
|
4131
|
-
searchValue:
|
|
4132
|
-
options:
|
|
4133
|
-
filteredOptions:
|
|
4134
|
-
isOpen:
|
|
4135
|
-
userInfoMessage:
|
|
4136
|
-
skipInputTab:
|
|
4137
|
-
restoreInputTab: () =>
|
|
4138
|
-
strings:
|
|
4139
|
-
addValueText:
|
|
4140
|
-
maxIsReached:
|
|
4141
|
-
editingSingleValue:
|
|
4142
|
-
inputFocus:
|
|
4143
|
-
focusedTagIndex:
|
|
4135
|
+
values: X,
|
|
4136
|
+
inputValue: we,
|
|
4137
|
+
searchValue: Se,
|
|
4138
|
+
options: Z,
|
|
4139
|
+
filteredOptions: We,
|
|
4140
|
+
isOpen: Q,
|
|
4141
|
+
userInfoMessage: Ve,
|
|
4142
|
+
skipInputTab: Ne,
|
|
4143
|
+
restoreInputTab: () => Pe(!1),
|
|
4144
|
+
strings: B,
|
|
4145
|
+
addValueText: Ae,
|
|
4146
|
+
maxIsReached: He,
|
|
4147
|
+
editingSingleValue: Ie,
|
|
4148
|
+
inputFocus: Me,
|
|
4149
|
+
focusedTagIndex: Re,
|
|
4144
4150
|
label: i,
|
|
4145
4151
|
multiple: g,
|
|
4146
4152
|
maxlength: _,
|
|
@@ -4169,30 +4175,31 @@ function Or(t, n) {
|
|
|
4169
4175
|
inputSize: ae,
|
|
4170
4176
|
name: oe,
|
|
4171
4177
|
form: se,
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4178
|
+
ariaDescribedby: ce,
|
|
4179
|
+
className: I,
|
|
4180
|
+
hasCounter: Ue,
|
|
4181
|
+
inputRef: H,
|
|
4182
|
+
changeInputRef: U,
|
|
4183
|
+
triggerRef: W,
|
|
4184
|
+
listboxRef: G,
|
|
4185
|
+
wrapperRef: K,
|
|
4186
|
+
handleInputChange: rt,
|
|
4187
|
+
handleInputKeydown: it,
|
|
4188
|
+
handleInputFocus: at,
|
|
4189
|
+
handleInputBlur: ot,
|
|
4190
|
+
handleFocusOut: st,
|
|
4191
|
+
handleInputClick: ct,
|
|
4192
|
+
handlePlaceholderClick: lt,
|
|
4193
|
+
handleSelectOnlyKeydown: ut,
|
|
4194
|
+
handleOptionClick: dt,
|
|
4195
|
+
handleOptionKeydown: ft,
|
|
4196
|
+
handleTagRemove: pt,
|
|
4197
|
+
handleTagKeydown: mt,
|
|
4198
|
+
handleSearchInput: ht,
|
|
4199
|
+
handleSearchKeydown: gt,
|
|
4200
|
+
handleNewOptionClick: _t,
|
|
4201
|
+
handleNewOptionKeydown: vt,
|
|
4202
|
+
onChange: L
|
|
4196
4203
|
};
|
|
4197
4204
|
}
|
|
4198
4205
|
//#endregion
|
|
@@ -4288,7 +4295,7 @@ var Ar = null, jr = () => Ar || (Ar = new Promise((e, t) => {
|
|
|
4288
4295
|
hotjarId: i,
|
|
4289
4296
|
googleAnalyticsId: a
|
|
4290
4297
|
};
|
|
4291
|
-
let g = p(() => {}), v = o in
|
|
4298
|
+
let g = p(() => {}), v = o in ge.i18n ? o : "nb", y = l ?? ge.i18n[v].contentPresentation.buttons.settings;
|
|
4292
4299
|
c(() => {
|
|
4293
4300
|
let e = !1, t, n = h.current;
|
|
4294
4301
|
window.cookieBanner_googleAnalyticsId = n.googleAnalyticsId, window.cookieBanner_hotjarId = n.hotjarId, n.cookieDomain && (window.cookieBanner_cookieDomain = n.cookieDomain), n.cookieSecure && (window.cookieBanner_cookieSecure = n.cookieSecure), n.cookieExpiryDays && (window.cookieBanner_cookieExpiryDays = n.cookieExpiryDays), n.devMode && (window.cookieBanner_devMode = n.devMode);
|
|
@@ -4338,7 +4345,7 @@ var Ar = null, jr = () => Ar || (Ar = new Promise((e, t) => {
|
|
|
4338
4345
|
"aria-haspopup": "dialog",
|
|
4339
4346
|
onClick: b,
|
|
4340
4347
|
children: y
|
|
4341
|
-
}) : s === "icon" ? /* @__PURE__ */ _(
|
|
4348
|
+
}) : s === "icon" ? /* @__PURE__ */ _(Y, {
|
|
4342
4349
|
ref: f,
|
|
4343
4350
|
skin: "tertiary",
|
|
4344
4351
|
variant: "icon-only",
|
|
@@ -4346,7 +4353,7 @@ var Ar = null, jr = () => Ar || (Ar = new Promise((e, t) => {
|
|
|
4346
4353
|
"aria-haspopup": "dialog",
|
|
4347
4354
|
onClick: b,
|
|
4348
4355
|
children: y
|
|
4349
|
-
}) : /* @__PURE__ */ _(
|
|
4356
|
+
}) : /* @__PURE__ */ _(Y, {
|
|
4350
4357
|
ref: f,
|
|
4351
4358
|
"aria-haspopup": "dialog",
|
|
4352
4359
|
onClick: b,
|
|
@@ -4418,7 +4425,7 @@ var Fr = () => {
|
|
|
4418
4425
|
})
|
|
4419
4426
|
});
|
|
4420
4427
|
}, Gr = ({ dates: e, dateformat: t, idBase: n, strings: r, onDateRemoved: i }) => {
|
|
4421
|
-
let a = un(e), o =
|
|
4428
|
+
let a = un(e), o = ve(["datepicker"], r).datepicker.deleteDate;
|
|
4422
4429
|
return /* @__PURE__ */ _("div", {
|
|
4423
4430
|
className: "pkt-date-tags pkt-datepicker__tags",
|
|
4424
4431
|
"aria-live": "polite",
|
|
@@ -4590,24 +4597,24 @@ var Fr = () => {
|
|
|
4590
4597
|
//#endregion
|
|
4591
4598
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4592
4599
|
function Jr(e, t) {
|
|
4593
|
-
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: ce = !1, name: I, min: L, max: le, placeholder: R, onChange: z, onValueChange:
|
|
4600
|
+
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: ce = !1, name: I, min: L, max: le, placeholder: R, onChange: z, onValueChange: B, className: ue, ...de } = e, V = o((e) => e === void 0 ? [] : qr(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);
|
|
4594
4601
|
c(() => {
|
|
4595
|
-
H &&
|
|
4602
|
+
H && G(V(i));
|
|
4596
4603
|
}, [
|
|
4597
4604
|
i,
|
|
4598
4605
|
H,
|
|
4599
4606
|
V
|
|
4600
4607
|
]);
|
|
4601
|
-
let [
|
|
4608
|
+
let [q, pe] = m(C ?? !1);
|
|
4602
4609
|
c(() => {
|
|
4603
|
-
C !== void 0 &&
|
|
4610
|
+
C !== void 0 && pe(C);
|
|
4604
4611
|
}, [C]);
|
|
4605
|
-
let
|
|
4612
|
+
let me = p(null), he = p(null), J = p(null), ge = p(null), Y = p(null), _e = f(() => Ir(), []), X = f(() => Fr(), []), ye = ve([
|
|
4606
4613
|
"generic",
|
|
4607
4614
|
"datepicker",
|
|
4608
4615
|
"validation"
|
|
4609
|
-
], ae),
|
|
4610
|
-
let e = Rr(T, g, l, h, se,
|
|
4616
|
+
], ae), be = ae, Z = typeof L == "string" ? L : L === void 0 ? void 0 : String(L), Q = typeof le == "string" ? le : le === void 0 ? void 0 : String(le), xe = f(() => {
|
|
4617
|
+
let e = Rr(T, g, l, h, se, _e, E);
|
|
4611
4618
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4612
4619
|
}, [
|
|
4613
4620
|
T,
|
|
@@ -4615,7 +4622,7 @@ function Jr(e, t) {
|
|
|
4615
4622
|
l,
|
|
4616
4623
|
h,
|
|
4617
4624
|
se,
|
|
4618
|
-
|
|
4625
|
+
_e,
|
|
4619
4626
|
E
|
|
4620
4627
|
]), Se = Object.entries(zr(E)).filter(([, e]) => e).map(([e]) => e).join(" "), Ce = f(() => {
|
|
4621
4628
|
let e = Br(g);
|
|
@@ -4623,85 +4630,85 @@ function Jr(e, t) {
|
|
|
4623
4630
|
}, [g]), we = f(() => ["pkt-datepicker__inputs", h && "pkt-input__range-inputs"].filter(Boolean).join(" "), [h, g]), Te = f(() => {
|
|
4624
4631
|
if (x) return x;
|
|
4625
4632
|
if (Q) return Q.slice(0, 7);
|
|
4626
|
-
}, [x, Q]),
|
|
4633
|
+
}, [x, Q]), Ee = oe || l && d != null && K.length >= d, De = O ?? (l && d != null), Oe = `${n}-input`, ke = K.join(",");
|
|
4627
4634
|
c(() => {
|
|
4628
|
-
|
|
4629
|
-
}, [
|
|
4635
|
+
J.current && (J.current.value = ke);
|
|
4636
|
+
}, [ke]), c(() => {
|
|
4630
4637
|
w && typeof window < "u" && w !== window.pktTz && (window.pktTz = w);
|
|
4631
4638
|
}, [w]);
|
|
4632
|
-
let
|
|
4633
|
-
H ||
|
|
4634
|
-
}, [H,
|
|
4639
|
+
let Ae = o((e, t = !0) => {
|
|
4640
|
+
H || G(e), t && B?.(e);
|
|
4641
|
+
}, [H, B]), je = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Me = o((e) => {
|
|
4635
4642
|
if (h && e.length === 1) return;
|
|
4636
|
-
let t =
|
|
4637
|
-
!t || !
|
|
4638
|
-
}, [
|
|
4639
|
-
oe ||
|
|
4643
|
+
let t = J.current;
|
|
4644
|
+
!t || !je || (je.call(t, e.join(",")), t.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
4645
|
+
}, [je, h]), $ = o(() => {
|
|
4646
|
+
oe || pe((e) => !e);
|
|
4640
4647
|
}, [oe]), Ne = o(() => {
|
|
4641
|
-
|
|
4648
|
+
pe(!1);
|
|
4642
4649
|
}, []);
|
|
4643
4650
|
c(() => {
|
|
4644
|
-
if (!
|
|
4651
|
+
if (!q) return;
|
|
4645
4652
|
let e = (e) => {
|
|
4646
4653
|
let t = e.target;
|
|
4647
|
-
|
|
4654
|
+
Y.current && !Y.current.contains(t) && !t.closest?.(".pkt-calendar-popup") && Ne();
|
|
4648
4655
|
}, t = (e) => {
|
|
4649
|
-
e.key === "Escape" && (Ne(),
|
|
4656
|
+
e.key === "Escape" && (Ne(), me.current?.focus());
|
|
4650
4657
|
};
|
|
4651
4658
|
return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
|
|
4652
4659
|
document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
|
|
4653
4660
|
};
|
|
4654
|
-
}, [
|
|
4661
|
+
}, [q, Ne]);
|
|
4655
4662
|
let Pe = o(() => {
|
|
4656
|
-
|
|
4657
|
-
}, [
|
|
4663
|
+
X && !q && pe(!0);
|
|
4664
|
+
}, [X, q]), Fe = o((e) => {
|
|
4658
4665
|
let t = qr(Vr(e, l, h));
|
|
4659
|
-
|
|
4666
|
+
Ae(t), Me(t), !l && !h && (Ne(), me.current?.focus());
|
|
4660
4667
|
}, [
|
|
4661
4668
|
l,
|
|
4662
4669
|
h,
|
|
4663
|
-
|
|
4664
|
-
|
|
4670
|
+
Ae,
|
|
4671
|
+
Me,
|
|
4665
4672
|
Ne
|
|
4666
4673
|
]), Ie = o(() => {
|
|
4667
|
-
Ne(),
|
|
4674
|
+
Ne(), me.current?.focus();
|
|
4668
4675
|
}, [Ne]), Le = o((e) => {
|
|
4669
4676
|
let t = e.target.value, n = t ? [t] : [];
|
|
4670
|
-
|
|
4671
|
-
}, [
|
|
4672
|
-
let t = [e.target.value,
|
|
4673
|
-
|
|
4677
|
+
Ae(n), Me(n);
|
|
4678
|
+
}, [Ae, Me]), Re = o((e) => {
|
|
4679
|
+
let t = [e.target.value, K[1] ?? ""].filter(Boolean);
|
|
4680
|
+
Ae(t), Me(t);
|
|
4674
4681
|
}, [
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4682
|
+
K,
|
|
4683
|
+
Ae,
|
|
4684
|
+
Me
|
|
4678
4685
|
]), ze = o((e) => {
|
|
4679
|
-
let t = [
|
|
4680
|
-
|
|
4686
|
+
let t = [K[0] ?? "", e.target.value].filter(Boolean);
|
|
4687
|
+
Ae(t), Me(t);
|
|
4681
4688
|
}, [
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4689
|
+
K,
|
|
4690
|
+
Ae,
|
|
4691
|
+
Me
|
|
4685
4692
|
]), Be = o(() => {
|
|
4686
|
-
|
|
4693
|
+
K.length === 2 && !Lr(K) && (Ae([K[0]]), Me([K[0]]));
|
|
4687
4694
|
}, [
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4695
|
+
K,
|
|
4696
|
+
Ae,
|
|
4697
|
+
Me
|
|
4691
4698
|
]), Ve = o((e) => {
|
|
4692
4699
|
let t = Qt(e), n = Z ? Qt(Z) : null, r = Q ? Qt(Q) : null;
|
|
4693
4700
|
if (t && !isNaN(t.getTime()) && (!n || t >= n) && (!r || t <= r)) {
|
|
4694
|
-
let t = ln([...
|
|
4695
|
-
|
|
4701
|
+
let t = ln([...K, e], Z, Q, y, b), n = [...new Set(t)];
|
|
4702
|
+
Ae(n), Me(n);
|
|
4696
4703
|
}
|
|
4697
4704
|
}, [
|
|
4698
|
-
|
|
4705
|
+
K,
|
|
4699
4706
|
Z,
|
|
4700
4707
|
Q,
|
|
4701
4708
|
y,
|
|
4702
4709
|
b,
|
|
4703
|
-
|
|
4704
|
-
|
|
4710
|
+
Ae,
|
|
4711
|
+
Me
|
|
4705
4712
|
]), He = o((e) => {
|
|
4706
4713
|
let t = e.target;
|
|
4707
4714
|
t.value &&= (Ve(t.value.split(",")[0]), "");
|
|
@@ -4709,57 +4716,57 @@ function Jr(e, t) {
|
|
|
4709
4716
|
let t = e.target;
|
|
4710
4717
|
t.value &&= (Ve(t.value.split(",")[0]), "");
|
|
4711
4718
|
}, [Ve]), We = o((e) => {
|
|
4712
|
-
let t =
|
|
4713
|
-
|
|
4719
|
+
let t = K.filter((t) => t !== e);
|
|
4720
|
+
Ae(t), Me(t);
|
|
4714
4721
|
}, [
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4722
|
+
K,
|
|
4723
|
+
Ae,
|
|
4724
|
+
Me
|
|
4718
4725
|
]), Ge = o((e) => {
|
|
4719
4726
|
let t = e?.closest("form");
|
|
4720
4727
|
t ? t.requestSubmit() : e?.blur();
|
|
4721
4728
|
}, []), Ke = o((e) => {
|
|
4722
|
-
Ur(e.nativeEvent, () =>
|
|
4723
|
-
}, [
|
|
4724
|
-
Ur(e.nativeEvent, () =>
|
|
4725
|
-
}, [
|
|
4726
|
-
Ur(e.nativeEvent, () =>
|
|
4727
|
-
}, [
|
|
4728
|
-
Ur(e.nativeEvent, () =>
|
|
4729
|
+
Ur(e.nativeEvent, () => $(), () => Ge(me.current), void 0, () => me.current?.blur());
|
|
4730
|
+
}, [$, Ge]), qe = o((e) => {
|
|
4731
|
+
Ur(e.nativeEvent, () => $(), () => Ge(me.current), () => he.current?.focus(), () => me.current?.blur());
|
|
4732
|
+
}, [$, Ge]), Je = o((e) => {
|
|
4733
|
+
Ur(e.nativeEvent, () => $(), () => Ge(he.current), void 0, () => he.current?.blur());
|
|
4734
|
+
}, [$, Ge]), Ye = o((e) => {
|
|
4735
|
+
Ur(e.nativeEvent, () => $(), () => Ge(me.current), void 0, () => me.current?.blur(), Ue);
|
|
4729
4736
|
}, [
|
|
4730
|
-
|
|
4737
|
+
$,
|
|
4731
4738
|
Ge,
|
|
4732
4739
|
Ue
|
|
4733
4740
|
]);
|
|
4734
4741
|
return c(() => {
|
|
4735
|
-
let e =
|
|
4742
|
+
let e = Y.current?.closest("form");
|
|
4736
4743
|
if (!e) return;
|
|
4737
4744
|
let t = () => {
|
|
4738
4745
|
window.setTimeout(() => {
|
|
4739
|
-
|
|
4746
|
+
G(fe.current), pe(!1), J.current && (J.current.value = fe.current.join(","));
|
|
4740
4747
|
}, 0);
|
|
4741
4748
|
};
|
|
4742
4749
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
4743
4750
|
}, []), u(t, () => ({
|
|
4744
4751
|
get value() {
|
|
4745
|
-
return
|
|
4752
|
+
return J.current?.value ?? "";
|
|
4746
4753
|
},
|
|
4747
4754
|
set value(e) {
|
|
4748
4755
|
let t = e ? e.split(",").filter(Boolean) : [];
|
|
4749
|
-
|
|
4756
|
+
G(t), J.current && (J.current.value = e ?? "");
|
|
4750
4757
|
},
|
|
4751
4758
|
focus() {
|
|
4752
|
-
|
|
4759
|
+
me.current?.focus();
|
|
4753
4760
|
},
|
|
4754
4761
|
blur() {
|
|
4755
|
-
|
|
4762
|
+
me.current?.blur();
|
|
4756
4763
|
}
|
|
4757
4764
|
}), []), {
|
|
4758
4765
|
id: n,
|
|
4759
|
-
inputId:
|
|
4766
|
+
inputId: Oe,
|
|
4760
4767
|
label: r,
|
|
4761
|
-
values:
|
|
4762
|
-
calendarOpen:
|
|
4768
|
+
values: K,
|
|
4769
|
+
calendarOpen: q,
|
|
4763
4770
|
dateformat: s,
|
|
4764
4771
|
multiple: l,
|
|
4765
4772
|
maxlength: d,
|
|
@@ -4789,28 +4796,28 @@ function Jr(e, t) {
|
|
|
4789
4796
|
requiredText: F,
|
|
4790
4797
|
tagText: re,
|
|
4791
4798
|
useWrapper: ie,
|
|
4792
|
-
className:
|
|
4799
|
+
className: ue,
|
|
4793
4800
|
minStr: Z,
|
|
4794
4801
|
maxStr: Q,
|
|
4795
4802
|
effectiveCurrentMonth: Te,
|
|
4796
4803
|
today: S,
|
|
4797
|
-
inputType:
|
|
4798
|
-
isIOSDevice:
|
|
4799
|
-
strings:
|
|
4800
|
-
stringsOverride:
|
|
4804
|
+
inputType: _e,
|
|
4805
|
+
isIOSDevice: X,
|
|
4806
|
+
strings: ye,
|
|
4807
|
+
stringsOverride: be,
|
|
4801
4808
|
inputClasses: xe,
|
|
4802
4809
|
buttonClasses: Se,
|
|
4803
4810
|
rangeLabelClasses: Ce,
|
|
4804
4811
|
datepickerInputsClasses: we,
|
|
4805
|
-
isInputDisabled:
|
|
4806
|
-
hasCounter:
|
|
4807
|
-
inputRef:
|
|
4808
|
-
inputRefTo:
|
|
4809
|
-
changeInputRef:
|
|
4810
|
-
btnRef:
|
|
4811
|
-
wrapperRef:
|
|
4812
|
+
isInputDisabled: Ee,
|
|
4813
|
+
hasCounter: De,
|
|
4814
|
+
inputRef: me,
|
|
4815
|
+
inputRefTo: he,
|
|
4816
|
+
changeInputRef: J,
|
|
4817
|
+
btnRef: ge,
|
|
4818
|
+
wrapperRef: Y,
|
|
4812
4819
|
onChange: z,
|
|
4813
|
-
toggleCalendar:
|
|
4820
|
+
toggleCalendar: $,
|
|
4814
4821
|
hideCalendar: Ne,
|
|
4815
4822
|
handleDateSelected: Fe,
|
|
4816
4823
|
handleCalendarClose: Ie,
|
|
@@ -4825,7 +4832,7 @@ function Jr(e, t) {
|
|
|
4825
4832
|
handleRangeFromKeydown: qe,
|
|
4826
4833
|
handleRangeToKeydown: Je,
|
|
4827
4834
|
handleMultipleKeydown: Ye,
|
|
4828
|
-
restProps:
|
|
4835
|
+
restProps: de
|
|
4829
4836
|
};
|
|
4830
4837
|
}
|
|
4831
4838
|
//#endregion
|
|
@@ -5114,7 +5121,7 @@ var yi = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5114
5121
|
}, Si = n({}), Ci = 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) => {
|
|
5115
5122
|
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]);
|
|
5116
5123
|
u(x, () => S.current);
|
|
5117
|
-
let [T, E] = m(!1), D =
|
|
5124
|
+
let [T, E] = m(!1), D = ve(["fileupload"], y), O = f(() => l ? t ? {
|
|
5118
5125
|
dragInactive: D.fileupload.dropZoneDragMultipleThumbnail,
|
|
5119
5126
|
dragActive: D.fileupload.dropZoneDragActiveMultipleThumbnail,
|
|
5120
5127
|
openFileDialog: D.fileupload.dropZoneOpenFileDialogMultipleThumbnail
|
|
@@ -5321,7 +5328,7 @@ var Ei = "comments", Di = (e) => {
|
|
|
5321
5328
|
disabled: t,
|
|
5322
5329
|
defaultValue: i?.text
|
|
5323
5330
|
}),
|
|
5324
|
-
/* @__PURE__ */ _(
|
|
5331
|
+
/* @__PURE__ */ _(Y, {
|
|
5325
5332
|
skin: "secondary",
|
|
5326
5333
|
size: "small",
|
|
5327
5334
|
disabled: t,
|
|
@@ -5334,7 +5341,7 @@ var Ei = "comments", Di = (e) => {
|
|
|
5334
5341
|
},
|
|
5335
5342
|
children: o ? "Lagre kommentar" : "Legg til kommentar"
|
|
5336
5343
|
}),
|
|
5337
|
-
/* @__PURE__ */ _(
|
|
5344
|
+
/* @__PURE__ */ _(Y, {
|
|
5338
5345
|
skin: "tertiary",
|
|
5339
5346
|
size: "small",
|
|
5340
5347
|
disabled: t,
|
|
@@ -5434,14 +5441,14 @@ var Ei = "comments", Di = (e) => {
|
|
|
5434
5441
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), o()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r());
|
|
5435
5442
|
}
|
|
5436
5443
|
}),
|
|
5437
|
-
/* @__PURE__ */ _(
|
|
5444
|
+
/* @__PURE__ */ _(Y, {
|
|
5438
5445
|
skin: "secondary",
|
|
5439
5446
|
size: "small",
|
|
5440
5447
|
disabled: t,
|
|
5441
5448
|
onClick: o,
|
|
5442
5449
|
children: "Lagre"
|
|
5443
5450
|
}),
|
|
5444
|
-
/* @__PURE__ */ _(
|
|
5451
|
+
/* @__PURE__ */ _(Y, {
|
|
5445
5452
|
skin: "tertiary",
|
|
5446
5453
|
size: "small",
|
|
5447
5454
|
disabled: t,
|
|
@@ -5670,7 +5677,7 @@ var Ui = "is-scroll-locked", Wi = 0, Gi = 0, Ki = () => typeof document < "u" &&
|
|
|
5670
5677
|
}) : /* @__PURE__ */ _("div", { className: "pkt-modal__headingText" }),
|
|
5671
5678
|
i ? /* @__PURE__ */ _("div", { className: "pkt-modal__noCloseButton" }) : /* @__PURE__ */ _("div", {
|
|
5672
5679
|
className: (0, M.default)("pkt-modal__closeButton", { [`pkt-modal__closeButton--${u}`]: !0 }),
|
|
5673
|
-
children: /* @__PURE__ */ _(
|
|
5680
|
+
children: /* @__PURE__ */ _(Y, {
|
|
5674
5681
|
onClick: C,
|
|
5675
5682
|
"aria-label": "close",
|
|
5676
5683
|
iconName: "close",
|
|
@@ -5857,7 +5864,7 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
5857
5864
|
}), l = !!t;
|
|
5858
5865
|
return /* @__PURE__ */ v("div", {
|
|
5859
5866
|
className: `pkt-fileupload__queue-display__item__thumbnail${n && !i ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
|
|
5860
|
-
children: [/* @__PURE__ */ v(
|
|
5867
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
5861
5868
|
className: "pkt-fileupload__queue-display__item__thumbnail__image-wrapper",
|
|
5862
5869
|
"aria-label": `Forhåndsvis bilde ${e.attributes.targetFilename}`,
|
|
5863
5870
|
type: "button",
|
|
@@ -5913,7 +5920,7 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
5913
5920
|
children: /* @__PURE__ */ v("div", {
|
|
5914
5921
|
className: "pkt-fileupload__image-preview",
|
|
5915
5922
|
children: [
|
|
5916
|
-
f && /* @__PURE__ */ _(
|
|
5923
|
+
f && /* @__PURE__ */ _(Y, {
|
|
5917
5924
|
variant: "icon-only",
|
|
5918
5925
|
iconName: "chevron-thin-left",
|
|
5919
5926
|
skin: "secondary",
|
|
@@ -5942,7 +5949,7 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
5942
5949
|
t.length
|
|
5943
5950
|
]
|
|
5944
5951
|
}),
|
|
5945
|
-
f && /* @__PURE__ */ _(
|
|
5952
|
+
f && /* @__PURE__ */ _(Y, {
|
|
5946
5953
|
variant: "icon-only",
|
|
5947
5954
|
iconName: "chevron-thin-right",
|
|
5948
5955
|
skin: "secondary",
|
|
@@ -6083,19 +6090,19 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
6083
6090
|
filename: ua,
|
|
6084
6091
|
thumbnail: da
|
|
6085
6092
|
}, Ca = 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 = Sa.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": ce, strings: I, ...L }, le) => {
|
|
6086
|
-
let R = l(),
|
|
6087
|
-
u(le, () =>
|
|
6088
|
-
let V = "transfers" in L ? L.transfers : void 0, H =
|
|
6093
|
+
let R = l(), ue = n ?? `pkt-fileupload-${R}`, de = p(null);
|
|
6094
|
+
u(le, () => de.current, []);
|
|
6095
|
+
let V = "transfers" in L ? L.transfers : void 0, H = ve(["fileupload"], I).fileupload, [U, W] = m(null), [G, K] = m("");
|
|
6089
6096
|
c(() => {
|
|
6090
|
-
if (!
|
|
6091
|
-
let e = setTimeout(() =>
|
|
6097
|
+
if (!G) return;
|
|
6098
|
+
let e = setTimeout(() => K(""), 1500);
|
|
6092
6099
|
return () => clearTimeout(e);
|
|
6093
|
-
}, [
|
|
6094
|
-
let
|
|
6100
|
+
}, [G]);
|
|
6101
|
+
let fe = U ?? O ?? null, q = k || !!U || !!(O && O.trim()), pe = fe ? `${ue}-error` : void 0, me = [
|
|
6095
6102
|
se,
|
|
6096
|
-
N ? `${
|
|
6097
|
-
|
|
6098
|
-
].filter(Boolean).join(" ") || void 0,
|
|
6103
|
+
N ? `${ue}-helptext` : void 0,
|
|
6104
|
+
pe
|
|
6105
|
+
].filter(Boolean).join(" ") || void 0, he = q || ce === !0 || ce === "true", J = o((e) => {
|
|
6099
6106
|
let t = ri(e, {
|
|
6100
6107
|
allowedFormats: S,
|
|
6101
6108
|
maxFileSize: w,
|
|
@@ -6121,65 +6128,65 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
6121
6128
|
D
|
|
6122
6129
|
]);
|
|
6123
6130
|
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");
|
|
6124
|
-
let
|
|
6125
|
-
Vi(
|
|
6131
|
+
let ge = e !== void 0, [Y, _e] = m(() => t ?? []), X = ge ? e : Y;
|
|
6132
|
+
Vi(de, {
|
|
6126
6133
|
uploadStrategy: i,
|
|
6127
6134
|
required: ae,
|
|
6128
|
-
currentFileCount:
|
|
6129
|
-
onMissingFiles: o(() =>
|
|
6135
|
+
currentFileCount: X.length,
|
|
6136
|
+
onMissingFiles: o(() => W(H.requiredMissing), [H])
|
|
6130
6137
|
});
|
|
6131
|
-
let
|
|
6138
|
+
let be = typeof b == "string" ? Sa[b] : b, Z = b === "thumbnail", Q = typeof L.accept == "string" ? L.accept.trim() : void 0, xe = f(() => ti(Q, S) || void 0, [Q, S]), Se = s && !Z, Ce = a && !Z, we = o((e) => {
|
|
6132
6139
|
for (let t of e) {
|
|
6133
|
-
let e =
|
|
6140
|
+
let e = J(t.file);
|
|
6134
6141
|
if (e) {
|
|
6135
|
-
|
|
6142
|
+
W(e);
|
|
6136
6143
|
return;
|
|
6137
6144
|
}
|
|
6138
6145
|
}
|
|
6139
|
-
|
|
6140
|
-
let t = r ? [...
|
|
6141
|
-
|
|
6146
|
+
W(null);
|
|
6147
|
+
let t = r ? [...X, ...e] : [e[0]], n = r ? e : [e[0]];
|
|
6148
|
+
K(n.length === 1 ? z(H.srFileAdded, { filename: n[0].attributes.targetFilename }) : z(H.srFilesAdded, { count: n.length })), ge || _e(t), h?.(t), i === "custom" && g && e.forEach((e) => {
|
|
6142
6149
|
g?.(e);
|
|
6143
6150
|
});
|
|
6144
6151
|
}, [
|
|
6145
6152
|
h,
|
|
6146
|
-
|
|
6153
|
+
X,
|
|
6147
6154
|
r,
|
|
6148
6155
|
i,
|
|
6149
6156
|
g,
|
|
6150
|
-
|
|
6151
|
-
|
|
6157
|
+
J,
|
|
6158
|
+
ge,
|
|
6152
6159
|
H
|
|
6153
6160
|
]), Te = o((e, t) => {
|
|
6154
|
-
let n =
|
|
6161
|
+
let n = X.map((n) => n.fileId === e ? {
|
|
6155
6162
|
...n,
|
|
6156
6163
|
...t
|
|
6157
6164
|
} : n);
|
|
6158
|
-
|
|
6165
|
+
ge || _e(n), h?.(n);
|
|
6159
6166
|
}, [
|
|
6160
6167
|
h,
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
]),
|
|
6164
|
-
let t =
|
|
6165
|
-
|
|
6168
|
+
X,
|
|
6169
|
+
ge
|
|
6170
|
+
]), Ee = o((e) => {
|
|
6171
|
+
let t = X.filter((t) => t.fileId !== e);
|
|
6172
|
+
ge || _e(t), h?.(t), "onTransferCancelled" in L && L.onTransferCancelled && L.onTransferCancelled?.(e);
|
|
6166
6173
|
}, [
|
|
6167
6174
|
h,
|
|
6168
|
-
|
|
6175
|
+
X,
|
|
6169
6176
|
L,
|
|
6170
|
-
|
|
6171
|
-
]), { buildAttributeAccessors:
|
|
6177
|
+
ge
|
|
6178
|
+
]), { buildAttributeAccessors: De } = Ri(X, Te), Oe = f(() => {
|
|
6172
6179
|
let e = [];
|
|
6173
|
-
return Se && e.push(Li), Ce && e.push(Mi), e.push(...y), e.push(Ni(
|
|
6180
|
+
return Se && e.push(Li), Ce && e.push(Mi), e.push(...y), e.push(Ni(Ee)), e;
|
|
6174
6181
|
}, [
|
|
6175
6182
|
Se,
|
|
6176
6183
|
Ce,
|
|
6177
6184
|
y,
|
|
6178
|
-
|
|
6179
|
-
]), { totalCount:
|
|
6185
|
+
Ee
|
|
6186
|
+
]), { totalCount: ke, uploadedCount: Ae, failedCount: je } = f(() => gi(X, V), [X, V]), Me = B(ke, H.fileLabelOne, H.fileLabelOther), $ = /* @__PURE__ */ _("div", {
|
|
6180
6187
|
className: (0, M.default)("pkt-fileupload", {
|
|
6181
6188
|
"pkt-fileupload--full-width": x,
|
|
6182
|
-
"pkt-fileupload--error":
|
|
6189
|
+
"pkt-fileupload--error": q,
|
|
6183
6190
|
"pkt-fileupload--disabled": A
|
|
6184
6191
|
}),
|
|
6185
6192
|
"aria-disabled": A,
|
|
@@ -6188,95 +6195,92 @@ var ea = n({ tail: 5 }), ta = ({ children: e, tail: t }) => {
|
|
|
6188
6195
|
value: {
|
|
6189
6196
|
name: L.name || "",
|
|
6190
6197
|
multiple: !!r,
|
|
6191
|
-
id:
|
|
6198
|
+
id: ue
|
|
6192
6199
|
},
|
|
6193
6200
|
children: [
|
|
6194
6201
|
/* @__PURE__ */ _("div", {
|
|
6195
6202
|
className: "pkt-sr-only",
|
|
6196
6203
|
"aria-live": "polite",
|
|
6197
6204
|
"aria-atomic": "true",
|
|
6198
|
-
children:
|
|
6199
|
-
uploaded:
|
|
6200
|
-
total:
|
|
6201
|
-
label:
|
|
6205
|
+
children: G || (ke > 0 && Ae > 0 ? z(H.srFilesUploadedOfTotal, {
|
|
6206
|
+
uploaded: Ae,
|
|
6207
|
+
total: ke,
|
|
6208
|
+
label: Me
|
|
6202
6209
|
}) : "")
|
|
6203
6210
|
}),
|
|
6204
6211
|
/* @__PURE__ */ _("div", {
|
|
6205
6212
|
className: "pkt-sr-only",
|
|
6206
6213
|
"aria-live": "assertive",
|
|
6207
6214
|
"aria-atomic": "true",
|
|
6208
|
-
children:
|
|
6209
|
-
failed:
|
|
6210
|
-
total:
|
|
6211
|
-
label:
|
|
6215
|
+
children: ke > 0 && je > 0 && z(H.srFilesFailedOfTotal, {
|
|
6216
|
+
failed: je,
|
|
6217
|
+
total: ke,
|
|
6218
|
+
label: Me
|
|
6212
6219
|
})
|
|
6213
6220
|
}),
|
|
6214
6221
|
/* @__PURE__ */ _(Ci, {
|
|
6215
|
-
id:
|
|
6222
|
+
id: ue,
|
|
6216
6223
|
name: L.name || "",
|
|
6217
6224
|
form: L.form,
|
|
6218
|
-
value:
|
|
6225
|
+
value: X,
|
|
6219
6226
|
onFilesAdded: we,
|
|
6220
6227
|
multiple: r,
|
|
6221
6228
|
uploadStrategy: i,
|
|
6222
|
-
ref:
|
|
6229
|
+
ref: de,
|
|
6223
6230
|
accept: Z ? _i : xe,
|
|
6224
6231
|
isThumbnailView: Z,
|
|
6225
6232
|
disabled: A,
|
|
6226
6233
|
required: ae && i === "form",
|
|
6227
6234
|
"aria-required": ae ? "true" : void 0,
|
|
6228
|
-
"aria-invalid":
|
|
6229
|
-
"aria-describedby":
|
|
6235
|
+
"aria-invalid": he ? "true" : void 0,
|
|
6236
|
+
"aria-describedby": me,
|
|
6230
6237
|
hasVisibleLabel: !!j,
|
|
6231
6238
|
strings: I
|
|
6232
6239
|
}),
|
|
6233
|
-
|
|
6240
|
+
q && fe && /* @__PURE__ */ _(ye, {
|
|
6234
6241
|
skin: "error",
|
|
6235
6242
|
"aria-live": "assertive",
|
|
6236
6243
|
role: "alert",
|
|
6237
6244
|
compact: !0,
|
|
6238
|
-
id:
|
|
6245
|
+
id: pe,
|
|
6239
6246
|
className: "pkt-fileupload__error-alert",
|
|
6240
|
-
children:
|
|
6247
|
+
children: fe
|
|
6241
6248
|
}),
|
|
6242
|
-
|
|
6243
|
-
files:
|
|
6244
|
-
cancelTransfer:
|
|
6249
|
+
X.length > 0 && /* @__PURE__ */ _(xa, {
|
|
6250
|
+
files: X,
|
|
6251
|
+
cancelTransfer: Ee,
|
|
6245
6252
|
truncateTail: d,
|
|
6246
6253
|
transfers: V,
|
|
6247
6254
|
uploadStrategy: i,
|
|
6248
|
-
ItemRenderer:
|
|
6255
|
+
ItemRenderer: be,
|
|
6249
6256
|
enableImagePreview: Z && oe,
|
|
6250
6257
|
disabled: A,
|
|
6251
6258
|
inputName: L.name || "",
|
|
6252
|
-
buildAttributeAccessors:
|
|
6253
|
-
queueItemOperations:
|
|
6259
|
+
buildAttributeAccessors: De,
|
|
6260
|
+
queueItemOperations: Oe
|
|
6254
6261
|
})
|
|
6255
6262
|
]
|
|
6256
6263
|
})
|
|
6257
6264
|
});
|
|
6258
|
-
return
|
|
6265
|
+
return /* @__PURE__ */ _("div", {
|
|
6259
6266
|
className: "pkt-fileupload-component",
|
|
6260
6267
|
children: /* @__PURE__ */ _(rr, {
|
|
6261
6268
|
strings: I,
|
|
6262
|
-
forId:
|
|
6263
|
-
label: j,
|
|
6269
|
+
forId: ue,
|
|
6270
|
+
label: j ?? "",
|
|
6264
6271
|
helptext: N,
|
|
6265
6272
|
helptextDropdown: P,
|
|
6266
6273
|
helptextDropdownButton: ee,
|
|
6267
6274
|
disabled: A,
|
|
6268
|
-
hasError:
|
|
6275
|
+
hasError: q,
|
|
6269
6276
|
optionalTag: te,
|
|
6270
6277
|
optionalText: ne,
|
|
6271
6278
|
requiredTag: F,
|
|
6272
6279
|
requiredText: re,
|
|
6273
6280
|
tagText: ie,
|
|
6274
6281
|
className: (0, M.default)("pkt-fileupload-wrapper", { "pkt-fileupload-wrapper--full-width": x }),
|
|
6275
|
-
children:
|
|
6282
|
+
children: $
|
|
6276
6283
|
})
|
|
6277
|
-
}) : /* @__PURE__ */ _("div", {
|
|
6278
|
-
className: "pkt-fileupload-component",
|
|
6279
|
-
children: Me
|
|
6280
6284
|
});
|
|
6281
6285
|
});
|
|
6282
6286
|
Ca.displayName = "PktFileUpload";
|
|
@@ -7080,7 +7084,7 @@ ho.displayName = "PktHeaderUserMenu";
|
|
|
7080
7084
|
//#endregion
|
|
7081
7085
|
//#region src/components/searchinput/SearchInput.tsx
|
|
7082
7086
|
var go = 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) => {
|
|
7083
|
-
let S =
|
|
7087
|
+
let S = ve(["searchinput"], y), C = s ?? S.searchinput.placeholder, w = (e, t) => {
|
|
7084
7088
|
e ? e() : h && h(t);
|
|
7085
7089
|
}, T = (e) => {
|
|
7086
7090
|
l = e.target.value;
|
|
@@ -7133,7 +7137,7 @@ var go = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
|
|
|
7133
7137
|
e.key === "Enter" && (e.preventDefault(), m(l));
|
|
7134
7138
|
}),
|
|
7135
7139
|
...b
|
|
7136
|
-
}), /* @__PURE__ */ _(
|
|
7140
|
+
}), /* @__PURE__ */ _(Y, {
|
|
7137
7141
|
className: `pkt-searchinput__button ${e === "local" ? "pkt-input-icon" : ""}`,
|
|
7138
7142
|
variant: "icon-only",
|
|
7139
7143
|
iconName: "magnifying-glass-big",
|
|
@@ -7181,7 +7185,7 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7181
7185
|
}, [N]), c(() => {
|
|
7182
7186
|
L.current = P;
|
|
7183
7187
|
}, [P]);
|
|
7184
|
-
let { setRef: le, isMobile: R, isTablet: z, isFixed:
|
|
7188
|
+
let { setRef: le, isMobile: R, isTablet: z, isFixed: B, isSticky: ue, hidden: de, captureFocus: V, flagRestoreFocus: H, restoreFocus: U } = $a({
|
|
7185
7189
|
forwardedRef: te,
|
|
7186
7190
|
mobileBreakpoint: A,
|
|
7187
7191
|
tabletBreakpoint: j,
|
|
@@ -7190,12 +7194,12 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7190
7194
|
pauseScrollHide: F !== "none"
|
|
7191
7195
|
});
|
|
7192
7196
|
eo(F === "menu" || F === "search");
|
|
7193
|
-
let
|
|
7194
|
-
|
|
7197
|
+
let W = p(null), G = o((e) => {
|
|
7198
|
+
W.current = e, le(e);
|
|
7195
7199
|
}, [le]);
|
|
7196
7200
|
d(() => {
|
|
7197
7201
|
if (F !== "menu" && F !== "search") return;
|
|
7198
|
-
let e = document.getElementById(F === "menu" ? vo : bo), t =
|
|
7202
|
+
let e = document.getElementById(F === "menu" ? vo : bo), t = W.current?.getBoundingClientRect();
|
|
7199
7203
|
!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`));
|
|
7200
7204
|
}, [
|
|
7201
7205
|
F,
|
|
@@ -7212,7 +7216,7 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7212
7216
|
e.name !== "AbortError" && (se(!0), L.current?.(e));
|
|
7213
7217
|
}), () => e.abort();
|
|
7214
7218
|
}, [r, n]);
|
|
7215
|
-
let
|
|
7219
|
+
let K = r ?? ie, fe = f(() => Aa(K, i), [K, i]);
|
|
7216
7220
|
c(() => {
|
|
7217
7221
|
let e = (e) => {
|
|
7218
7222
|
let t = e.target;
|
|
@@ -7223,10 +7227,10 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7223
7227
|
if (F !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
7224
7228
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
7225
7229
|
};
|
|
7226
|
-
|
|
7230
|
+
U();
|
|
7227
7231
|
}, [
|
|
7228
7232
|
F,
|
|
7229
|
-
|
|
7233
|
+
U,
|
|
7230
7234
|
H
|
|
7231
7235
|
]), c(() => {
|
|
7232
7236
|
if (F !== "menu" && F !== "search") return;
|
|
@@ -7256,18 +7260,18 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7256
7260
|
document.removeEventListener("keydown", a), document.removeEventListener("focusin", o);
|
|
7257
7261
|
};
|
|
7258
7262
|
}, [F]);
|
|
7259
|
-
let
|
|
7263
|
+
let q = f(() => {
|
|
7260
7264
|
if (x?.lastLoggedIn) return typeof x.lastLoggedIn == "string" ? x.lastLoggedIn : new Date(x.lastLoggedIn).toLocaleString("nb-NO", {
|
|
7261
7265
|
year: "numeric",
|
|
7262
7266
|
month: "long",
|
|
7263
7267
|
day: "numeric"
|
|
7264
7268
|
});
|
|
7265
|
-
}, [x?.lastLoggedIn]),
|
|
7269
|
+
}, [x?.lastLoggedIn]), pe = o((e) => {
|
|
7266
7270
|
re((t) => t === e ? "none" : (V(), e));
|
|
7267
|
-
}, [V]),
|
|
7268
|
-
className: (0, M.default)("pkt-header-global", R && "pkt-header-global--mobile", z && "pkt-header-global--tablet",
|
|
7271
|
+
}, [V]), me = E === "userMenu" || E === "both", he = ve(["header"], ee).header, J = fe?.search, ge = fe?.header?.contact, _e = fe?.i18n?.menu || he.menu, X = fe?.i18n?.search || he.search, ye = F === "menu", be = F === "user", Z = F === "search", Q = R, xe = !!(u && J), Se = J?.input.id || "pkt-header-global-search", Ce = !fe && !oe, we = /* @__PURE__ */ v("header", {
|
|
7272
|
+
className: (0, M.default)("pkt-header-global", R && "pkt-header-global--mobile", z && "pkt-header-global--tablet", B && "pkt-header-global--fixed", ue && "pkt-header-global--sticky", ne && "pkt-header-global--scroll-to-hide", de && "pkt-header-global--hidden", e),
|
|
7269
7273
|
"data-mode": t,
|
|
7270
|
-
ref:
|
|
7274
|
+
ref: G,
|
|
7271
7275
|
children: [
|
|
7272
7276
|
/* @__PURE__ */ _("div", {
|
|
7273
7277
|
className: "pkt-header-global__logo-area",
|
|
@@ -7288,23 +7292,23 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7288
7292
|
/* @__PURE__ */ v("div", {
|
|
7289
7293
|
className: "pkt-header-global__content",
|
|
7290
7294
|
children: [
|
|
7291
|
-
!Q && xe &&
|
|
7295
|
+
!Q && xe && J && /* @__PURE__ */ _("div", {
|
|
7292
7296
|
className: "pkt-header-global__search",
|
|
7293
7297
|
children: /* @__PURE__ */ _(go, {
|
|
7294
7298
|
appearance: "global",
|
|
7295
7299
|
inputSize: z ? "small" : "medium",
|
|
7296
7300
|
fullwidth: !0,
|
|
7297
7301
|
id: Se,
|
|
7298
|
-
name:
|
|
7299
|
-
"aria-label":
|
|
7300
|
-
placeholder: h ??
|
|
7301
|
-
action:
|
|
7302
|
+
name: J.input.name,
|
|
7303
|
+
"aria-label": X,
|
|
7304
|
+
placeholder: h ?? J.input.placeholder,
|
|
7305
|
+
action: J.endpoint,
|
|
7302
7306
|
method: "get",
|
|
7303
7307
|
onSearch: y,
|
|
7304
7308
|
onChange: () => {}
|
|
7305
7309
|
})
|
|
7306
7310
|
}),
|
|
7307
|
-
Q && xe && /* @__PURE__ */ _(
|
|
7311
|
+
Q && xe && /* @__PURE__ */ _(Y, {
|
|
7308
7312
|
id: xo,
|
|
7309
7313
|
className: "pkt-header-global__search-toggle",
|
|
7310
7314
|
skin: "primary",
|
|
@@ -7315,29 +7319,29 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7315
7319
|
state: Z ? "active" : "normal",
|
|
7316
7320
|
"aria-expanded": Z,
|
|
7317
7321
|
"aria-controls": bo,
|
|
7318
|
-
onClick: () =>
|
|
7319
|
-
children:
|
|
7322
|
+
onClick: () => pe("search"),
|
|
7323
|
+
children: X
|
|
7320
7324
|
}),
|
|
7321
|
-
/* @__PURE__ */ _(
|
|
7325
|
+
/* @__PURE__ */ _(Y, {
|
|
7322
7326
|
id: yo,
|
|
7323
7327
|
className: "pkt-header-global__menu-toggle",
|
|
7324
7328
|
skin: Q ? "tertiary" : "secondary",
|
|
7325
7329
|
variant: Q ? "icon-only" : "icon-right",
|
|
7326
|
-
iconName:
|
|
7330
|
+
iconName: ye ? "close" : "menu",
|
|
7327
7331
|
size: z ? "small" : "medium",
|
|
7328
|
-
state:
|
|
7329
|
-
"aria-expanded":
|
|
7332
|
+
state: ye ? "active" : "normal",
|
|
7333
|
+
"aria-expanded": ye,
|
|
7330
7334
|
"aria-controls": vo,
|
|
7331
7335
|
disabled: Ce,
|
|
7332
|
-
onClick: () =>
|
|
7333
|
-
children:
|
|
7336
|
+
onClick: () => pe("menu"),
|
|
7337
|
+
children: _e
|
|
7334
7338
|
}),
|
|
7335
|
-
!Q && b &&
|
|
7339
|
+
!Q && b && ge && !x && /* @__PURE__ */ _("a", {
|
|
7336
7340
|
className: (0, M.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only", z ? "pkt-btn--small" : "pkt-btn--medium"),
|
|
7337
|
-
href:
|
|
7341
|
+
href: ge.url,
|
|
7338
7342
|
children: /* @__PURE__ */ _("span", {
|
|
7339
7343
|
className: "pkt-btn__text",
|
|
7340
|
-
children:
|
|
7344
|
+
children: ge.text
|
|
7341
7345
|
})
|
|
7342
7346
|
})
|
|
7343
7347
|
]
|
|
@@ -7345,16 +7349,16 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7345
7349
|
x && /* @__PURE__ */ _("div", {
|
|
7346
7350
|
className: "pkt-header-global__user",
|
|
7347
7351
|
children: /* @__PURE__ */ v("div", {
|
|
7348
|
-
className: (0, M.default)("pkt-header-global__user-container",
|
|
7349
|
-
children: [/* @__PURE__ */ v(
|
|
7352
|
+
className: (0, M.default)("pkt-header-global__user-container", be && "is-open"),
|
|
7353
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
7350
7354
|
className: "pkt-header-global__user-button",
|
|
7351
7355
|
skin: "secondary",
|
|
7352
7356
|
size: z ? "small" : "medium",
|
|
7353
|
-
state:
|
|
7357
|
+
state: be ? "active" : "normal",
|
|
7354
7358
|
variant: "icons-right-and-left",
|
|
7355
7359
|
iconName: "user",
|
|
7356
|
-
secondIconName:
|
|
7357
|
-
onClick: () =>
|
|
7360
|
+
secondIconName: be ? "chevron-thin-up" : "chevron-thin-down",
|
|
7361
|
+
onClick: () => pe("user"),
|
|
7358
7362
|
children: [/* @__PURE__ */ _("span", {
|
|
7359
7363
|
className: "pkt-sr-only",
|
|
7360
7364
|
children: "Brukermeny: "
|
|
@@ -7362,26 +7366,26 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7362
7366
|
translate: "no",
|
|
7363
7367
|
children: C?.name || x.name
|
|
7364
7368
|
})]
|
|
7365
|
-
}),
|
|
7369
|
+
}), be && /* @__PURE__ */ _("div", {
|
|
7366
7370
|
className: "pkt-header-global__user-menu is-open",
|
|
7367
7371
|
children: /* @__PURE__ */ _(ho, {
|
|
7368
7372
|
user: x,
|
|
7369
|
-
formattedLastLoggedIn:
|
|
7373
|
+
formattedLastLoggedIn: q,
|
|
7370
7374
|
representing: C,
|
|
7371
7375
|
userMenu: S,
|
|
7372
7376
|
canChangeRepresentation: w,
|
|
7373
7377
|
changeRepresentation: T,
|
|
7374
|
-
logoutOnClick:
|
|
7378
|
+
logoutOnClick: me ? D : void 0
|
|
7375
7379
|
})
|
|
7376
7380
|
})]
|
|
7377
7381
|
})
|
|
7378
7382
|
})
|
|
7379
7383
|
]
|
|
7380
|
-
}), Te =
|
|
7384
|
+
}), Te = ye && /* @__PURE__ */ _("div", {
|
|
7381
7385
|
className: (0, M.default)("pkt-header-global__menu", R && "pkt-header-global__menu--mobile", z && !R && "pkt-header-global__menu--tablet"),
|
|
7382
7386
|
id: vo,
|
|
7383
|
-
children:
|
|
7384
|
-
data:
|
|
7387
|
+
children: fe ? /* @__PURE__ */ _(to, {
|
|
7388
|
+
data: K,
|
|
7385
7389
|
locale: i,
|
|
7386
7390
|
open: !0,
|
|
7387
7391
|
mobileBreakpoint: A
|
|
@@ -7392,7 +7396,7 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7392
7396
|
children: "Kunne ikke laste meny."
|
|
7393
7397
|
})
|
|
7394
7398
|
})
|
|
7395
|
-
}),
|
|
7399
|
+
}), Ee = Z && xe && J && /* @__PURE__ */ _("div", {
|
|
7396
7400
|
className: (0, M.default)("pkt-header-global__search-panel", R && "pkt-header-global__search-panel--mobile", z && !R && "pkt-header-global__search-panel--tablet"),
|
|
7397
7401
|
id: bo,
|
|
7398
7402
|
children: /* @__PURE__ */ _("div", {
|
|
@@ -7401,10 +7405,10 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7401
7405
|
appearance: "global",
|
|
7402
7406
|
fullwidth: !0,
|
|
7403
7407
|
id: Se,
|
|
7404
|
-
name:
|
|
7405
|
-
"aria-label":
|
|
7406
|
-
placeholder: h ??
|
|
7407
|
-
action:
|
|
7408
|
+
name: J.input.name,
|
|
7409
|
+
"aria-label": X,
|
|
7410
|
+
placeholder: h ?? J.input.placeholder,
|
|
7411
|
+
action: J.endpoint,
|
|
7408
7412
|
method: "get",
|
|
7409
7413
|
onSearch: y,
|
|
7410
7414
|
onChange: () => {},
|
|
@@ -7412,37 +7416,37 @@ var vo = "pkt-header-global-menu", yo = "pkt-header-global-menu-toggle", bo = "p
|
|
|
7412
7416
|
})
|
|
7413
7417
|
})
|
|
7414
7418
|
});
|
|
7415
|
-
return
|
|
7419
|
+
return B ? /* @__PURE__ */ v("div", {
|
|
7416
7420
|
className: "pkt-header-global-wrapper",
|
|
7417
7421
|
children: [
|
|
7418
7422
|
we,
|
|
7419
7423
|
/* @__PURE__ */ _("div", { className: (0, M.default)("pkt-header-global-spacer", R && "pkt-header-global-spacer--mobile", z && !R && "pkt-header-global-spacer--tablet", x && "pkt-header-global-spacer--has-user") }),
|
|
7420
|
-
|
|
7424
|
+
Ee,
|
|
7421
7425
|
Te
|
|
7422
7426
|
]
|
|
7423
7427
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
7424
7428
|
we,
|
|
7425
|
-
|
|
7429
|
+
Ee,
|
|
7426
7430
|
Te
|
|
7427
7431
|
] });
|
|
7428
7432
|
});
|
|
7429
7433
|
So.displayName = "PktHeaderGlobal";
|
|
7430
7434
|
//#endregion
|
|
7431
7435
|
//#region src/components/textinput/Textinput.tsx
|
|
7432
|
-
var Co = 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: ce, skipForwardTestid: L = !1, inputSize: le = "medium", strings: R, ...z },
|
|
7433
|
-
let
|
|
7434
|
-
|
|
7436
|
+
var Co = 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: ce, skipForwardTestid: L = !1, inputSize: le = "medium", strings: R, ...z }, B) => {
|
|
7437
|
+
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 = Jn(e), K = `${G}`, fe = `${K}-label`, q = n || fe, pe = (e) => {
|
|
7438
|
+
ue && W(e.currentTarget?.value?.length || 0), ce && ce(e);
|
|
7435
7439
|
};
|
|
7436
7440
|
return c(() => {
|
|
7437
|
-
P !== void 0 &&
|
|
7441
|
+
P !== void 0 && W(P?.length || 0);
|
|
7438
7442
|
}, [P]), /* @__PURE__ */ _("div", {
|
|
7439
|
-
className:
|
|
7443
|
+
className: de,
|
|
7440
7444
|
children: /* @__PURE__ */ _(rr, {
|
|
7441
7445
|
strings: R,
|
|
7442
7446
|
ariaDescribedby: t,
|
|
7443
7447
|
disabled: l,
|
|
7444
7448
|
errorMessage: u,
|
|
7445
|
-
forId:
|
|
7449
|
+
forId: K,
|
|
7446
7450
|
hasError: d,
|
|
7447
7451
|
helptext: f,
|
|
7448
7452
|
helptextDropdown: p,
|
|
@@ -7455,8 +7459,8 @@ var Co = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7455
7459
|
requiredText: E,
|
|
7456
7460
|
tagText: D,
|
|
7457
7461
|
useWrapper: M,
|
|
7458
|
-
counter:
|
|
7459
|
-
counterCurrent:
|
|
7462
|
+
counter: ue,
|
|
7463
|
+
counterCurrent: U,
|
|
7460
7464
|
counterMaxLength: o,
|
|
7461
7465
|
hasFieldset: a ?? !1,
|
|
7462
7466
|
size: le,
|
|
@@ -7471,27 +7475,27 @@ var Co = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7471
7475
|
}),
|
|
7472
7476
|
/* @__PURE__ */ _("input", {
|
|
7473
7477
|
...z,
|
|
7474
|
-
ref:
|
|
7475
|
-
className: `pkt-input pkt-input--${le} ${b ? "pkt-input--fullwidth" : ""} ${o &&
|
|
7478
|
+
ref: B,
|
|
7479
|
+
className: `pkt-input pkt-input--${le} ${b ? "pkt-input--fullwidth" : ""} ${o && U > o ? "pkt-input--counter-error" : ""}`,
|
|
7476
7480
|
type: j,
|
|
7477
|
-
name: `${S ||
|
|
7481
|
+
name: `${S || G}`,
|
|
7478
7482
|
value: H,
|
|
7479
|
-
id:
|
|
7483
|
+
id: K,
|
|
7480
7484
|
placeholder: O,
|
|
7481
7485
|
autoComplete: r,
|
|
7482
7486
|
disabled: l,
|
|
7483
7487
|
"aria-invalid": d,
|
|
7484
|
-
"aria-errormessage": d ? `${
|
|
7488
|
+
"aria-errormessage": d ? `${G}-error` : void 0,
|
|
7485
7489
|
"aria-describedby": Zn({
|
|
7486
|
-
id:
|
|
7490
|
+
id: K,
|
|
7487
7491
|
hasHelptext: !!f,
|
|
7488
|
-
hasCounter:
|
|
7492
|
+
hasCounter: ue,
|
|
7489
7493
|
ariaDescribedby: t
|
|
7490
7494
|
}),
|
|
7491
|
-
"aria-labelledby":
|
|
7495
|
+
"aria-labelledby": q,
|
|
7492
7496
|
min: ne,
|
|
7493
7497
|
max: F,
|
|
7494
|
-
onChange:
|
|
7498
|
+
onChange: pe,
|
|
7495
7499
|
step: re,
|
|
7496
7500
|
minLength: ee,
|
|
7497
7501
|
maxLength: te,
|
|
@@ -7536,7 +7540,7 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7536
7540
|
c(() => {
|
|
7537
7541
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
7538
7542
|
}, [O]);
|
|
7539
|
-
let ce =
|
|
7543
|
+
let ce = ve(["header"], ae).header, L = x ?? ce.search;
|
|
7540
7544
|
c(() => {
|
|
7541
7545
|
k && console.warn("PktHeaderService: The \"userOptions\" prop is no longer available. Please use \"userMenu\" instead.");
|
|
7542
7546
|
}, [k]), c(() => {
|
|
@@ -7552,25 +7556,25 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7552
7556
|
c(() => {
|
|
7553
7557
|
u !== void 0 && z(u);
|
|
7554
7558
|
}, [u]);
|
|
7555
|
-
let [
|
|
7559
|
+
let [B, 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 } = $a({
|
|
7556
7560
|
forwardedRef: oe,
|
|
7557
7561
|
mobileBreakpoint: e,
|
|
7558
7562
|
tabletBreakpoint: t,
|
|
7559
7563
|
position: ne,
|
|
7560
7564
|
scrollBehavior: F
|
|
7561
7565
|
});
|
|
7562
|
-
eo((
|
|
7563
|
-
let
|
|
7566
|
+
eo((me || he) && q && R !== "none");
|
|
7567
|
+
let ye = o((e, t) => {
|
|
7564
7568
|
let n = e.relatedTarget, r;
|
|
7565
7569
|
switch (t) {
|
|
7566
7570
|
case "user":
|
|
7567
7571
|
r = H;
|
|
7568
7572
|
break;
|
|
7569
7573
|
case "slot":
|
|
7570
|
-
r =
|
|
7574
|
+
r = U;
|
|
7571
7575
|
break;
|
|
7572
7576
|
case "search":
|
|
7573
|
-
r =
|
|
7577
|
+
r = W;
|
|
7574
7578
|
break;
|
|
7575
7579
|
default: return;
|
|
7576
7580
|
}
|
|
@@ -7581,39 +7585,39 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7581
7585
|
let e = (e) => {
|
|
7582
7586
|
E && R === "user" && !e.target.closest(".pkt-header-service__user-container") && z("none"), R === "slot" && !e.target.closest(".pkt-header-service__slot-container") && z("none"), R === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && z("none");
|
|
7583
7587
|
}, t = (e) => {
|
|
7584
|
-
e.key === "Escape" && R !== "none" && (e.preventDefault(),
|
|
7588
|
+
e.key === "Escape" && R !== "none" && (e.preventDefault(), _e(), z("none"));
|
|
7585
7589
|
};
|
|
7586
7590
|
if (R !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
7587
7591
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
7588
7592
|
};
|
|
7589
|
-
|
|
7593
|
+
X();
|
|
7590
7594
|
}, [
|
|
7591
7595
|
R,
|
|
7592
7596
|
E,
|
|
7593
|
-
|
|
7594
|
-
|
|
7597
|
+
X,
|
|
7598
|
+
_e
|
|
7595
7599
|
]);
|
|
7596
|
-
let
|
|
7597
|
-
let t = e === "slot" ?
|
|
7598
|
-
if (!t.current || !n.current || !
|
|
7600
|
+
let be = o((e) => {
|
|
7601
|
+
let t = e === "slot" ? U : W, n = e === "slot" ? G : K;
|
|
7602
|
+
if (!t.current || !n.current || !pe || q) return;
|
|
7599
7603
|
let r = t.current.getBoundingClientRect(), i = n.current.offsetWidth, a = r.left + i > window.innerWidth;
|
|
7600
|
-
e === "slot" ?
|
|
7601
|
-
}, [
|
|
7602
|
-
if (!
|
|
7604
|
+
e === "slot" ? ue(a) : V(a);
|
|
7605
|
+
}, [pe, q]), Z = o((e) => {
|
|
7606
|
+
if (!pe || R !== "slot") return;
|
|
7603
7607
|
let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
|
|
7604
|
-
!t || !
|
|
7605
|
-
}, [
|
|
7606
|
-
R === "none" ? (
|
|
7607
|
-
}, [R,
|
|
7608
|
+
!t || !G.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || z("none");
|
|
7609
|
+
}, [pe, R]), Q = o((e) => {
|
|
7610
|
+
R === "none" ? (ge(), z(e)) : z("none");
|
|
7611
|
+
}, [R, ge]);
|
|
7608
7612
|
c(() => {
|
|
7609
7613
|
(R === "slot" || R === "search") && requestAnimationFrame(() => {
|
|
7610
|
-
|
|
7614
|
+
be(R);
|
|
7611
7615
|
});
|
|
7612
|
-
}, [R,
|
|
7616
|
+
}, [R, be]);
|
|
7613
7617
|
let xe = /* @__PURE__ */ v("header", {
|
|
7614
|
-
className: (0, M.default)("pkt-header-service", i && "pkt-header-service--compact",
|
|
7618
|
+
className: (0, M.default)("pkt-header-service", i && "pkt-header-service--compact", q && "pkt-header-service--mobile", pe && "pkt-header-service--tablet", me && "pkt-header-service--fixed", he && "pkt-header-service--sticky", se && "pkt-header-service--scroll-to-hide", J && "pkt-header-service--hidden", r),
|
|
7615
7619
|
"data-mode": a,
|
|
7616
|
-
ref:
|
|
7620
|
+
ref: fe,
|
|
7617
7621
|
children: [
|
|
7618
7622
|
/* @__PURE__ */ v("div", {
|
|
7619
7623
|
className: (0, M.default)("pkt-header-service__logo-area", (!T || T === "") && "pkt-header-service__logo-area--without-service"),
|
|
@@ -7646,18 +7650,18 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7646
7650
|
})
|
|
7647
7651
|
})]
|
|
7648
7652
|
}),
|
|
7649
|
-
n || d ||
|
|
7653
|
+
n || d || pe && l && (s === "header" || s === "both") ? /* @__PURE__ */ v("div", {
|
|
7650
7654
|
className: "pkt-header-service__content",
|
|
7651
7655
|
children: [
|
|
7652
7656
|
/* @__PURE__ */ v("div", {
|
|
7653
7657
|
className: (0, M.default)("pkt-header-service__slot-container", R === "slot" && "is-open"),
|
|
7654
|
-
onBlur: (e) =>
|
|
7655
|
-
ref:
|
|
7656
|
-
children: [
|
|
7658
|
+
onBlur: (e) => ye(e, "slot"),
|
|
7659
|
+
ref: U,
|
|
7660
|
+
children: [pe && n && /* @__PURE__ */ _(Y, {
|
|
7657
7661
|
skin: "secondary",
|
|
7658
7662
|
variant: re,
|
|
7659
7663
|
iconName: "menu",
|
|
7660
|
-
size:
|
|
7664
|
+
size: q ? "small" : "medium",
|
|
7661
7665
|
state: R === "slot" ? "active" : "normal",
|
|
7662
7666
|
onClick: () => Q("slot"),
|
|
7663
7667
|
"aria-expanded": R === "slot",
|
|
@@ -7665,11 +7669,11 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7665
7669
|
"aria-label": ce.openMenu,
|
|
7666
7670
|
children: ie
|
|
7667
7671
|
}), /* @__PURE__ */ _("div", {
|
|
7668
|
-
className: (0, M.default)("pkt-header-service__slot-content",
|
|
7672
|
+
className: (0, M.default)("pkt-header-service__slot-content", B && "align-right"),
|
|
7669
7673
|
id: "mobile-slot-menu",
|
|
7670
|
-
role:
|
|
7671
|
-
"aria-label":
|
|
7672
|
-
ref:
|
|
7674
|
+
role: pe ? "group" : void 0,
|
|
7675
|
+
"aria-label": pe ? "Meny" : void 0,
|
|
7676
|
+
ref: G,
|
|
7673
7677
|
onClick: Z,
|
|
7674
7678
|
children: /* @__PURE__ */ _("div", {
|
|
7675
7679
|
className: "pkt-contents",
|
|
@@ -7677,15 +7681,15 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7677
7681
|
})
|
|
7678
7682
|
})]
|
|
7679
7683
|
}),
|
|
7680
|
-
d && /* @__PURE__ */ _(g, { children:
|
|
7684
|
+
d && /* @__PURE__ */ _(g, { children: pe ? /* @__PURE__ */ v("div", {
|
|
7681
7685
|
className: (0, M.default)("pkt-header-service__search-container", R === "search" && "is-open"),
|
|
7682
|
-
onBlur: (e) =>
|
|
7683
|
-
ref:
|
|
7684
|
-
children: [/* @__PURE__ */ _(
|
|
7686
|
+
onBlur: (e) => ye(e, "search"),
|
|
7687
|
+
ref: W,
|
|
7688
|
+
children: [/* @__PURE__ */ _(Y, {
|
|
7685
7689
|
skin: "secondary",
|
|
7686
7690
|
variant: "icon-only",
|
|
7687
7691
|
iconName: "magnifying-glass-big",
|
|
7688
|
-
size:
|
|
7692
|
+
size: q ? "small" : "medium",
|
|
7689
7693
|
onClick: () => Q("search"),
|
|
7690
7694
|
state: R === "search" ? "active" : "normal",
|
|
7691
7695
|
"aria-expanded": R === "search",
|
|
@@ -7693,8 +7697,8 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7693
7697
|
"aria-label": ce.openSearch,
|
|
7694
7698
|
children: "Søk"
|
|
7695
7699
|
}), /* @__PURE__ */ _("div", {
|
|
7696
|
-
className: (0, M.default)("pkt-header-service__mobile-menu", R === "search" && "is-open",
|
|
7697
|
-
ref:
|
|
7700
|
+
className: (0, M.default)("pkt-header-service__mobile-menu", R === "search" && "is-open", de && "align-right"),
|
|
7701
|
+
ref: K,
|
|
7698
7702
|
children: R === "search" && /* @__PURE__ */ _(Co, {
|
|
7699
7703
|
id: "mobile-search-menu",
|
|
7700
7704
|
className: "pkt-header-service__search-input",
|
|
@@ -7724,9 +7728,9 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7724
7728
|
e.key === "Enter" && h?.(e.target.value);
|
|
7725
7729
|
}
|
|
7726
7730
|
}) }),
|
|
7727
|
-
|
|
7731
|
+
q && l && (s === "header" || s === "both") && /* @__PURE__ */ _(Y, {
|
|
7728
7732
|
skin: "secondary",
|
|
7729
|
-
size:
|
|
7733
|
+
size: q ? "small" : "medium",
|
|
7730
7734
|
variant: "icon-only",
|
|
7731
7735
|
iconName: "exit",
|
|
7732
7736
|
onClick: l,
|
|
@@ -7734,16 +7738,16 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7734
7738
|
})
|
|
7735
7739
|
]
|
|
7736
7740
|
}) : null,
|
|
7737
|
-
(E || !
|
|
7741
|
+
(E || !q && l && (s === "header" || s === "both")) && /* @__PURE__ */ v("div", {
|
|
7738
7742
|
className: "pkt-header-service__user",
|
|
7739
7743
|
children: [E && /* @__PURE__ */ v("div", {
|
|
7740
7744
|
className: "pkt-header-service__user-container",
|
|
7741
|
-
onBlur: (e) =>
|
|
7745
|
+
onBlur: (e) => ye(e, "user"),
|
|
7742
7746
|
ref: H,
|
|
7743
|
-
children: [/* @__PURE__ */ v(
|
|
7744
|
-
className: (0, M.default)("pkt-header-service__user-button",
|
|
7747
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
7748
|
+
className: (0, M.default)("pkt-header-service__user-button", q && "pkt-header-service__user-button--mobile"),
|
|
7745
7749
|
skin: "secondary",
|
|
7746
|
-
size:
|
|
7750
|
+
size: q ? "small" : "medium",
|
|
7747
7751
|
state: R === "user" ? "active" : "normal",
|
|
7748
7752
|
variant: "icons-right-and-left",
|
|
7749
7753
|
iconName: "user",
|
|
@@ -7757,7 +7761,7 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7757
7761
|
children: S?.name || E.name
|
|
7758
7762
|
})]
|
|
7759
7763
|
}), R === "user" && E && /* @__PURE__ */ _("div", {
|
|
7760
|
-
className: (0, M.default)(
|
|
7764
|
+
className: (0, M.default)(q ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
|
|
7761
7765
|
children: /* @__PURE__ */ _(ho, {
|
|
7762
7766
|
user: E,
|
|
7763
7767
|
formattedLastLoggedIn: le,
|
|
@@ -7768,7 +7772,7 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7768
7772
|
logoutOnClick: s === "userMenu" || s === "both" ? l : void 0
|
|
7769
7773
|
})
|
|
7770
7774
|
})]
|
|
7771
|
-
}), !
|
|
7775
|
+
}), !q && l && (s === "header" || s === "both") && /* @__PURE__ */ _(Y, {
|
|
7772
7776
|
skin: "tertiary",
|
|
7773
7777
|
size: "medium",
|
|
7774
7778
|
variant: "icon-right",
|
|
@@ -7779,9 +7783,9 @@ var To = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7779
7783
|
})
|
|
7780
7784
|
]
|
|
7781
7785
|
});
|
|
7782
|
-
return
|
|
7786
|
+
return me ? /* @__PURE__ */ v("div", {
|
|
7783
7787
|
className: "pkt-header-service-wrapper",
|
|
7784
|
-
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",
|
|
7788
|
+
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") })]
|
|
7785
7789
|
}) : xe;
|
|
7786
7790
|
});
|
|
7787
7791
|
To.displayName = "PktHeaderService";
|
|
@@ -7818,7 +7822,7 @@ Do.displayName = "PktInput";
|
|
|
7818
7822
|
//#endregion
|
|
7819
7823
|
//#region src/components/linkcard/LinkCard.tsx
|
|
7820
7824
|
var Oo = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab: a, external: o, className: s, strings: c, ...l }) => {
|
|
7821
|
-
let u =
|
|
7825
|
+
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(" ");
|
|
7822
7826
|
return /* @__PURE__ */ v("a", {
|
|
7823
7827
|
...l,
|
|
7824
7828
|
href: r,
|
|
@@ -7930,7 +7934,7 @@ jo.displayName = "PktMessagebox";
|
|
|
7930
7934
|
//#endregion
|
|
7931
7935
|
//#region src/components/radio/RadioButton.tsx
|
|
7932
7936
|
var Mo = 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) => {
|
|
7933
|
-
let S =
|
|
7937
|
+
let S = ve(["forms"], m), C = Jn(e), w = [r, "pkt-input-check"].filter(Boolean).join(" "), T = [
|
|
7934
7938
|
"pkt-input-check__input",
|
|
7935
7939
|
i ? "pkt-input-check__input--tile" : "",
|
|
7936
7940
|
a && i ? "pkt-input-check__input--tile-disabled" : ""
|
|
@@ -8354,37 +8358,37 @@ function is(e) {
|
|
|
8354
8358
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
8355
8359
|
}
|
|
8356
8360
|
function as(e, t) {
|
|
8357
|
-
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 =
|
|
8358
|
-
|
|
8359
|
-
}, []),
|
|
8360
|
-
|
|
8361
|
-
}, []), [
|
|
8361
|
+
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, ce = te, I = i !== void 0, L = i === void 0 ? a ?? "" : i ?? "", le = p(L), [R, z] = m(() => L), B = I ? i ?? "" : R, [ue, de] = m(() => ts(i === void 0 ? a : i)[0]), [V, H] = m(() => ts(i === void 0 ? a : i)[1]), U = p(ue), W = p(V), G = o((e) => {
|
|
8362
|
+
U.current = e, de(e);
|
|
8363
|
+
}, []), K = o((e) => {
|
|
8364
|
+
W.current = e, H(e);
|
|
8365
|
+
}, []), [fe, q] = m(!1), [pe, me] = m(!1), he = p(i);
|
|
8362
8366
|
c(() => {
|
|
8363
|
-
if (!I || i ===
|
|
8364
|
-
|
|
8367
|
+
if (!I || i === he.current) return;
|
|
8368
|
+
he.current = i;
|
|
8365
8369
|
let [e, t] = ts(i);
|
|
8366
|
-
|
|
8370
|
+
G(e), K(t);
|
|
8367
8371
|
}, [
|
|
8368
8372
|
i,
|
|
8369
8373
|
I,
|
|
8370
|
-
|
|
8371
|
-
|
|
8374
|
+
G,
|
|
8375
|
+
K
|
|
8372
8376
|
]), c(() => {
|
|
8373
8377
|
h != null && !is(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).`);
|
|
8374
8378
|
}, [h]);
|
|
8375
|
-
let
|
|
8379
|
+
let J = p(null), ge = p(null), Y = p(null), _e = p(null), X = p(null), ye = p(null), be = Er(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(() => Yo(h), [h]), De = f(() => Xo(s, l), [s, l]), Oe = f(() => Zo(h), [h]), ke = `${n}-hours`, Ae = `${n}-minutes`, je = `${n}-popup`, Me = `${n}-input`;
|
|
8376
8380
|
c(() => {
|
|
8377
|
-
let e =
|
|
8381
|
+
let e = J.current;
|
|
8378
8382
|
if (!e) return;
|
|
8379
|
-
let t = rs(
|
|
8383
|
+
let t = rs(B, {
|
|
8380
8384
|
required: S,
|
|
8381
8385
|
min: s,
|
|
8382
8386
|
max: l,
|
|
8383
8387
|
step: h
|
|
8384
8388
|
}, oe.validation);
|
|
8385
|
-
e.setCustomValidity(t.valid ? "" : t.message ?? ""),
|
|
8389
|
+
e.setCustomValidity(t.valid ? "" : t.message ?? ""), me(Ce && !t.valid);
|
|
8386
8390
|
}, [
|
|
8387
|
-
|
|
8391
|
+
B,
|
|
8388
8392
|
S,
|
|
8389
8393
|
s,
|
|
8390
8394
|
l,
|
|
@@ -8392,29 +8396,29 @@ function as(e, t) {
|
|
|
8392
8396
|
Ce,
|
|
8393
8397
|
oe.validation
|
|
8394
8398
|
]);
|
|
8395
|
-
let
|
|
8399
|
+
let $ = o((e) => {
|
|
8396
8400
|
I || z(e);
|
|
8397
|
-
let t =
|
|
8401
|
+
let t = ye.current;
|
|
8398
8402
|
!t || !Te || (Te.call(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), re?.(e));
|
|
8399
8403
|
}, [
|
|
8400
8404
|
I,
|
|
8401
8405
|
Te,
|
|
8402
8406
|
re
|
|
8403
8407
|
]), Ne = o(() => {
|
|
8404
|
-
let e =
|
|
8408
|
+
let e = U.current, t = W.current;
|
|
8405
8409
|
if (e !== "" && t !== "") {
|
|
8406
8410
|
let n = ns(e, t);
|
|
8407
|
-
n !==
|
|
8408
|
-
} else
|
|
8409
|
-
}, [
|
|
8410
|
-
let e =
|
|
8411
|
+
n !== B && $(n);
|
|
8412
|
+
} else B !== "" && $("");
|
|
8413
|
+
}, [B, $]), Pe = o(() => {
|
|
8414
|
+
let e = U.current, t = W.current;
|
|
8411
8415
|
if (e !== "" && t !== "") {
|
|
8412
8416
|
let n = ns(e, t);
|
|
8413
|
-
n ===
|
|
8414
|
-
} else
|
|
8415
|
-
}, [
|
|
8417
|
+
n === B ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(n);
|
|
8418
|
+
} else B === "" ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $("");
|
|
8419
|
+
}, [B, $]), Fe = o(() => {
|
|
8416
8420
|
we(!0), Ne();
|
|
8417
|
-
let e =
|
|
8421
|
+
let e = J.current, t = ye.current;
|
|
8418
8422
|
if (!e) return;
|
|
8419
8423
|
let n = rs(t?.value ?? "", {
|
|
8420
8424
|
required: S,
|
|
@@ -8432,25 +8436,25 @@ function as(e, t) {
|
|
|
8432
8436
|
oe.validation
|
|
8433
8437
|
]);
|
|
8434
8438
|
c(() => {
|
|
8435
|
-
if (!
|
|
8439
|
+
if (!be) return;
|
|
8436
8440
|
let e = (e) => {
|
|
8437
8441
|
let t = e;
|
|
8438
|
-
if (!t || !
|
|
8442
|
+
if (!t || !be.contains(t)) return !1;
|
|
8439
8443
|
let n = t.closest("button, input[type=\"submit\"], input[type=\"image\"]");
|
|
8440
|
-
return !n || !
|
|
8444
|
+
return !n || !be.contains(n) ? !1 : n instanceof HTMLButtonElement ? n.type !== "button" && n.type !== "reset" : n instanceof HTMLInputElement;
|
|
8441
8445
|
}, t = (t) => {
|
|
8442
8446
|
e(t.target) && Fe();
|
|
8443
8447
|
};
|
|
8444
|
-
return
|
|
8445
|
-
}, [Fe,
|
|
8446
|
-
|
|
8447
|
-
}, [
|
|
8448
|
+
return be.addEventListener("pointerdown", t, !0), () => be.removeEventListener("pointerdown", t, !0);
|
|
8449
|
+
}, [Fe, be]), c(() => {
|
|
8450
|
+
ye.current && (ye.current.value = B);
|
|
8451
|
+
}, [B]);
|
|
8448
8452
|
let Ie = o(() => {
|
|
8449
|
-
|
|
8453
|
+
q(!1), Ne();
|
|
8450
8454
|
}, [Ne]);
|
|
8451
8455
|
d(() => {
|
|
8452
|
-
if (!
|
|
8453
|
-
let e =
|
|
8456
|
+
if (!fe) return;
|
|
8457
|
+
let e = _e.current;
|
|
8454
8458
|
if (!e) return;
|
|
8455
8459
|
e.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8456
8460
|
let t = e.querySelector(".pkt-timepicker-popup__option--selected");
|
|
@@ -8460,16 +8464,16 @@ function as(e, t) {
|
|
|
8460
8464
|
if (!t) return;
|
|
8461
8465
|
let n = t.querySelector(".pkt-timepicker-popup__option--selected"), r = t.querySelector(".pkt-timepicker-popup__option");
|
|
8462
8466
|
(n || r)?.focus();
|
|
8463
|
-
}, [
|
|
8464
|
-
if (!
|
|
8467
|
+
}, [fe]), c(() => {
|
|
8468
|
+
if (!fe) return;
|
|
8465
8469
|
let e = (e) => {
|
|
8466
8470
|
let t = e.target;
|
|
8467
|
-
|
|
8471
|
+
X.current && !X.current.contains(t) && Ie();
|
|
8468
8472
|
};
|
|
8469
8473
|
return document.addEventListener("click", e, !0), () => document.removeEventListener("click", e, !0);
|
|
8470
|
-
}, [
|
|
8474
|
+
}, [fe, Ie]);
|
|
8471
8475
|
let Le = o((e) => {
|
|
8472
|
-
let t =
|
|
8476
|
+
let t = _e.current;
|
|
8473
8477
|
if (!t) return;
|
|
8474
8478
|
let n = t.querySelectorAll(".pkt-timepicker-popup__col"), r = e === "hour" ? n[0] : n[1];
|
|
8475
8479
|
if (!r) return;
|
|
@@ -8477,56 +8481,56 @@ function as(e, t) {
|
|
|
8477
8481
|
(i || a)?.focus();
|
|
8478
8482
|
}, []), Re = o((e, t) => {
|
|
8479
8483
|
let n = String(e).padStart(2, "0");
|
|
8480
|
-
if (t === "hour")
|
|
8484
|
+
if (t === "hour") G(n), requestAnimationFrame(() => Le("minute"));
|
|
8481
8485
|
else {
|
|
8482
|
-
|
|
8483
|
-
let e =
|
|
8484
|
-
e !== "" &&
|
|
8486
|
+
K(n), q(!1);
|
|
8487
|
+
let e = U.current;
|
|
8488
|
+
e !== "" && $(`${e}:${n}`), requestAnimationFrame(() => Y.current?.focus());
|
|
8485
8489
|
}
|
|
8486
8490
|
}, [
|
|
8487
|
-
|
|
8491
|
+
$,
|
|
8488
8492
|
Le,
|
|
8489
|
-
|
|
8490
|
-
|
|
8493
|
+
G,
|
|
8494
|
+
K
|
|
8491
8495
|
]), ze = o((e) => {
|
|
8492
|
-
let t = Qo(
|
|
8493
|
-
|
|
8496
|
+
let t = Qo(U.current, W.current, e, Ee);
|
|
8497
|
+
G(t.hours), K(t.minutes), `${t.hours}:${t.minutes}` !== B && $(`${t.hours}:${t.minutes}`);
|
|
8494
8498
|
}, [
|
|
8499
|
+
Ee,
|
|
8500
|
+
B,
|
|
8495
8501
|
$,
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
W,
|
|
8499
|
-
G
|
|
8502
|
+
G,
|
|
8503
|
+
K
|
|
8500
8504
|
]), Be = o((e) => {
|
|
8501
|
-
|
|
8502
|
-
let t = e.currentTarget, n =
|
|
8505
|
+
J.current?.setCustomValidity("");
|
|
8506
|
+
let t = e.currentTarget, n = W.current;
|
|
8503
8507
|
switch (e.key) {
|
|
8504
8508
|
case "ArrowUp": {
|
|
8505
8509
|
e.preventDefault();
|
|
8506
|
-
let t =
|
|
8507
|
-
if (
|
|
8510
|
+
let t = U.current === "" ? 0 : parseInt(U.current, 10), r = String((t + 1) % 24).padStart(2, "0");
|
|
8511
|
+
if (G(r), n !== "") {
|
|
8508
8512
|
let e = `${r}:${n}`;
|
|
8509
|
-
e ===
|
|
8513
|
+
e === B ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(e);
|
|
8510
8514
|
}
|
|
8511
8515
|
break;
|
|
8512
8516
|
}
|
|
8513
8517
|
case "ArrowDown": {
|
|
8514
8518
|
e.preventDefault();
|
|
8515
|
-
let t =
|
|
8516
|
-
if (
|
|
8519
|
+
let t = U.current === "" ? 0 : parseInt(U.current, 10), r = String((t - 1 + 24) % 24).padStart(2, "0");
|
|
8520
|
+
if (G(r), n !== "") {
|
|
8517
8521
|
let e = `${r}:${n}`;
|
|
8518
|
-
e ===
|
|
8522
|
+
e === B ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(e);
|
|
8519
8523
|
}
|
|
8520
8524
|
break;
|
|
8521
8525
|
}
|
|
8522
8526
|
case "ArrowRight":
|
|
8523
|
-
e.preventDefault(),
|
|
8527
|
+
e.preventDefault(), ge.current?.focus();
|
|
8524
8528
|
break;
|
|
8525
8529
|
case "Backspace":
|
|
8526
8530
|
case "Delete": {
|
|
8527
8531
|
e.preventDefault(), Z.current = 0, Q.current = -1;
|
|
8528
|
-
let t =
|
|
8529
|
-
t.length > 0 &&
|
|
8532
|
+
let t = U.current;
|
|
8533
|
+
t.length > 0 && G(t.slice(0, -1)), Pe();
|
|
8530
8534
|
break;
|
|
8531
8535
|
}
|
|
8532
8536
|
case "Tab": break;
|
|
@@ -8542,55 +8546,55 @@ function as(e, t) {
|
|
|
8542
8546
|
if (Z.current === 0) {
|
|
8543
8547
|
Q.current = t;
|
|
8544
8548
|
let e = String(t).padStart(2, "0");
|
|
8545
|
-
|
|
8549
|
+
G(e), Z.current = 1, ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 3 && (Q.current = -1, Z.current = 0, Pe(), ge.current?.focus());
|
|
8546
8550
|
} else {
|
|
8547
8551
|
let e = Q.current * 10 + t, n = e <= 23 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
|
|
8548
|
-
|
|
8552
|
+
G(n), Q.current = -1, Z.current = 0, Pe(), ge.current?.focus();
|
|
8549
8553
|
}
|
|
8550
8554
|
} else e.preventDefault();
|
|
8551
8555
|
}
|
|
8552
8556
|
}, [
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8557
|
+
B,
|
|
8558
|
+
$,
|
|
8559
|
+
G,
|
|
8556
8560
|
Pe,
|
|
8557
8561
|
Fe
|
|
8558
8562
|
]), Ve = o(() => {
|
|
8559
|
-
if (we(!0),
|
|
8560
|
-
let e = String(parseInt(
|
|
8561
|
-
|
|
8563
|
+
if (we(!0), U.current !== "") {
|
|
8564
|
+
let e = String(parseInt(U.current, 10)).padStart(2, "0");
|
|
8565
|
+
G(e);
|
|
8562
8566
|
}
|
|
8563
8567
|
Z.current = 0, Q.current = -1, Ne();
|
|
8564
|
-
}, [
|
|
8565
|
-
|
|
8566
|
-
let t = e.currentTarget, n =
|
|
8568
|
+
}, [G, Ne]), He = o((e) => {
|
|
8569
|
+
J.current?.setCustomValidity("");
|
|
8570
|
+
let t = e.currentTarget, n = U.current;
|
|
8567
8571
|
switch (e.key) {
|
|
8568
8572
|
case "ArrowUp": {
|
|
8569
8573
|
e.preventDefault();
|
|
8570
|
-
let t =
|
|
8571
|
-
if (
|
|
8574
|
+
let t = W.current === "" ? 0 : parseInt(W.current, 10), r = String((t + Ee) % 60).padStart(2, "0");
|
|
8575
|
+
if (K(r), n !== "") {
|
|
8572
8576
|
let e = `${n}:${r}`;
|
|
8573
|
-
e ===
|
|
8577
|
+
e === B ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(e);
|
|
8574
8578
|
}
|
|
8575
8579
|
break;
|
|
8576
8580
|
}
|
|
8577
8581
|
case "ArrowDown": {
|
|
8578
8582
|
e.preventDefault();
|
|
8579
|
-
let t =
|
|
8580
|
-
if (
|
|
8583
|
+
let t = W.current === "" ? 0 : parseInt(W.current, 10), r = String((t - Ee + 60) % 60).padStart(2, "0");
|
|
8584
|
+
if (K(r), n !== "") {
|
|
8581
8585
|
let e = `${n}:${r}`;
|
|
8582
|
-
e ===
|
|
8586
|
+
e === B ? ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : $(e);
|
|
8583
8587
|
}
|
|
8584
8588
|
break;
|
|
8585
8589
|
}
|
|
8586
8590
|
case "ArrowLeft":
|
|
8587
|
-
e.preventDefault(),
|
|
8591
|
+
e.preventDefault(), J.current?.focus();
|
|
8588
8592
|
break;
|
|
8589
8593
|
case "Backspace":
|
|
8590
8594
|
case "Delete": {
|
|
8591
8595
|
e.preventDefault(), xe.current = 0, Se.current = -1;
|
|
8592
|
-
let t =
|
|
8593
|
-
t.length > 0 &&
|
|
8596
|
+
let t = W.current;
|
|
8597
|
+
t.length > 0 && K(t.slice(0, -1)), Pe();
|
|
8594
8598
|
break;
|
|
8595
8599
|
}
|
|
8596
8600
|
case "Tab": break;
|
|
@@ -8606,33 +8610,33 @@ function as(e, t) {
|
|
|
8606
8610
|
if (xe.current === 0) {
|
|
8607
8611
|
Se.current = t;
|
|
8608
8612
|
let e = String(t).padStart(2, "0");
|
|
8609
|
-
|
|
8613
|
+
K(e), xe.current = 1, ye.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 6 && (Se.current = -1, xe.current = 0, Pe());
|
|
8610
8614
|
} else {
|
|
8611
8615
|
let e = Se.current * 10 + t, n = e <= 59 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
|
|
8612
|
-
|
|
8616
|
+
K(n), Se.current = -1, xe.current = 0, Pe();
|
|
8613
8617
|
}
|
|
8614
8618
|
} else e.preventDefault();
|
|
8615
8619
|
}
|
|
8616
8620
|
}, [
|
|
8621
|
+
Ee,
|
|
8622
|
+
B,
|
|
8617
8623
|
$,
|
|
8618
|
-
|
|
8619
|
-
Me,
|
|
8620
|
-
G,
|
|
8624
|
+
K,
|
|
8621
8625
|
Pe,
|
|
8622
8626
|
Fe
|
|
8623
8627
|
]), Ue = o(() => {
|
|
8624
|
-
if (we(!0),
|
|
8625
|
-
let e = String(parseInt(
|
|
8626
|
-
|
|
8628
|
+
if (we(!0), W.current !== "") {
|
|
8629
|
+
let e = String(parseInt(W.current, 10)).padStart(2, "0");
|
|
8630
|
+
K(e);
|
|
8627
8631
|
}
|
|
8628
8632
|
xe.current = 0, Se.current = -1, Ne();
|
|
8629
|
-
}, [
|
|
8633
|
+
}, [K, Ne]), We = o((e) => {
|
|
8630
8634
|
let t = document.activeElement, n = t.closest(".pkt-timepicker-popup__col");
|
|
8631
8635
|
if (!n) return;
|
|
8632
8636
|
let r = Array.from(n.querySelectorAll(".pkt-timepicker-popup__option")), i = r.indexOf(t), a = (e) => {
|
|
8633
8637
|
if (!e) return;
|
|
8634
8638
|
let n = parseInt(e.dataset.value ?? "0", 10), r = String(n).padStart(2, "0");
|
|
8635
|
-
t.dataset.type === "hour" ?
|
|
8639
|
+
t.dataset.type === "hour" ? G(r) : K(r), e.focus();
|
|
8636
8640
|
};
|
|
8637
8641
|
switch (e.key) {
|
|
8638
8642
|
case "ArrowDown":
|
|
@@ -8650,8 +8654,8 @@ function as(e, t) {
|
|
|
8650
8654
|
case "ArrowRight":
|
|
8651
8655
|
if (e.preventDefault(), t.dataset.type === "hour") {
|
|
8652
8656
|
let e = parseInt(t.dataset.value ?? "0", 10);
|
|
8653
|
-
|
|
8654
|
-
|
|
8657
|
+
G(String(e).padStart(2, "0")), requestAnimationFrame(() => {
|
|
8658
|
+
_e.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8655
8659
|
e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
|
|
8656
8660
|
}), Le("minute");
|
|
8657
8661
|
});
|
|
@@ -8660,8 +8664,8 @@ function as(e, t) {
|
|
|
8660
8664
|
case "ArrowLeft":
|
|
8661
8665
|
if (e.preventDefault(), t.dataset.type === "minute") {
|
|
8662
8666
|
let e = parseInt(t.dataset.value ?? "0", 10);
|
|
8663
|
-
|
|
8664
|
-
|
|
8667
|
+
K(String(e).padStart(2, "0")), requestAnimationFrame(() => {
|
|
8668
|
+
_e.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8665
8669
|
e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
|
|
8666
8670
|
}), Le("hour");
|
|
8667
8671
|
});
|
|
@@ -8671,72 +8675,72 @@ function as(e, t) {
|
|
|
8671
8675
|
case " ":
|
|
8672
8676
|
e.preventDefault(), t.click();
|
|
8673
8677
|
break;
|
|
8674
|
-
case "Escape": e.preventDefault(), Ie(),
|
|
8678
|
+
case "Escape": e.preventDefault(), Ie(), Y.current?.focus();
|
|
8675
8679
|
}
|
|
8676
8680
|
}, [
|
|
8677
8681
|
Ie,
|
|
8678
8682
|
Le,
|
|
8679
|
-
|
|
8680
|
-
|
|
8683
|
+
G,
|
|
8684
|
+
K
|
|
8681
8685
|
]), Ge = o((e) => {
|
|
8682
|
-
let t =
|
|
8686
|
+
let t = _e.current;
|
|
8683
8687
|
if (!t) return;
|
|
8684
8688
|
let n = e.relatedTarget;
|
|
8685
8689
|
(!n || !t.contains(n)) && Ie();
|
|
8686
8690
|
}, [Ie]), Ke = o((e) => {
|
|
8687
|
-
let t =
|
|
8691
|
+
let t = X.current;
|
|
8688
8692
|
if (!t) return;
|
|
8689
8693
|
let n = e.relatedTarget;
|
|
8690
8694
|
n && t.contains(n) || ie?.(e);
|
|
8691
8695
|
}, [ie]), qe = o((e) => {
|
|
8692
|
-
let t =
|
|
8696
|
+
let t = X.current;
|
|
8693
8697
|
if (!t) return;
|
|
8694
8698
|
let n = e.relatedTarget;
|
|
8695
8699
|
n && t.contains(n) || ae?.(e);
|
|
8696
8700
|
}, [ae]), Je = o(() => {
|
|
8697
|
-
x || (
|
|
8701
|
+
x || (fe ? Ie() : q(!0));
|
|
8698
8702
|
}, [
|
|
8699
8703
|
x,
|
|
8700
|
-
|
|
8704
|
+
fe,
|
|
8701
8705
|
Ie
|
|
8702
8706
|
]);
|
|
8703
8707
|
return u(t, () => ({
|
|
8704
8708
|
get value() {
|
|
8705
|
-
return
|
|
8709
|
+
return ye.current?.value ?? "";
|
|
8706
8710
|
},
|
|
8707
8711
|
set value(e) {
|
|
8708
8712
|
let t = e ?? "";
|
|
8709
8713
|
I || z(t);
|
|
8710
8714
|
let [n, r] = ts(t);
|
|
8711
|
-
|
|
8715
|
+
G(n), K(r), ye.current && (ye.current.value = t);
|
|
8712
8716
|
},
|
|
8713
8717
|
focus() {
|
|
8714
|
-
|
|
8718
|
+
J.current?.focus();
|
|
8715
8719
|
},
|
|
8716
8720
|
blur() {
|
|
8717
|
-
|
|
8721
|
+
J.current?.blur();
|
|
8718
8722
|
}
|
|
8719
8723
|
}), [
|
|
8720
8724
|
I,
|
|
8721
|
-
|
|
8722
|
-
|
|
8725
|
+
G,
|
|
8726
|
+
K
|
|
8723
8727
|
]), c(() => {
|
|
8724
|
-
if (!
|
|
8728
|
+
if (!be) return;
|
|
8725
8729
|
let e = () => {
|
|
8726
8730
|
window.setTimeout(() => {
|
|
8727
8731
|
let e = le.current, [t, n] = ts(e);
|
|
8728
|
-
|
|
8732
|
+
G(t), K(n), I || z(e), ye.current && (ye.current.value = e), q(!1), we(!1);
|
|
8729
8733
|
}, 0);
|
|
8730
8734
|
};
|
|
8731
|
-
return
|
|
8735
|
+
return be.addEventListener("reset", e), () => be.removeEventListener("reset", e);
|
|
8732
8736
|
}, [
|
|
8733
8737
|
I,
|
|
8734
|
-
W,
|
|
8735
8738
|
G,
|
|
8736
|
-
|
|
8739
|
+
K,
|
|
8740
|
+
be
|
|
8737
8741
|
]), {
|
|
8738
8742
|
id: n,
|
|
8739
|
-
containerRef:
|
|
8743
|
+
containerRef: X,
|
|
8740
8744
|
outerClasses: [
|
|
8741
8745
|
"pkt-timepicker",
|
|
8742
8746
|
`pkt-timepicker--${F}`,
|
|
@@ -8754,7 +8758,7 @@ function as(e, t) {
|
|
|
8754
8758
|
helptextDropdown: w,
|
|
8755
8759
|
helptextDropdownButton: T,
|
|
8756
8760
|
hasError: E,
|
|
8757
|
-
isInvalid:
|
|
8761
|
+
isInvalid: pe,
|
|
8758
8762
|
errorMessage: D,
|
|
8759
8763
|
optionalTag: O,
|
|
8760
8764
|
optionalText: k,
|
|
@@ -8769,22 +8773,22 @@ function as(e, t) {
|
|
|
8769
8773
|
min: s,
|
|
8770
8774
|
max: l,
|
|
8771
8775
|
step: h,
|
|
8772
|
-
hours:
|
|
8776
|
+
hours: ue,
|
|
8773
8777
|
minutes: V,
|
|
8774
|
-
hoursId:
|
|
8775
|
-
minutesId:
|
|
8776
|
-
popupId:
|
|
8777
|
-
hiddenInputId:
|
|
8778
|
+
hoursId: ke,
|
|
8779
|
+
minutesId: Ae,
|
|
8780
|
+
popupId: je,
|
|
8781
|
+
hiddenInputId: Me,
|
|
8778
8782
|
name: y ?? n,
|
|
8779
8783
|
form: b,
|
|
8780
|
-
isOpen:
|
|
8781
|
-
hourOptions:
|
|
8782
|
-
minuteOptions:
|
|
8783
|
-
hoursInputRef:
|
|
8784
|
-
minutesInputRef:
|
|
8785
|
-
buttonRef:
|
|
8786
|
-
popupRef:
|
|
8787
|
-
changeInputRef:
|
|
8784
|
+
isOpen: fe,
|
|
8785
|
+
hourOptions: De,
|
|
8786
|
+
minuteOptions: Oe,
|
|
8787
|
+
hoursInputRef: J,
|
|
8788
|
+
minutesInputRef: ge,
|
|
8789
|
+
buttonRef: Y,
|
|
8790
|
+
popupRef: _e,
|
|
8791
|
+
changeInputRef: ye,
|
|
8788
8792
|
handleHoursKeydown: Be,
|
|
8789
8793
|
handleHoursBlur: Ve,
|
|
8790
8794
|
handleMinutesKeydown: He,
|
|
@@ -8797,13 +8801,17 @@ function as(e, t) {
|
|
|
8797
8801
|
handleClockButtonClick: Je,
|
|
8798
8802
|
closePopup: Ie,
|
|
8799
8803
|
stepTimeDelta: ze,
|
|
8800
|
-
effectiveValue:
|
|
8804
|
+
effectiveValue: B
|
|
8801
8805
|
};
|
|
8802
8806
|
}
|
|
8803
8807
|
//#endregion
|
|
8804
8808
|
//#region src/components/timepicker/Timepicker.tsx
|
|
8805
8809
|
var os = i((e, t) => {
|
|
8806
|
-
let { onChange: n, inputSize: r = "medium" } = e, i = as(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 = (
|
|
8810
|
+
let { onChange: n, inputSize: r = "medium" } = e, i = as(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 = Zn({
|
|
8811
|
+
id: i.hoursId,
|
|
8812
|
+
hasHelptext: !!i.helptext,
|
|
8813
|
+
ariaDescribedby: i.ariaDescribedby
|
|
8814
|
+
}), u = (e, t) => {
|
|
8807
8815
|
let n = String(e).padStart(2, "0"), r = e === (t === "hour" ? i.hours === "" ? NaN : parseInt(i.hours, 10) : i.minutes === "" ? NaN : parseInt(i.minutes, 10));
|
|
8808
8816
|
return /* @__PURE__ */ _("button", {
|
|
8809
8817
|
type: "button",
|
|
@@ -8828,7 +8836,7 @@ var os = i((e, t) => {
|
|
|
8828
8836
|
children: n
|
|
8829
8837
|
})
|
|
8830
8838
|
}, `${t}-${e}`);
|
|
8831
|
-
},
|
|
8839
|
+
}, d = () => /* @__PURE__ */ v("div", {
|
|
8832
8840
|
ref: i.popupRef,
|
|
8833
8841
|
className: "pkt-timepicker-popup",
|
|
8834
8842
|
id: i.popupId,
|
|
@@ -8842,15 +8850,15 @@ var os = i((e, t) => {
|
|
|
8842
8850
|
role: "listbox",
|
|
8843
8851
|
"aria-label": a,
|
|
8844
8852
|
"aria-orientation": "vertical",
|
|
8845
|
-
children: i.hourOptions.map((e) =>
|
|
8853
|
+
children: i.hourOptions.map((e) => u(e, "hour"))
|
|
8846
8854
|
}), /* @__PURE__ */ _("div", {
|
|
8847
8855
|
className: "pkt-timepicker-popup__col",
|
|
8848
8856
|
role: "listbox",
|
|
8849
8857
|
"aria-label": o,
|
|
8850
8858
|
"aria-orientation": "vertical",
|
|
8851
|
-
children: i.minuteOptions.map((e) =>
|
|
8859
|
+
children: i.minuteOptions.map((e) => u(e, "minute"))
|
|
8852
8860
|
})]
|
|
8853
|
-
}),
|
|
8861
|
+
}), f = () => /* @__PURE__ */ v("div", {
|
|
8854
8862
|
className: `pkt-input__container pkt-input__container--${r}`,
|
|
8855
8863
|
onClick: (e) => {
|
|
8856
8864
|
e.target.closest("button, input") || i.hoursInputRef.current?.focus();
|
|
@@ -8883,6 +8891,7 @@ var os = i((e, t) => {
|
|
|
8883
8891
|
role: "spinbutton",
|
|
8884
8892
|
"aria-invalid": i.hasError || i.isInvalid || void 0,
|
|
8885
8893
|
"aria-errormessage": i.hasError ? `${i.hoursId}-error` : void 0,
|
|
8894
|
+
"aria-describedby": l,
|
|
8886
8895
|
"aria-valuemin": 0,
|
|
8887
8896
|
"aria-valuemax": 23,
|
|
8888
8897
|
"aria-valuenow": i.hours === "" ? void 0 : parseInt(i.hours, 10),
|
|
@@ -8917,6 +8926,7 @@ var os = i((e, t) => {
|
|
|
8917
8926
|
role: "spinbutton",
|
|
8918
8927
|
"aria-invalid": i.hasError || i.isInvalid || void 0,
|
|
8919
8928
|
"aria-errormessage": i.hasError ? `${i.hoursId}-error` : void 0,
|
|
8929
|
+
"aria-describedby": l,
|
|
8920
8930
|
"aria-valuemin": 0,
|
|
8921
8931
|
"aria-valuemax": 59,
|
|
8922
8932
|
"aria-valuenow": i.minutes === "" ? void 0 : parseInt(i.minutes, 10),
|
|
@@ -9004,11 +9014,11 @@ var os = i((e, t) => {
|
|
|
9004
9014
|
size: r,
|
|
9005
9015
|
children: !i.hidePicker && !i.stepArrows ? /* @__PURE__ */ v("div", {
|
|
9006
9016
|
className: "pkt-timepicker__anchor",
|
|
9007
|
-
children: [
|
|
9008
|
-
}) :
|
|
9017
|
+
children: [f(), d()]
|
|
9018
|
+
}) : f()
|
|
9009
9019
|
})
|
|
9010
9020
|
});
|
|
9011
9021
|
});
|
|
9012
9022
|
os.displayName = "PktTimepicker";
|
|
9013
9023
|
//#endregion
|
|
9014
|
-
export { xi as FileItem, Sa as ItemRenderers, j as PktAccordion, L as PktAccordionItem,
|
|
9024
|
+
export { xi as FileItem, Sa as ItemRenderers, j as PktAccordion, L as PktAccordionItem, ye as PktAlert, be as PktBackLink, Z as PktBreadcrumbs, Y as PktButton, Ln as PktCalendar, Gn as PktCard, Yn as PktCheckbox, kr as PktCombobox, Pr as PktConsent, Yr as PktDatepicker, Ca as PktFileUpload, Ya as PktFooter, Za as PktFooterSimple, Eo as PktHeader, So as PktHeaderGlobal, to as PktHeaderMenu, To as PktHeaderService, Un as PktHeading, nr as PktHelptext, I as PktIcon, Do as PktInput, rr as PktInputWrapper, uo as PktLink, Oo as PktLinkCard, Ao as PktLoader, jo as PktMessagebox, $i as PktModal, Hi as PktProgressbar, Mo as PktRadioButton, go as PktSearchInput, No as PktSelect, Lo as PktStep, Ro as PktStepper, X as PktStringsProvider, Go as PktTabItem, zo as PktTable, Bo as PktTableBody, Vo as PktTableDataCell, Ho as PktTableHeader, Uo as PktTableHeaderCell, Wo as PktTableRow, Jo as PktTabs, Wn as PktTag, Ti as PktTextarea, Co as PktTextinput, os as PktTimepicker, W as getPktStrings, le as pktStringsNb, G as resetPktStrings, U as setPktStrings, K as subscribePktStrings };
|